@divinevoxel/vlox 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Builder/RayProvider.d.ts +6 -0
- package/Builder/Tools/Brush/BrushTool.d.ts +55 -0
- package/Builder/Tools/Brush/BrushTool.js +352 -0
- package/Builder/Tools/BuilderToolBase.d.ts +39 -0
- package/Builder/Tools/BuilderToolBase.js +42 -0
- package/Builder/Tools/Hand/HandTool.d.ts +24 -0
- package/Builder/Tools/Hand/HandTool.js +73 -0
- package/Builder/Tools/Path/PahtTool.d.ts +34 -0
- package/Builder/Tools/Path/PahtTool.js +128 -0
- package/Builder/Tools/Sculpt/SculptTool.d.ts +34 -0
- package/Builder/Tools/Sculpt/SculptTool.js +102 -0
- package/Builder/Tools/Shape/ShapeTool.d.ts +32 -0
- package/Builder/Tools/Shape/ShapeTool.js +78 -0
- package/Builder/Tools/Template/TemplateTool.d.ts +35 -0
- package/Builder/Tools/Template/TemplateTool.js +73 -0
- package/Builder/Tools/Wand/WandTool.d.ts +30 -0
- package/Builder/Tools/Wand/WandTool.js +90 -0
- package/Builder/Tools/Wrench/WrenchTool.d.ts +47 -0
- package/Builder/Tools/Wrench/WrenchTool.js +184 -0
- package/Builder/Util/FreeBoxSelection.d.ts +12 -0
- package/Builder/Util/FreeBoxSelection.js +21 -0
- package/Builder/Util/FreePointSelection.d.ts +14 -0
- package/Builder/Util/FreePointSelection.js +39 -0
- package/Builder/Util/SurfaceBoxSelection.d.ts +12 -0
- package/Builder/Util/SurfaceBoxSelection.js +25 -0
- package/Builder/VoxelBuildSpace.d.ts +73 -0
- package/Builder/VoxelBuildSpace.js +224 -0
- package/Builder/World/InitTasks.d.ts +1 -0
- package/Builder/World/InitTasks.js +129 -0
- package/Builder/World/VoxelBuildSpaceWorld.d.ts +4 -0
- package/Builder/World/VoxelBuildSpaceWorld.js +10 -0
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +5 -5
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +5 -5
- package/Mesher/Geomtry/Proto/ProtoMesh.d.ts +18 -0
- package/Mesher/Geomtry/Proto/ProtoMesh.js +73 -0
- package/Mesher/Geomtry/{VoxelMeshBuffers.d.ts → Proto/ProtoMeshBuffer.d.ts} +2 -2
- package/Mesher/Geomtry/{VoxelMeshBuffers.js → Proto/ProtoMeshBuffer.js} +2 -2
- package/Mesher/Geomtry/Shapes/Box.d.ts +2 -9
- package/Mesher/Geomtry/Shapes/Box.js +7 -12
- package/Mesher/Geomtry/Transform/TransformBox.js +5 -2
- package/Mesher/InitMesher.js +4 -4
- package/Mesher/InitTask.js +2 -2
- package/Mesher/Items/Base/CompactItemMesh.d.ts +3 -0
- package/Mesher/Items/Base/CompactItemMesh.js +20 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.d.ts +5 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.js +131 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.d.ts +48 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.js +114 -0
- package/Mesher/Items/MeshTexture.d.ts +1 -0
- package/Mesher/Items/MeshTexture.js +214 -0
- package/Mesher/Items/MeshTextureO.js +277 -0
- package/Mesher/Items/Models/ItemModelBuilder.d.ts +27 -0
- package/Mesher/Items/Models/ItemModelBuilder.js +64 -0
- package/Mesher/Types/ItemMesh.types.d.ts +5 -0
- package/Mesher/Types/ItemMesh.types.js +12 -0
- package/Mesher/Types/Mesher.types.d.ts +15 -9
- package/Mesher/Types/Mesher.types.js +14 -0
- package/Mesher/Types/VoxelMesh.types.js +7 -6
- package/Mesher/Voxels/Base/CompactTemplateMesh.d.ts +3 -0
- package/Mesher/{Functions/CompactVoxelMesh.js → Voxels/Base/CompactTemplateMesh.js} +4 -40
- package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.d.ts +2 -2
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.js +11 -7
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.d.ts +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.d.ts +3 -3
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.js +2 -2
- package/Mesher/Voxels/MeshTemplate.d.ts +3 -0
- package/Mesher/Voxels/MeshTemplate.js +81 -0
- package/Mesher/{Functions → Voxels}/MeshVoxel.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/MeshVoxel.js +6 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.js +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/GetTexture.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.js +14 -16
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.d.ts +2 -2
- package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +24 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/ConsistentRotationTextureProcedure.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -5
- package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +205 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +28 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +109 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.js +2 -0
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.js +3 -3
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.d.ts +7 -7
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.js +6 -5
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.js +1 -1
- package/Renderer/Classes/DVESectionMeshes.d.ts +1 -1
- package/Renderer/MeshManager.js +1 -1
- package/Settings/EngineSettings.types.d.ts +2 -1
- package/Settings/EngineSettings.types.js +3 -1
- package/Tasks/Paint/Common.js +14 -9
- package/Tasks/Paint/Erase/EraseVoxel.js +1 -1
- package/Tasks/Paint/Erase/EraseVoxelSelection.d.ts +4 -0
- package/Tasks/Paint/Erase/EraseVoxelSelection.js +33 -0
- package/Tasks/Paint/Erase/EraseVoxelTemplate.js +1 -2
- package/Tasks/Paint/Paint/PaintVoxelTemplate.js +1 -1
- package/Tasks/Propagation/Illumanation/RGBUpdate.js +1 -1
- package/Tasks/Tasks.types.d.ts +2 -0
- package/Tasks/TasksIds.d.ts +1 -0
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/WorldGeneration/InitTasks.js +3 -1
- package/Templates/Archive/ArchivedVoxelTemplate.d.ts +6 -5
- package/Templates/Archive/ArchivedVoxelTemplate.js +56 -49
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +4 -4
- package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +0 -1
- package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +0 -2
- package/Templates/Cursor/TemplateCursor.d.ts +6 -1
- package/Templates/Cursor/TemplateCursor.js +16 -3
- package/Templates/Cursor/TemplateProxy.d.ts +1 -0
- package/Templates/Cursor/TemplateProxy.js +9 -0
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
- package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
- package/Templates/Full/FullVoxelTemplate.d.ts +5 -4
- package/Templates/Full/FullVoxelTemplate.js +32 -17
- package/Templates/Functions/ExtrudeSelection.d.ts +5 -0
- package/Templates/Functions/ExtrudeSelection.js +44 -0
- package/Templates/Functions/FillSelection.d.ts +4 -0
- package/Templates/Functions/FillSelection.js +20 -0
- package/Templates/Functions/FlipTemplate.d.ts +2 -2
- package/Templates/Functions/FlipTemplate.js +8 -8
- package/Templates/Functions/RotateTemplate.d.ts +2 -2
- package/Templates/Path/VoxelPath.d.ts +4 -0
- package/Templates/Path/VoxelPath.js +18 -0
- package/Templates/Path/VoxelPath.types.d.ts +1 -0
- package/Templates/Selection/VoxelBFSSelection.d.ts +6 -6
- package/Templates/Selection/VoxelBFSSelection.js +29 -22
- package/Templates/Selection/VoxelBoundsSelection.d.ts +20 -0
- package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +38 -20
- package/Templates/Selection/VoxelPointSelection.d.ts +19 -0
- package/Templates/Selection/VoxelPointSelection.js +49 -0
- package/Templates/Selection/VoxelSelection.d.ts +18 -0
- package/Templates/Selection/VoxelSelection.js +1 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +8 -12
- package/Templates/Selection/VoxelSurfaceSelection.js +88 -84
- package/Templates/Selection/VoxelTemplateSelection.d.ts +13 -4
- package/Templates/Selection/VoxelTemplateSelection.js +27 -9
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +92 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +37 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +137 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +20 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +61 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.d.ts +5 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.js +1 -0
- package/Templates/Shapes/VoxelShape.types.d.ts +2 -0
- package/Templates/Shapes/VoxelShape.types.js +8 -0
- package/Templates/Shapes/VoxelShapeTemplate.d.ts +37 -0
- package/Templates/Shapes/{BasicVoxelShapeTemplate.js → VoxelShapeTemplate.js} +43 -37
- package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +5 -12
- package/Templates/Shapes/VoxelShapeTemplate.types.js +5 -1
- package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
- package/Templates/VoxelTemplateRegister.js +60 -0
- package/Templates/VoxelTemplates.types.d.ts +3 -3
- package/Textures/Classes/CompiledTexture.d.ts +2 -0
- package/Textures/Classes/CompiledTexture.js +19 -1
- package/Textures/Classes/TextureAnimationTexture.d.ts +1 -1
- package/Textures/Functions/BuildTextureData.js +13 -0
- package/Textures/TextureManager.d.ts +1 -0
- package/Textures/TextureManager.js +11 -5
- package/Tools/Brush/Brush.d.ts +2 -0
- package/Tools/Brush/Brush.js +19 -0
- package/Tools/Tasks/TasksTool.d.ts +2 -1
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferConvert.d.ts +1 -1
- package/Util/BinaryBuffer/Functions/BinaryBufferToTypedArray.d.ts +1 -1
- package/Util/LocationData.d.ts +1 -1
- package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +2 -0
- package/Voxels/Cursor/VoxelCursor.interface.js +2 -0
- package/Voxels/Cursor/VoxelLightData.js +2 -2
- package/Voxels/Functions/BuildTagData.js +1 -1
- package/Voxels/Indexes/VoxelIndex.d.ts +1 -0
- package/Voxels/Indexes/VoxelIndex.js +11 -13
- package/Voxels/InitVoxelData.js +5 -14
- package/Voxels/Interaction/Functions/PickVoxel.d.ts +0 -5
- package/Voxels/Interaction/Functions/PickVoxel.js +64 -85
- package/Voxels/Interaction/Functions/PickVoxelWorld.js +21 -46
- package/Voxels/Interaction/VoxelPickResult.d.ts +1 -0
- package/Voxels/Interaction/VoxelPickResult.js +3 -0
- package/Voxels/Models/CompiledVoxelModel.types.d.ts +1 -1
- package/Voxels/Models/Defaults/CubeVoxelGeometry.js +11 -0
- package/Voxels/Models/Defaults/CubeVoxelModels.js +44 -99
- package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -3
- package/Voxels/Models/Defaults/PanelVoxelGeometry.js +2 -226
- package/Voxels/Models/Defaults/PanelVoxelModels.d.ts +1 -0
- package/Voxels/Models/Defaults/PanelVoxelModels.js +100 -258
- package/Voxels/Models/Defaults/StairVoxelModel.js +2 -2
- package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +4 -1
- package/Voxels/Models/Rules/Classes/GeomtryInput.js +26 -5
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +23 -8
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +1 -1
- package/Voxels/Models/VoxelModel.types.d.ts +6 -1
- package/Voxels/State/Schema/BinarySchemaNode.d.ts +2 -1
- package/Voxels/State/Schema/BinarySchemaNode.js +5 -2
- package/Voxels/State/Schema/Conditions/SameVoxelConditions.js +2 -0
- package/Voxels/Types/PaintVoxelData.d.ts +13 -1
- package/Voxels/Types/PaintVoxelData.js +151 -14
- package/World/Archive/Functions/Shared/LightSegments.d.ts +1 -1
- package/World/Cursor/SectionCursor.d.ts +4 -0
- package/World/Cursor/SectionCursor.js +13 -16
- package/World/Cursor/SectorCursor.d.ts +4 -0
- package/World/Cursor/SectorCursor.js +13 -16
- package/World/Cursor/WorldCursor.d.ts +4 -0
- package/World/Cursor/WorldCursor.js +8 -0
- package/World/Sector/Sector.d.ts +1 -1
- package/World/Sector/SectorHeightMap.d.ts +6 -0
- package/World/Sector/SectorHeightMap.js +6 -0
- package/World/SnapShot/SectionSnapShotCursor.d.ts +3 -0
- package/World/SnapShot/SectionSnapShotCursor.js +6 -0
- package/World/WorldSpaces.js +3 -3
- package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +5 -1
- package/WorldSimulation/Dimensions/DimensionSimulation.js +12 -0
- package/WorldSimulation/Dimensions/Generator.d.ts +1 -0
- package/WorldSimulation/Dimensions/Generator.js +1 -0
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +4 -1
- package/WorldSimulation/Dimensions/SimulationSector.js +71 -41
- package/WorldSimulation/Internal/WorldSimulationTasks.js +5 -2
- package/WorldSimulation/Procedures/BuildOnly.d.ts +10 -0
- package/WorldSimulation/Procedures/BuildOnly.js +55 -0
- package/WorldSimulation/Procedures/InitalLoad.js +3 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +2 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.js +11 -3
- package/WorldSimulation/Tasks/TaskSegment.d.ts +2 -1
- package/WorldSimulation/Tasks/TaskSegment.js +3 -1
- package/WorldSimulation/Tick/TickQueue.d.ts +2 -0
- package/WorldSimulation/Tick/TickQueue.js +26 -0
- package/WorldSimulation/Tools/SimulationBrush.d.ts +3 -0
- package/WorldSimulation/Tools/SimulationBrush.js +52 -0
- package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +3 -0
- package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -1
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +2 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +6 -0
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +39 -14
- package/WorldSimulation/WorldSimulation.d.ts +10 -0
- package/WorldSimulation/WorldSimulation.js +41 -1
- package/package.json +1 -30
- package/Mesher/Functions/CompactVoxelMesh.d.ts +0 -3
- package/Mesher/Functions/MeshTexture.js +0 -278
- package/Mesher/Geomtry/VoxelMesh.d.ts +0 -12
- package/Mesher/Geomtry/VoxelMesh.js +0 -25
- package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +0 -25
- package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +0 -162
- package/Templates/Selection/VoxelBoxSelection.d.ts +0 -14
- package/Templates/Selection/VoxelSelecton.d.ts +0 -6
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -35
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/BoxVoxelTemplate.js +0 -75
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/ConeVoxelTemplate.js +0 -69
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/CylinderVoxelTemplate.js +0 -69
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -69
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -30
- package/Templates/Shapes/PyramidVoxelTemplate.js +0 -140
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -24
- package/Templates/Shapes/SphereVoxelTemplate.js +0 -97
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/TorusVoxelTemplate.js +0 -69
- package/Templates/VoxelTempateRegister.js +0 -30
- /package/{Mesher/Models/Nodes/Types/GeomtryNode.types.js → Builder/RayProvider.js} +0 -0
- /package/Mesher/{Functions/MeshTexture.d.ts → Items/MeshTextureO.d.ts} +0 -0
- /package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/GetTexture.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.d.ts +0 -0
- /package/{Templates/Selection/VoxelSelecton.js → Mesher/Voxels/Models/Nodes/Types/GeomtryNode.types.js} +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.js +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VoxelTickUpdateRegister } from "../VoxelTickUpdateRegister";
|
|
2
2
|
import { CardinalNeighbors3D } from "../../../../Math/CardinalNeighbors";
|
|
3
|
+
import { VoxelFaces } from "../../../../Math";
|
|
3
4
|
const floodOutChecks = [
|
|
4
5
|
[1, 0, 0],
|
|
5
6
|
[-1, 0, 0],
|
|
@@ -56,7 +57,7 @@ VoxelTickUpdateRegister.registerType({
|
|
|
56
57
|
const currentLevel = voxel.getLevel();
|
|
57
58
|
const levelState = voxel.getLevelState();
|
|
58
59
|
if (levelState == 1 && currentLevel < 7) {
|
|
59
|
-
voxel.setLevel(
|
|
60
|
+
voxel.setLevel(7);
|
|
60
61
|
voxel.updateVoxel(0);
|
|
61
62
|
simulation.scheduleUpdate("dve_liquid", x, y, z, liquidUpdateRate);
|
|
62
63
|
simulation.bounds.updateDisplay(x, y, z);
|
|
@@ -83,9 +84,7 @@ VoxelTickUpdateRegister.registerType({
|
|
|
83
84
|
downVoxel.getLevelState() == 1) {
|
|
84
85
|
simulation.scheduleUpdate("dve_liquid", x, y - 1, z, liquidUpdateRate);
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
-
voxel.setLevel(0);
|
|
88
|
-
voxel.updateVoxel(1);
|
|
87
|
+
simulation.brush.setXYZ(x, y, z).erase();
|
|
89
88
|
simulation.bounds.updateDisplay(x, y, z);
|
|
90
89
|
for (let i = 0; i < CardinalNeighbors3D.length; i++) {
|
|
91
90
|
const nx = x + CardinalNeighbors3D[i][0];
|
|
@@ -128,12 +127,34 @@ VoxelTickUpdateRegister.registerType({
|
|
|
128
127
|
simulation.bounds.updateDisplay(x, y, z);
|
|
129
128
|
}
|
|
130
129
|
const downVoxel = simulation.nDataCursor.getVoxel(x, y - 1, z);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
const below = simulation.tickCursor[VoxelFaces.Down].getVoxel(x, y - 2, z);
|
|
131
|
+
const isSame = downVoxel && downVoxel.isSameVoxel(voxel);
|
|
132
|
+
if (downVoxel && (downVoxel.isAir() || isSame)) {
|
|
133
|
+
let addToTick = false;
|
|
134
|
+
if (downVoxel.isAir()) {
|
|
135
|
+
simulation.brush
|
|
136
|
+
.setXYZ(x, y - 1, z)
|
|
137
|
+
.setId(voxel.getStringId())
|
|
138
|
+
.setLevel((!below?.isAir() && !below?.isSameVoxel(voxel)) ? 7 : 0)
|
|
139
|
+
.setLevelState((below?.isAir() || below?.isSameVoxel(voxel)) ? 1 : 0)
|
|
140
|
+
.paint()
|
|
141
|
+
.clear();
|
|
142
|
+
addToTick = true;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
/* if (
|
|
146
|
+
downVoxel.getLevelState() !== 1 &&
|
|
147
|
+
below &&
|
|
148
|
+
below.isSameVoxel(voxel)
|
|
149
|
+
) {
|
|
150
|
+
downVoxel.setLevel(7);
|
|
151
|
+
downVoxel.setLevelState(1);
|
|
152
|
+
downVoxel.updateVoxel(0);
|
|
153
|
+
addToTick = true;
|
|
154
|
+
} */
|
|
155
|
+
}
|
|
156
|
+
if (addToTick) {
|
|
157
|
+
simulation.bounds.updateDisplay(x, y - 1, z);
|
|
137
158
|
simulation.scheduleUpdate("dve_liquid", x, y - 1, z, liquidUpdateRate);
|
|
138
159
|
}
|
|
139
160
|
return;
|
|
@@ -142,7 +163,7 @@ VoxelTickUpdateRegister.registerType({
|
|
|
142
163
|
const nx = floodOutChecks[i][0] + x;
|
|
143
164
|
const ny = floodOutChecks[i][1] + y;
|
|
144
165
|
const nz = floodOutChecks[i][2] + z;
|
|
145
|
-
const nVoxel = simulation.
|
|
166
|
+
const nVoxel = simulation.nDataCursor.getVoxel(nx, ny, nz);
|
|
146
167
|
if (!nVoxel || !(nVoxel.isSameVoxel(voxel) || nVoxel.isAir()))
|
|
147
168
|
continue;
|
|
148
169
|
const vLevel = nVoxel.getLevel();
|
|
@@ -150,14 +171,18 @@ VoxelTickUpdateRegister.registerType({
|
|
|
150
171
|
if (nState == 2)
|
|
151
172
|
continue;
|
|
152
173
|
if (vLevel + 1 < currentLevel) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
174
|
+
simulation.brush
|
|
175
|
+
.setId(voxel.getStringId())
|
|
176
|
+
.setXYZ(nx, ny, nz)
|
|
177
|
+
.setLevel(vLevel + 1)
|
|
178
|
+
.setLevelState(1)
|
|
179
|
+
.paint();
|
|
156
180
|
simulation.bounds.updateDisplay(nx, ny, nz);
|
|
157
181
|
if (currentLevel - 1 > 0) {
|
|
158
182
|
simulation.scheduleUpdate("dve_liquid", nx, ny, nz, liquidUpdateRate);
|
|
159
183
|
}
|
|
160
184
|
}
|
|
161
185
|
}
|
|
186
|
+
simulation.brush.clear();
|
|
162
187
|
},
|
|
163
188
|
});
|
|
@@ -2,6 +2,7 @@ import { Thread, ThreadPool } from "@amodx/threads";
|
|
|
2
2
|
import { WorldStorageInterface } from "../World/Types/WorldStorage.interface";
|
|
3
3
|
import { Generator, GeneratorData } from "./Dimensions/Generator";
|
|
4
4
|
import { InitalLoad } from "./Procedures/InitalLoad";
|
|
5
|
+
import { BuildOnly } from "./Procedures/BuildOnly";
|
|
5
6
|
import SaveAllSectors from "./Procedures/SaveAllSectors";
|
|
6
7
|
interface WorldSimulationInitData {
|
|
7
8
|
parent: Thread;
|
|
@@ -19,6 +20,15 @@ export declare class WorldSimulation {
|
|
|
19
20
|
static Procedures: {
|
|
20
21
|
InitalLoad: typeof InitalLoad;
|
|
21
22
|
SaveAllSectors: typeof SaveAllSectors;
|
|
23
|
+
BuildOnly: typeof BuildOnly;
|
|
24
|
+
};
|
|
25
|
+
static logTasks(): {
|
|
26
|
+
loading: number[];
|
|
27
|
+
generating: number[];
|
|
28
|
+
propagating: number[];
|
|
29
|
+
sun: number[];
|
|
30
|
+
building: number[];
|
|
31
|
+
unbuilding: number[];
|
|
22
32
|
};
|
|
23
33
|
static init(data: WorldSimulationInitData): void;
|
|
24
34
|
static createGenerator(data: Partial<GeneratorData>): Generator;
|
|
@@ -5,6 +5,7 @@ import { WorldSimulationTools } from "./Internal/WorldSimulationTools";
|
|
|
5
5
|
import { WorldSimulationDimensions } from "./Internal/WorldSimulationDimensions";
|
|
6
6
|
import { Vector3Like } from "@amodx/math";
|
|
7
7
|
import { InitalLoad } from "./Procedures/InitalLoad";
|
|
8
|
+
import { BuildOnly } from "./Procedures/BuildOnly";
|
|
8
9
|
import SaveAllSectors from "./Procedures/SaveAllSectors";
|
|
9
10
|
import { runActiveSectorUpdate } from "./Internal/runActiveSectorUpdate";
|
|
10
11
|
let initalized = false;
|
|
@@ -20,7 +21,36 @@ export class WorldSimulation {
|
|
|
20
21
|
static Procedures = {
|
|
21
22
|
InitalLoad,
|
|
22
23
|
SaveAllSectors,
|
|
24
|
+
BuildOnly,
|
|
23
25
|
};
|
|
26
|
+
static logTasks() {
|
|
27
|
+
return {
|
|
28
|
+
loading: [
|
|
29
|
+
WorldSimulationTasks.worldLoadTasks.getTotal(0),
|
|
30
|
+
WorldSimulationTasks.worldLoadTasks.getTotalWaitingFor(0),
|
|
31
|
+
],
|
|
32
|
+
generating: [
|
|
33
|
+
WorldSimulationTasks.worldGenTasks.getTotal(0),
|
|
34
|
+
WorldSimulationTasks.worldGenTasks.getTotalWaitingFor(0),
|
|
35
|
+
],
|
|
36
|
+
propagating: [
|
|
37
|
+
WorldSimulationTasks.worldPropagationTasks.getTotal(0),
|
|
38
|
+
WorldSimulationTasks.worldPropagationTasks.getTotalWaitingFor(0),
|
|
39
|
+
],
|
|
40
|
+
sun: [
|
|
41
|
+
WorldSimulationTasks.worldSunTasks.getTotal(0),
|
|
42
|
+
WorldSimulationTasks.worldSunTasks.getTotalWaitingFor(0),
|
|
43
|
+
],
|
|
44
|
+
building: [
|
|
45
|
+
WorldSimulationTasks.buildTasks.getTotal(0),
|
|
46
|
+
WorldSimulationTasks.buildTasks.getTotalWaitingFor(0),
|
|
47
|
+
],
|
|
48
|
+
unbuilding: [
|
|
49
|
+
WorldSimulationTasks.unbuildTasks.getTotal(0),
|
|
50
|
+
WorldSimulationTasks.unbuildTasks.getTotalWaitingFor(0),
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
24
54
|
static init(data) {
|
|
25
55
|
initalized = true;
|
|
26
56
|
WorldSimulationTools.parent = data.parent;
|
|
@@ -59,9 +89,11 @@ export class WorldSimulation {
|
|
|
59
89
|
return false;
|
|
60
90
|
}
|
|
61
91
|
static tick(generationOnly = false) {
|
|
92
|
+
let total = 0;
|
|
62
93
|
for (const [, dimension] of WorldSimulationDimensions._dimensions) {
|
|
63
94
|
dimension.incrementTick();
|
|
64
95
|
for (let i = 0; i < dimension.activeSectors._sectors.length; i++) {
|
|
96
|
+
total += dimension.activeSectors._sectors[i].tickQueue.getTotalTicks();
|
|
65
97
|
dimension.activeSectors._sectors[i].tickUpdate();
|
|
66
98
|
dimension.activeSectors._sectors[i].generateUpdate();
|
|
67
99
|
}
|
|
@@ -83,9 +115,17 @@ export class WorldSimulation {
|
|
|
83
115
|
WorldSimulationTasks.worldDecorateTasks.runTask();
|
|
84
116
|
WorldSimulationTasks.worldSunTasks.runTask();
|
|
85
117
|
WorldSimulationTasks.worldPropagationTasks.runTask();
|
|
118
|
+
/* console.log(
|
|
119
|
+
"total ticks",
|
|
120
|
+
total,
|
|
121
|
+
"building",
|
|
122
|
+
"building",
|
|
123
|
+
WorldSimulationTasks.buildTasks.getTotalWaitingFor(0),
|
|
124
|
+
WorldSimulationTasks.buildTasks.getTotal(0)
|
|
125
|
+
); */
|
|
86
126
|
if (generationOnly)
|
|
87
127
|
return;
|
|
88
|
-
WorldSimulationTasks.buildTasks.runTask(
|
|
128
|
+
WorldSimulationTasks.buildTasks.runTask(32);
|
|
89
129
|
WorldSimulationTasks.saveTasks.runTask(50);
|
|
90
130
|
WorldSimulationTasks.unloadTasks.runTask(50);
|
|
91
131
|
WorldSimulationTasks.unbuildTasks.runTask();
|
package/package.json
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@divinevoxel/vlox",
|
|
3
|
-
"version": "0.0.75",
|
|
4
|
-
"description": "Vlox a block style voxel engine.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"devDependencies": {},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "mkdir -p dist && rm -rf dist/* && cp package.json dist/package.json && cp README.md ./dist/README.md && cp ./LICENSE.md ./dist/LICENSE.md && cd ./src && npx tsc",
|
|
11
|
-
"compile": "cd src && npx tsc --watch"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"author": "Divine Star Software",
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"repository": {
|
|
17
|
-
"url": "git+https://github.com/Divine-Star-Software/DivineVoxelEngine.git"
|
|
18
|
-
},
|
|
19
|
-
"bugs": {
|
|
20
|
-
"url": "https://github.com/Divine-Star-Software/DivineVoxelEngine/issues"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@amodx/math": "latest",
|
|
24
|
-
"@amodx/binary": "latest",
|
|
25
|
-
"@amodx/threads": "latest"
|
|
26
|
-
},
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{"name":"@divinevoxel/vlox","version":"0.0.77","description":"Vlox a block style voxel engine.","main":"index.js","types":"index.d.ts","type":"module","devDependencies":{},"scripts":{"clean:dist-ts":"test -d dist && find dist -type f \\( -name \"*.js\" -o -name \"*.d.ts\" \\) -delete || true","build":"mkdir -p dist && npm run clean:dist-ts && cp package.json dist/package.json && cd ./src && npx tsc","publish":"mkdir -p dist && rm -rf dist/* && cp package.json dist/package.json && cp README.md ./dist/README.md && cp ./LICENSE.md ./dist/LICENSE.md && cd ./src && npx tsc","compile":"cd src && npx tsc --watch","compile:fresh":"npm run clean:dist-ts && cd src && npx tsc --watch"},"keywords":[],"author":"Divine Star Software","license":"MIT","repository":{"url":"git+https://github.com/Divine-Star-Software/DivineVoxelEngine.git"},"bugs":{"url":"https://github.com/Divine-Star-Software/DivineVoxelEngine/issues"},"dependencies":{"@amodx/math":"latest","@amodx/binary":"latest","@amodx/threads":"latest"},"publishConfig":{"access":"public"}}
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { Quad } from "../Geomtry/Primitives/Quad";
|
|
2
|
-
const Quads = {
|
|
3
|
-
north: Quad.Create([
|
|
4
|
-
[1, 1, 0],
|
|
5
|
-
[0, 1, 0],
|
|
6
|
-
[0, 0, 0],
|
|
7
|
-
[1, 0, 0],
|
|
8
|
-
], Quad.FullUVs),
|
|
9
|
-
south: Quad.Create([
|
|
10
|
-
[1, 1, 0],
|
|
11
|
-
[0, 1, 0],
|
|
12
|
-
[0, 0, 0],
|
|
13
|
-
[1, 0, 0],
|
|
14
|
-
], Quad.FullUVs),
|
|
15
|
-
};
|
|
16
|
-
//const tool = new MesherDataTool();
|
|
17
|
-
//tool.startNewMesh();
|
|
18
|
-
//tool.mesh!.attributes.set("uv", [[], 2, BinaryNumberTypes.Float32]);
|
|
19
|
-
//tool.mesh!.attributes.set("textureIndex", [[], 3, BinaryNumberTypes.Float32]);
|
|
20
|
-
export function MeshTexture(textureId, textureData) {
|
|
21
|
-
/*
|
|
22
|
-
const width = Math.sqrt(textureData.length / 4);
|
|
23
|
-
const height = Math.sqrt(textureData.length / 4);
|
|
24
|
-
const factor = 1 / width;
|
|
25
|
-
|
|
26
|
-
const textureDataIndex = Flat2DIndex.GetXYOrder();
|
|
27
|
-
textureDataIndex.setBounds(width, height);
|
|
28
|
-
|
|
29
|
-
const origin = Vector3Like.Create(-0.5, -0.5, -0.5);
|
|
30
|
-
|
|
31
|
-
const isSolid = (x: number, y: number) =>
|
|
32
|
-
x >= 0 &&
|
|
33
|
-
x < width &&
|
|
34
|
-
y >= 0 &&
|
|
35
|
-
y < height &&
|
|
36
|
-
textureData[textureDataIndex.getIndexXY(x, y) * 4 + 3] > 0.01
|
|
37
|
-
? true
|
|
38
|
-
: false;
|
|
39
|
-
|
|
40
|
-
const uvs = tool.mesh!.getAttribute("uv");
|
|
41
|
-
const textureIndex = tool.mesh!.getAttribute("textureIndex");
|
|
42
|
-
const uvOffset = width > 16 ? -(2 / Math.max(width, height)) : 0;
|
|
43
|
-
|
|
44
|
-
const addUvs = (sx: number, sy: number, ex: number, ey: number) => {
|
|
45
|
-
uvs.push(
|
|
46
|
-
(ex + uvOffset) * factor,
|
|
47
|
-
(ey + uvOffset) * factor,
|
|
48
|
-
(sx - uvOffset) * factor,
|
|
49
|
-
(ey + uvOffset) * factor,
|
|
50
|
-
(sx - uvOffset) * factor,
|
|
51
|
-
(sy - uvOffset) * factor,
|
|
52
|
-
(ex + uvOffset) * factor,
|
|
53
|
-
(sy - uvOffset) * factor
|
|
54
|
-
);
|
|
55
|
-
textureIndex.push(
|
|
56
|
-
textureId,
|
|
57
|
-
0,
|
|
58
|
-
0,
|
|
59
|
-
textureId,
|
|
60
|
-
0,
|
|
61
|
-
0,
|
|
62
|
-
textureId,
|
|
63
|
-
0,
|
|
64
|
-
0,
|
|
65
|
-
textureId,
|
|
66
|
-
0,
|
|
67
|
-
0
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
GeometryBuilder.addQuad(tool, origin, Quads.south);
|
|
73
|
-
uvs.push(
|
|
74
|
-
Quads.south.uvs.vertices[QuadVerticies.TopRight].x,
|
|
75
|
-
Quads.south.uvs.vertices[QuadVerticies.TopRight].y,
|
|
76
|
-
Quads.south.uvs.vertices[QuadVerticies.TopLeft].x,
|
|
77
|
-
Quads.south.uvs.vertices[QuadVerticies.TopLeft].y,
|
|
78
|
-
Quads.south.uvs.vertices[QuadVerticies.BottomLeft].x,
|
|
79
|
-
Quads.south.uvs.vertices[QuadVerticies.BottomLeft].y,
|
|
80
|
-
Quads.south.uvs.vertices[QuadVerticies.BottomRight].x,
|
|
81
|
-
Quads.south.uvs.vertices[QuadVerticies.BottomRight].y
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
textureIndex.push(
|
|
85
|
-
textureId,
|
|
86
|
-
0,
|
|
87
|
-
0,
|
|
88
|
-
textureId,
|
|
89
|
-
0,
|
|
90
|
-
0,
|
|
91
|
-
textureId,
|
|
92
|
-
0,
|
|
93
|
-
0,
|
|
94
|
-
textureId,
|
|
95
|
-
0,
|
|
96
|
-
0
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
const backPositionZ = factor;
|
|
102
|
-
Quads.north.positions.vertices[QuadVerticies.TopRight].z = backPositionZ;
|
|
103
|
-
Quads.north.positions.vertices[QuadVerticies.TopLeft].z = backPositionZ;
|
|
104
|
-
Quads.north.positions.vertices[QuadVerticies.BottomLeft].z = backPositionZ;
|
|
105
|
-
Quads.north.positions.vertices[QuadVerticies.BottomRight].z = backPositionZ;
|
|
106
|
-
Quads.north.flip = true;
|
|
107
|
-
uvs.push(
|
|
108
|
-
Quads.north.uvs.vertices[QuadVerticies.TopLeft].x,
|
|
109
|
-
Quads.north.uvs.vertices[QuadVerticies.TopLeft].y,
|
|
110
|
-
Quads.north.uvs.vertices[QuadVerticies.TopRight].x,
|
|
111
|
-
Quads.north.uvs.vertices[QuadVerticies.TopRight].y,
|
|
112
|
-
Quads.north.uvs.vertices[QuadVerticies.BottomRight].x,
|
|
113
|
-
Quads.north.uvs.vertices[QuadVerticies.BottomRight].y,
|
|
114
|
-
Quads.north.uvs.vertices[QuadVerticies.BottomLeft].x,
|
|
115
|
-
Quads.north.uvs.vertices[QuadVerticies.BottomLeft].y
|
|
116
|
-
);
|
|
117
|
-
GeometryBuilder.addQuad(tool, origin, Quads.north);
|
|
118
|
-
textureIndex.push(
|
|
119
|
-
textureId,
|
|
120
|
-
0,
|
|
121
|
-
0,
|
|
122
|
-
textureId,
|
|
123
|
-
0,
|
|
124
|
-
0,
|
|
125
|
-
textureId,
|
|
126
|
-
0,
|
|
127
|
-
0,
|
|
128
|
-
textureId,
|
|
129
|
-
0,
|
|
130
|
-
0
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
for (let x = 0; x < width; x++) {
|
|
135
|
-
let eastFace: Vec2Array | null = null;
|
|
136
|
-
let westFace: Vec2Array | null = null;
|
|
137
|
-
for (let y = 0; y < height; y++) {
|
|
138
|
-
let eastFaceExposed = true;
|
|
139
|
-
let westFaceExposed = true;
|
|
140
|
-
|
|
141
|
-
if (!isSolid(x, y)) {
|
|
142
|
-
eastFaceExposed = false;
|
|
143
|
-
westFaceExposed = false;
|
|
144
|
-
}
|
|
145
|
-
if (isSolid(x + 1, y)) {
|
|
146
|
-
eastFaceExposed = false;
|
|
147
|
-
}
|
|
148
|
-
if (isSolid(x - 1, y)) {
|
|
149
|
-
westFaceExposed = false;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (eastFace && !eastFaceExposed) {
|
|
153
|
-
const newQuad = Quad.Create(
|
|
154
|
-
[
|
|
155
|
-
[x * factor + factor, eastFace[1] * factor, 0],
|
|
156
|
-
[x * factor + factor, y * factor, factor],
|
|
157
|
-
],
|
|
158
|
-
Quad.FullUVs as any,
|
|
159
|
-
false,
|
|
160
|
-
0
|
|
161
|
-
);
|
|
162
|
-
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
163
|
-
|
|
164
|
-
let [sx, sy] = eastFace;
|
|
165
|
-
let ex = x;
|
|
166
|
-
let ey = y;
|
|
167
|
-
ex += 1;
|
|
168
|
-
addUvs(sx, sy, ex, ey);
|
|
169
|
-
eastFace = null;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (westFace && !westFaceExposed) {
|
|
173
|
-
const newQuad = Quad.Create(
|
|
174
|
-
[
|
|
175
|
-
[x * factor, westFace[1] * factor, 0],
|
|
176
|
-
[x * factor, y * factor, factor],
|
|
177
|
-
],
|
|
178
|
-
Quad.FullUVs as any,
|
|
179
|
-
false,
|
|
180
|
-
1
|
|
181
|
-
);
|
|
182
|
-
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
183
|
-
let [sx, sy] = westFace;
|
|
184
|
-
let ex = x;
|
|
185
|
-
let ey = y;
|
|
186
|
-
ex += 1;
|
|
187
|
-
addUvs(sx, sy, ex, ey);
|
|
188
|
-
westFace = null;
|
|
189
|
-
}
|
|
190
|
-
const isPixel = isSolid(x, y);
|
|
191
|
-
if (!isSolid(x + 1, y) && !eastFace && isPixel) {
|
|
192
|
-
eastFace = [x, y];
|
|
193
|
-
}
|
|
194
|
-
if (!isSolid(x - 1, y) && !westFace && isPixel) {
|
|
195
|
-
westFace = [x, y];
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
for (let y = 0; y < height; y++) {
|
|
200
|
-
let upFace: Vec2Array | null = null;
|
|
201
|
-
let downFace: Vec2Array | null = null;
|
|
202
|
-
|
|
203
|
-
for (let x = 0; x < width; x++) {
|
|
204
|
-
let upFaceExposed = true;
|
|
205
|
-
let downFaceExposed = true;
|
|
206
|
-
|
|
207
|
-
if (!isSolid(x, y)) {
|
|
208
|
-
upFaceExposed = false;
|
|
209
|
-
downFaceExposed = false;
|
|
210
|
-
}
|
|
211
|
-
if (isSolid(x, y + 1)) {
|
|
212
|
-
upFaceExposed = false;
|
|
213
|
-
}
|
|
214
|
-
if (isSolid(x, y - 1)) {
|
|
215
|
-
downFaceExposed = false;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (upFace && !upFaceExposed) {
|
|
219
|
-
const newQuad = Quad.Create(
|
|
220
|
-
[
|
|
221
|
-
[upFace[0] * factor, y * factor + factor, 0],
|
|
222
|
-
[x * factor, y * factor + factor, factor],
|
|
223
|
-
],
|
|
224
|
-
Quad.FullUVs as any,
|
|
225
|
-
false,
|
|
226
|
-
0
|
|
227
|
-
);
|
|
228
|
-
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
229
|
-
let [sx, sy] = upFace;
|
|
230
|
-
let [ex, ey] = [x, y];
|
|
231
|
-
|
|
232
|
-
ey += 1;
|
|
233
|
-
addUvs(sx, sy, ex, ey);
|
|
234
|
-
upFace = null;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (downFace && !downFaceExposed) {
|
|
238
|
-
const newQuad = Quad.Create(
|
|
239
|
-
[
|
|
240
|
-
[downFace[0] * factor, y * factor, 0],
|
|
241
|
-
[x * factor, y * factor, factor],
|
|
242
|
-
],
|
|
243
|
-
Quad.FullUVs as any,
|
|
244
|
-
false,
|
|
245
|
-
1
|
|
246
|
-
);
|
|
247
|
-
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
248
|
-
let [sx, sy] = downFace;
|
|
249
|
-
let [ex, ey] = [x, y];
|
|
250
|
-
ey += 1;
|
|
251
|
-
addUvs(sx, sy, ex, ey);
|
|
252
|
-
downFace = null;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
const isPixel = isSolid(x, y);
|
|
256
|
-
if (!isSolid(x, y + 1) && !upFace && isPixel) {
|
|
257
|
-
upFace = [x, y];
|
|
258
|
-
}
|
|
259
|
-
if (!isSolid(x, y - 1) && !downFace && isPixel) {
|
|
260
|
-
downFace = [x, y];
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
for (const [key, [data]] of tool.mesh!.attributes) {
|
|
266
|
-
if (key == "position") {
|
|
267
|
-
for (let i = 0; i < data.length; i += 3) {
|
|
268
|
-
(data as any as number[])[i] -= 0.5;
|
|
269
|
-
(data as any as number[])[i + 1] -= 0.5;
|
|
270
|
-
(data as any as number[])[i + 2];
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
const compacted = CompactMesh("dve_node", tool);
|
|
276
|
-
*/
|
|
277
|
-
// return tool.mesh;
|
|
278
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { VoxelVertexBuffer, VoxelIndiceBuffer } from "./VoxelMeshBuffers";
|
|
3
|
-
export declare class VoxelMesh {
|
|
4
|
-
indicieCount: number;
|
|
5
|
-
vertexCount: number;
|
|
6
|
-
minBounds: Vector3Like;
|
|
7
|
-
maxBounds: Vector3Like;
|
|
8
|
-
readonly buffer: VoxelVertexBuffer;
|
|
9
|
-
readonly indices: VoxelIndiceBuffer;
|
|
10
|
-
addVerticies(vertexCount: number, indicesCount: number): void;
|
|
11
|
-
clear(): void;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { VoxelVertexBuffer, VoxelIndiceBuffer } from "./VoxelMeshBuffers";
|
|
3
|
-
import { VoxelMeshVertexStructCursor } from "./VoxelMeshVertexStructCursor";
|
|
4
|
-
export class VoxelMesh {
|
|
5
|
-
indicieCount = 0;
|
|
6
|
-
vertexCount = 0;
|
|
7
|
-
minBounds = Vector3Like.Create(Infinity, Infinity, Infinity);
|
|
8
|
-
maxBounds = Vector3Like.Create(-Infinity, -Infinity, -Infinity);
|
|
9
|
-
buffer = new VoxelVertexBuffer(VoxelMeshVertexStructCursor.VertexFloatSize, 1024);
|
|
10
|
-
indices = new VoxelIndiceBuffer(1024);
|
|
11
|
-
addVerticies(vertexCount, indicesCount) {
|
|
12
|
-
this.vertexCount += vertexCount;
|
|
13
|
-
this.indicieCount += indicesCount;
|
|
14
|
-
}
|
|
15
|
-
clear() {
|
|
16
|
-
this.indicieCount = 0;
|
|
17
|
-
this.vertexCount = 0;
|
|
18
|
-
this.minBounds.x = Infinity;
|
|
19
|
-
this.minBounds.y = Infinity;
|
|
20
|
-
this.minBounds.z = Infinity;
|
|
21
|
-
this.maxBounds.x = -Infinity;
|
|
22
|
-
this.maxBounds.y = -Infinity;
|
|
23
|
-
this.maxBounds.z = -Infinity;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Vec3Array, Vector4Like } from "@amodx/math";
|
|
2
|
-
import type { Quad } from "../../../Geomtry";
|
|
3
|
-
import { VoxelModelBuilder } from "Mesher/Models/VoxelModelBuilder";
|
|
4
|
-
import { TextureProcedure, BaseVoxelGeomtryTextureProcedureData } from "../TextureProcedure";
|
|
5
|
-
import { TextureId } from "Textures";
|
|
6
|
-
import { VoxelFaces } from "Math";
|
|
7
|
-
/**
|
|
8
|
-
* Extend your data type so we can add a seed if we want, and define
|
|
9
|
-
* the rotations we can choose from.
|
|
10
|
-
*/
|
|
11
|
-
interface VoxelGeometryConsistentRotationTextureProcedureData extends BaseVoxelGeomtryTextureProcedureData {
|
|
12
|
-
type: "consistent-rotation";
|
|
13
|
-
texture: TextureId | number;
|
|
14
|
-
/**
|
|
15
|
-
* You can allow (0 | 90 | 180 | 270), or remove 0 if you don’t want an unrotated option
|
|
16
|
-
*/
|
|
17
|
-
rotations: (0 | 90 | 180 | 270)[];
|
|
18
|
-
rotationBounds?: Vec3Array;
|
|
19
|
-
}
|
|
20
|
-
export declare class ConsistentRotationTextureProcedure extends TextureProcedure<VoxelGeometryConsistentRotationTextureProcedureData> {
|
|
21
|
-
getTexture(builder: VoxelModelBuilder, data: VoxelGeometryConsistentRotationTextureProcedureData, closestFace: VoxelFaces, primitive: Quad): number;
|
|
22
|
-
getOverlayTexture(builder: VoxelModelBuilder, data: VoxelGeometryConsistentRotationTextureProcedureData, closestFace: VoxelFaces, primitive: Quad, ref: Vector4Like): Vector4Like;
|
|
23
|
-
transformUVs(builder: VoxelModelBuilder, data: VoxelGeometryConsistentRotationTextureProcedureData, closestFace: VoxelFaces, primitive: Quad): void;
|
|
24
|
-
}
|
|
25
|
-
export {};
|