@divinevoxel/vlox 0.0.76 → 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/Tools/Brush/BrushTool.d.ts +16 -9
- package/Builder/Tools/Brush/BrushTool.js +258 -52
- package/Builder/Tools/BuilderToolBase.d.ts +36 -0
- package/Builder/Tools/BuilderToolBase.js +39 -0
- package/Builder/Tools/Hand/HandTool.d.ts +9 -7
- package/Builder/Tools/Hand/HandTool.js +40 -23
- package/Builder/Tools/Path/PahtTool.d.ts +12 -7
- package/Builder/Tools/Path/PahtTool.js +32 -21
- 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 +9 -7
- package/Builder/Tools/Wand/WandTool.js +43 -20
- package/Builder/Tools/Wrench/WrenchTool.d.ts +7 -7
- package/Builder/Tools/Wrench/WrenchTool.js +22 -13
- 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/{Tools/Box/BoxSelection.js → Util/SurfaceBoxSelection.js} +1 -3
- package/Builder/VoxelBuildSpace.d.ts +37 -25
- package/Builder/VoxelBuildSpace.js +99 -40
- package/Builder/World/InitTasks.js +17 -22
- 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 +9 -8
- 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 +1 -1
- 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 +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +2 -2
- 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/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/PaintVoxel.js +1 -1
- 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 +5 -5
- package/Templates/Archive/ArchivedVoxelTemplate.js +52 -49
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +0 -2
- 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 +13 -2
- package/Templates/Cursor/TemplateProxy.js +1 -6
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
- package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
- package/Templates/Full/FullVoxelTemplate.d.ts +4 -4
- package/Templates/Full/FullVoxelTemplate.js +29 -18
- 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.js +2 -1
- package/Templates/Selection/VoxelBFSSelection.d.ts +3 -6
- package/Templates/Selection/VoxelBFSSelection.js +20 -24
- package/Templates/Selection/{VoxelBoxSelection.d.ts → VoxelBoundsSelection.d.ts} +9 -6
- package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +29 -22
- package/Templates/Selection/VoxelPointSelection.d.ts +8 -6
- package/Templates/Selection/VoxelPointSelection.js +25 -24
- package/Templates/Selection/VoxelSelection.d.ts +18 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +5 -12
- package/Templates/Selection/VoxelSurfaceSelection.js +76 -90
- package/Templates/Selection/VoxelTemplateSelection.d.ts +10 -4
- package/Templates/Selection/VoxelTemplateSelection.js +18 -10
- 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 +4 -13
- package/Templates/Shapes/VoxelShapeTemplate.types.js +0 -1
- package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
- package/Templates/VoxelTemplateRegister.js +60 -0
- package/Templates/VoxelTemplates.types.d.ts +2 -3
- package/Textures/Classes/CompiledTexture.d.ts +2 -0
- package/Textures/Classes/CompiledTexture.js +19 -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/Voxels/Cursor/DataCursor.interface.d.ts +4 -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 +6 -3
- 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/Types/PaintVoxelData.d.ts +2 -0
- package/Voxels/Types/PaintVoxelData.js +51 -0
- 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/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 +3 -0
- 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/Builder/Tools/Box/BoxSelection.d.ts +0 -12
- package/Builder/Tools/Box/BoxTool.d.ts +0 -31
- package/Builder/Tools/Box/BoxTool.js +0 -91
- package/Builder/Tools/Box/BoxToolTemplate.d.ts +0 -13
- package/Builder/Tools/Box/BoxToolTemplate.js +0 -23
- package/Builder/VoxelBuilder.types.d.ts +0 -0
- package/Builder/VoxelBuilder.types.js +0 -1
- 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/VoxelSelecton.d.ts +0 -9
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -36
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/BoxVoxelTemplate.js +0 -83
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/ConeVoxelTemplate.js +0 -73
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/CylinderVoxelTemplate.js +0 -73
- package/Templates/Shapes/EllipsoidVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/EllipsoidVoxelTemplate.js +0 -89
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -73
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -31
- package/Templates/Shapes/PyramidVoxelTemplate.js +0 -148
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -15
- package/Templates/Shapes/SphereVoxelTemplate.js +0 -59
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/TorusVoxelTemplate.js +0 -73
- package/Templates/VoxelTempateRegister.js +0 -30
- /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/Mesher/{Models → 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
- /package/Templates/Selection/{VoxelSelecton.js → VoxelSelection.js} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { WorldSimulation } from "../WorldSimulation";
|
|
2
|
+
import { WorldSimulationDimensions } from "../Internal/WorldSimulationDimensions";
|
|
3
|
+
import { WorldSimulationTools } from "../Internal/WorldSimulationTools";
|
|
4
|
+
import SaveAllSectors from "./SaveAllSectors";
|
|
5
|
+
/**# InitalLoad
|
|
6
|
+
* ---
|
|
7
|
+
* Load the world without building.
|
|
8
|
+
*/
|
|
9
|
+
export async function BuildOnly(props) {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
const generator = WorldSimulation.createGenerator({
|
|
12
|
+
...props.genData,
|
|
13
|
+
building: false,
|
|
14
|
+
culling: false,
|
|
15
|
+
});
|
|
16
|
+
if (!WorldSimulationDimensions._dimensions.has(generator._dimension)) {
|
|
17
|
+
WorldSimulationDimensions.addDimension(generator._dimension);
|
|
18
|
+
}
|
|
19
|
+
const dimension = WorldSimulationDimensions.getDimension(props.dimension || 0);
|
|
20
|
+
let done = false;
|
|
21
|
+
generator._building = false;
|
|
22
|
+
WorldSimulation.addGenerator(generator);
|
|
23
|
+
let timeOut = null;
|
|
24
|
+
const update = () => {
|
|
25
|
+
if (done)
|
|
26
|
+
return;
|
|
27
|
+
WorldSimulation.tick(true);
|
|
28
|
+
timeOut = setTimeout(update, 0);
|
|
29
|
+
};
|
|
30
|
+
update();
|
|
31
|
+
const inte = setInterval(() => {
|
|
32
|
+
let allDone = true;
|
|
33
|
+
for (const [key, task] of dimension.tasks) {
|
|
34
|
+
if (!task.generationTask)
|
|
35
|
+
continue;
|
|
36
|
+
if (task.waitingFor > 0 || task._task.size > 0) {
|
|
37
|
+
allDone = false;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!allDone)
|
|
42
|
+
return;
|
|
43
|
+
done = true;
|
|
44
|
+
clearInterval(inte);
|
|
45
|
+
clearTimeout(timeOut);
|
|
46
|
+
WorldSimulation.removeGenerator(generator);
|
|
47
|
+
(async () => {
|
|
48
|
+
if (WorldSimulationTools.worldStorage) {
|
|
49
|
+
await SaveAllSectors();
|
|
50
|
+
}
|
|
51
|
+
resolve(true);
|
|
52
|
+
})();
|
|
53
|
+
}, 250);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
@@ -29,6 +29,9 @@ export async function InitalLoad(props) {
|
|
|
29
29
|
};
|
|
30
30
|
update();
|
|
31
31
|
const inte = setInterval(() => {
|
|
32
|
+
if (props.logTasks) {
|
|
33
|
+
console.log(WorldSimulation.logTasks());
|
|
34
|
+
}
|
|
32
35
|
let allDone = true;
|
|
33
36
|
for (const [key, task] of dimension.tasks) {
|
|
34
37
|
if (!task.generationTask)
|
|
@@ -14,6 +14,8 @@ export type SimulationTaskBaseData = {
|
|
|
14
14
|
export declare class SimulationTaskBase {
|
|
15
15
|
data: SimulationTaskBaseData;
|
|
16
16
|
constructor(data: SimulationTaskBaseData);
|
|
17
|
+
getTotal(dimensionId: number): number;
|
|
18
|
+
getTotalWaitingFor(dimensionId: number): number;
|
|
17
19
|
add(dimensionId: number, x: number, y: number, z: number): void;
|
|
18
20
|
runTask(max?: number): void;
|
|
19
21
|
}
|
|
@@ -4,6 +4,16 @@ export class SimulationTaskBase {
|
|
|
4
4
|
constructor(data) {
|
|
5
5
|
this.data = data;
|
|
6
6
|
}
|
|
7
|
+
getTotal(dimensionId) {
|
|
8
|
+
const dimension = WorldSimulationDimensions.getDimension(dimensionId);
|
|
9
|
+
const task = dimension.getTask(this.data.id);
|
|
10
|
+
return task.nodes.length;
|
|
11
|
+
}
|
|
12
|
+
getTotalWaitingFor(dimensionId) {
|
|
13
|
+
const dimension = WorldSimulationDimensions.getDimension(dimensionId);
|
|
14
|
+
const task = dimension.getTask(this.data.id);
|
|
15
|
+
return task.waitingFor;
|
|
16
|
+
}
|
|
7
17
|
add(dimensionId, x, y, z) {
|
|
8
18
|
const dimension = WorldSimulationDimensions.getDimension(dimensionId);
|
|
9
19
|
const task = dimension.getTask(this.data.id);
|
|
@@ -27,7 +37,6 @@ export class SimulationTaskBase {
|
|
|
27
37
|
const updatePosition = dimension.getUpdatePosition();
|
|
28
38
|
task.sort(updatePosition.x, updatePosition.y, updatePosition.z);
|
|
29
39
|
}
|
|
30
|
-
let count = 0;
|
|
31
40
|
const addBack = [];
|
|
32
41
|
for (const location of task.run()) {
|
|
33
42
|
const [d, x, y, z] = location;
|
|
@@ -38,9 +47,8 @@ export class SimulationTaskBase {
|
|
|
38
47
|
}
|
|
39
48
|
const taskId = task.addTask(x, y, z);
|
|
40
49
|
this.data.run(dimension, location, taskId, task, sector);
|
|
41
|
-
if (
|
|
50
|
+
if (task.waitingFor > max)
|
|
42
51
|
break;
|
|
43
|
-
count++;
|
|
44
52
|
}
|
|
45
53
|
for (let i = 0; i < addBack.length; i += 3) {
|
|
46
54
|
task.add(addBack[i], addBack[i + 1], addBack[i + 2]);
|
|
@@ -3,13 +3,14 @@ import { DimensionSegment } from "../Dimensions/DimensionSegment";
|
|
|
3
3
|
export declare class TaskSegment {
|
|
4
4
|
dimension: DimensionSegment;
|
|
5
5
|
generationTask: boolean;
|
|
6
|
+
log: boolean;
|
|
6
7
|
_hash: Set<unknown>;
|
|
7
8
|
nodes: LocationData[];
|
|
8
9
|
waitingFor: number;
|
|
9
10
|
clear(): void;
|
|
10
11
|
_taskCount: number;
|
|
11
12
|
_task: Map<number, LocationData>;
|
|
12
|
-
constructor(dimension: DimensionSegment, generationTask: boolean);
|
|
13
|
+
constructor(dimension: DimensionSegment, generationTask: boolean, log?: boolean);
|
|
13
14
|
_getLocationData(dimension: number, x: number, y: number, z: number): LocationData;
|
|
14
15
|
completeTask(id: number): boolean;
|
|
15
16
|
addTask(x: number, y: number, z: number): number;
|
|
@@ -3,15 +3,17 @@ const pool = [];
|
|
|
3
3
|
export class TaskSegment {
|
|
4
4
|
dimension;
|
|
5
5
|
generationTask;
|
|
6
|
+
log;
|
|
6
7
|
_hash = new Set();
|
|
7
8
|
nodes = [];
|
|
8
9
|
waitingFor = 0;
|
|
9
10
|
clear() { }
|
|
10
11
|
_taskCount = 0;
|
|
11
12
|
_task = new Map();
|
|
12
|
-
constructor(dimension, generationTask) {
|
|
13
|
+
constructor(dimension, generationTask, log = false) {
|
|
13
14
|
this.dimension = dimension;
|
|
14
15
|
this.generationTask = generationTask;
|
|
16
|
+
this.log = log;
|
|
15
17
|
}
|
|
16
18
|
_getLocationData(dimension, x, y, z) {
|
|
17
19
|
const location = pool.length ? pool.shift() : [0, 0, 0, 0];
|
|
@@ -4,6 +4,8 @@ export declare class TickQueue {
|
|
|
4
4
|
dimension: DimensionSegment;
|
|
5
5
|
constructor(dimension: DimensionSegment);
|
|
6
6
|
ticks: Map<number, VoxelTickUpdate<null>[]>;
|
|
7
|
+
getTotalTicks(): number;
|
|
7
8
|
addTick(data: VoxelTickUpdate, delay?: number): void;
|
|
9
|
+
private compareTick;
|
|
8
10
|
run(): boolean;
|
|
9
11
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
1
2
|
import { VoxelTickUpdateRegister, } from "../Voxels/Ticks/index";
|
|
2
3
|
const tickArrayPool = [];
|
|
3
4
|
export class TickQueue {
|
|
@@ -6,14 +7,39 @@ export class TickQueue {
|
|
|
6
7
|
this.dimension = dimension;
|
|
7
8
|
}
|
|
8
9
|
ticks = new Map();
|
|
10
|
+
getTotalTicks() {
|
|
11
|
+
const tick = this.dimension.getTick();
|
|
12
|
+
const updates = this.ticks.get(tick);
|
|
13
|
+
if (!updates)
|
|
14
|
+
return 0;
|
|
15
|
+
return updates.length;
|
|
16
|
+
}
|
|
9
17
|
addTick(data, delay = 0) {
|
|
10
18
|
const trueTick = this.dimension.getTick() + 1 + delay;
|
|
11
19
|
if (!this.ticks.get(trueTick)) {
|
|
12
20
|
this.ticks.set(trueTick, tickArrayPool.length ? tickArrayPool.shift() : []);
|
|
13
21
|
}
|
|
14
22
|
const ticks = this.ticks.get(trueTick);
|
|
23
|
+
for (let i = 0; i < ticks.length; i++) {
|
|
24
|
+
if (this.compareTick(data, ticks[i])) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
15
28
|
ticks.push(data);
|
|
16
29
|
}
|
|
30
|
+
compareTick(tick, otherTick) {
|
|
31
|
+
if (!(tick.type == otherTick.type && Vector3Like.Equals(otherTick, tick)))
|
|
32
|
+
return false;
|
|
33
|
+
if (!tick.data)
|
|
34
|
+
return true;
|
|
35
|
+
if (typeof tick.data == "number") {
|
|
36
|
+
return tick.data == otherTick.data;
|
|
37
|
+
}
|
|
38
|
+
if (typeof tick.data == "string") {
|
|
39
|
+
return tick.data == otherTick.data;
|
|
40
|
+
}
|
|
41
|
+
return JSON.stringify(tick.data) == JSON.stringify(otherTick.data);
|
|
42
|
+
}
|
|
17
43
|
run() {
|
|
18
44
|
const tick = this.dimension.getTick();
|
|
19
45
|
const updates = this.ticks.get(tick);
|
|
@@ -4,6 +4,7 @@ import { LocationData } from "../../Math";
|
|
|
4
4
|
import { IVoxelTemplate } from "../../Templates/VoxelTemplates.types";
|
|
5
5
|
import { VoxelUpdateData } from "../../Tasks/Tasks.types";
|
|
6
6
|
import { VoxelPath } from "../../Templates/Path/VoxelPath";
|
|
7
|
+
import { IVoxelSelection } from "../../Templates/Selection/VoxelSelection";
|
|
7
8
|
export declare class SimulationBrush extends BrushTool {
|
|
8
9
|
_dimension: DimensionSegment;
|
|
9
10
|
private taskTool;
|
|
@@ -20,6 +21,8 @@ export declare class SimulationBrush extends BrushTool {
|
|
|
20
21
|
eraseAsync(updateData?: VoxelUpdateData): Promise<void>;
|
|
21
22
|
eraseTemplate(voxelTemplate: IVoxelTemplate, updateData?: VoxelUpdateData): this;
|
|
22
23
|
eraseTemplateAsync(voxelTemplate: IVoxelTemplate, updateData?: VoxelUpdateData): Promise<this>;
|
|
24
|
+
eraseSelection(selection: IVoxelSelection, updateData?: VoxelUpdateData): this;
|
|
25
|
+
eraseSelectionAsync(selection: IVoxelSelection, updateData?: VoxelUpdateData): Promise<this>;
|
|
23
26
|
erasePath(voxelPath: VoxelPath, updateData?: VoxelUpdateData): this;
|
|
24
27
|
erasePathAsync(voxelPath: VoxelPath, updateData?: VoxelUpdateData): Promise<this>;
|
|
25
28
|
}
|
|
@@ -9,6 +9,7 @@ import PaintVoxelPath from "../../Tasks/Paint/Paint/PaintVoxelPath";
|
|
|
9
9
|
import { EraseVoxel } from "../../Tasks/Paint/Erase/EraseVoxel";
|
|
10
10
|
import EraseVoxelTemplate from "../../Tasks/Paint/Erase/EraseVoxelTemplate";
|
|
11
11
|
import EraseVoxelPath from "../../Tasks/Paint/Erase/EraseVoxelPath";
|
|
12
|
+
import EraseVoxelSelection from "../../Tasks/Paint/Erase/EraseVoxelSelection";
|
|
12
13
|
export class SimulationBrush extends BrushTool {
|
|
13
14
|
_dimension;
|
|
14
15
|
taskTool;
|
|
@@ -187,6 +188,57 @@ export class SimulationBrush extends BrushTool {
|
|
|
187
188
|
]);
|
|
188
189
|
return this;
|
|
189
190
|
}
|
|
191
|
+
eraseSelection(selection, updateData = {}) {
|
|
192
|
+
const { x: ox, y: oy, z: oz } = this;
|
|
193
|
+
const { x: sx, y: sy, z: sz } = selection.bounds.size;
|
|
194
|
+
for (let x = 0; x < sx; x++) {
|
|
195
|
+
for (let y = 0; y < sy; y++) {
|
|
196
|
+
for (let z = 0; z < sz; z++) {
|
|
197
|
+
const tx = ox + x;
|
|
198
|
+
const ty = oy + y;
|
|
199
|
+
const tz = oz + z;
|
|
200
|
+
if (selection.isSelected(tx, ty, tz))
|
|
201
|
+
continue;
|
|
202
|
+
const voxel = this.dataCursor.getVoxel(tx, ty, tz);
|
|
203
|
+
if (!voxel)
|
|
204
|
+
continue;
|
|
205
|
+
const tags = VoxelTagsRegister.VoxelTags[VoxelPalettesRegister.voxelIds.getNumberId(this.data.id)];
|
|
206
|
+
const behavior = VoxelBehaviorsRegister.get(tags["dve_simulation_behavior"] || "default");
|
|
207
|
+
behavior.onErase(this._dimension.simulation, tx, ty, tz);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
EraseVoxelSelection(this.dimension, [this.x, this.y, this.z], selection.toJSON(), updateData);
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
async eraseSelectionAsync(selection, updateData = {}) {
|
|
215
|
+
const { x: ox, y: oy, z: oz } = this;
|
|
216
|
+
const { x: sx, y: sy, z: sz } = selection.bounds.size;
|
|
217
|
+
for (let x = 0; x < sx; x++) {
|
|
218
|
+
for (let y = 0; y < sy; y++) {
|
|
219
|
+
for (let z = 0; z < sz; z++) {
|
|
220
|
+
const tx = ox + x;
|
|
221
|
+
const ty = oy + y;
|
|
222
|
+
const tz = oz + z;
|
|
223
|
+
if (selection.isSelected(tx, ty, tz))
|
|
224
|
+
continue;
|
|
225
|
+
const voxel = this.dataCursor.getVoxel(tx, ty, tz);
|
|
226
|
+
if (!voxel)
|
|
227
|
+
continue;
|
|
228
|
+
const tags = VoxelTagsRegister.VoxelTags[VoxelPalettesRegister.voxelIds.getNumberId(this.data.id)];
|
|
229
|
+
const behavior = VoxelBehaviorsRegister.get(tags["dve_simulation_behavior"] || "default");
|
|
230
|
+
behavior.onErase(this._dimension.simulation, tx, ty, tz);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
await this.taskTool.voxel.eraseTemplate.runAsync([
|
|
235
|
+
this.dimension,
|
|
236
|
+
[this.x, this.y, this.z],
|
|
237
|
+
selection.toJSON(),
|
|
238
|
+
updateData,
|
|
239
|
+
]);
|
|
240
|
+
return this;
|
|
241
|
+
}
|
|
190
242
|
erasePath(voxelPath, updateData = {}) {
|
|
191
243
|
EraseVoxelPath(this.dimension, [this.x, this.y, this.z], voxelPath.toJSON(), updateData);
|
|
192
244
|
return this;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { VoxelBehaviorsRegister } from "../VoxelBehaviorsRegister";
|
|
2
2
|
VoxelBehaviorsRegister.register({
|
|
3
3
|
type: "dve_default",
|
|
4
|
+
needUpdate(simulation, voxel, x, y, z) {
|
|
5
|
+
return false;
|
|
6
|
+
},
|
|
4
7
|
onInteract(simulation, voxel, x, y, z) { },
|
|
5
8
|
onPaint(simulation, voxel, x, y, z) { },
|
|
6
9
|
onErase(simulation, voxel, x, y, z) { },
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { CardinalNeighbors3D } from "../../../../Math/CardinalNeighbors";
|
|
1
|
+
import { CardinalNeighbors2D, CardinalNeighbors3D } from "../../../../Math/CardinalNeighbors";
|
|
2
2
|
import { VoxelBehaviorsRegister } from "../VoxelBehaviorsRegister";
|
|
3
3
|
VoxelBehaviorsRegister.register({
|
|
4
4
|
type: "dve_liquid",
|
|
5
|
+
needUpdate(simulation, voxel, x, y, z) {
|
|
6
|
+
let scheduleUpdate = false;
|
|
7
|
+
for (let i = 0; i < CardinalNeighbors2D.length; i++) {
|
|
8
|
+
const nx = CardinalNeighbors2D[i][0] + x;
|
|
9
|
+
const nz = CardinalNeighbors2D[i][1] + z;
|
|
10
|
+
const nVoxel = simulation.nDataCursor.getVoxel(nx, y, nz);
|
|
11
|
+
if (nVoxel && !nVoxel.isSameVoxel(voxel) && nVoxel.isAir()) {
|
|
12
|
+
scheduleUpdate = true;
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const downVoxel = simulation.nDataCursor.getVoxel(x, y - 1, z);
|
|
17
|
+
if (downVoxel && !downVoxel.isSameVoxel(voxel) && downVoxel.isAir()) {
|
|
18
|
+
scheduleUpdate = true;
|
|
19
|
+
}
|
|
20
|
+
if (scheduleUpdate) {
|
|
21
|
+
simulation.scheduleUpdate("dve_liquid", x, y, z, 0);
|
|
22
|
+
}
|
|
23
|
+
return scheduleUpdate;
|
|
24
|
+
},
|
|
5
25
|
onPaint(simulation, voxel, x, y, z) {
|
|
6
26
|
simulation.scheduleUpdate("dve_liquid", x, y, z, 0);
|
|
7
27
|
},
|
|
@@ -3,6 +3,7 @@ import { VoxelCursorInterface } from "../../../Voxels/Cursor/VoxelCursor.interfa
|
|
|
3
3
|
export interface VoxelBehaviorsData {
|
|
4
4
|
type: string;
|
|
5
5
|
inherits?: string;
|
|
6
|
+
needUpdate?(simulation: DimensionSimulation, voxel: VoxelCursorInterface, x: number, y: number, z: number): boolean;
|
|
6
7
|
onInteract?(simulation: DimensionSimulation, voxel: VoxelCursorInterface, x: number, y: number, z: number): void;
|
|
7
8
|
onPaint?(simulation: DimensionSimulation, voxel: VoxelCursorInterface, x: number, y: number, z: number): void;
|
|
8
9
|
onErase?(simulation: DimensionSimulation, voxel: VoxelCursorInterface, x: number, y: number, z: number): void;
|
|
@@ -11,6 +12,7 @@ export interface VoxelBehaviorsData {
|
|
|
11
12
|
export declare class VoxelBehavior {
|
|
12
13
|
data: VoxelBehaviorsData;
|
|
13
14
|
constructor(data: VoxelBehaviorsData);
|
|
15
|
+
needUpdate(simulation: DimensionSimulation, x: number, y: number, z: number): boolean | undefined;
|
|
14
16
|
onInteract(simulation: DimensionSimulation, x: number, y: number, z: number): void;
|
|
15
17
|
onPaint(simulation: DimensionSimulation, x: number, y: number, z: number): void;
|
|
16
18
|
onErase(simulation: DimensionSimulation, x: number, y: number, z: number): void;
|
|
@@ -3,6 +3,12 @@ export class VoxelBehavior {
|
|
|
3
3
|
constructor(data) {
|
|
4
4
|
this.data = data;
|
|
5
5
|
}
|
|
6
|
+
needUpdate(simulation, x, y, z) {
|
|
7
|
+
if (!this.data.needUpdate)
|
|
8
|
+
return;
|
|
9
|
+
const voxel = simulation.getVoxelForUpdate(x, y, z);
|
|
10
|
+
return this.data.needUpdate(simulation, voxel, x, y, z);
|
|
11
|
+
}
|
|
6
12
|
onInteract(simulation, x, y, z) {
|
|
7
13
|
if (!this.data.onInteract)
|
|
8
14
|
return;
|
|
@@ -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.76",
|
|
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,12 +0,0 @@
|
|
|
1
|
-
import { VoxelBuildSpace } from "../../VoxelBuildSpace";
|
|
2
|
-
import { VoxelBoxSelection } from "../../../Templates/Selection/VoxelBoxSelection";
|
|
3
|
-
import { Vector3Like } from "@amodx/math";
|
|
4
|
-
export declare class BoxSelection {
|
|
5
|
-
space: VoxelBuildSpace;
|
|
6
|
-
selection: VoxelBoxSelection;
|
|
7
|
-
planeOrigin: Vector3Like;
|
|
8
|
-
planeNormal: Vector3Like;
|
|
9
|
-
offset: number;
|
|
10
|
-
constructor(space: VoxelBuildSpace, selection: VoxelBoxSelection);
|
|
11
|
-
update(): void;
|
|
12
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { VoxelPickResult } from "../../../Voxels/Interaction/VoxelPickResult";
|
|
2
|
-
import { VoxelBuildSpace } from "../../VoxelBuildSpace";
|
|
3
|
-
import { PaintVoxelData } from "../../../Voxels";
|
|
4
|
-
import { VoxelBoxSelection } from "../../../Templates/Selection/VoxelBoxSelection";
|
|
5
|
-
import { BoxSelection } from "./BoxSelection";
|
|
6
|
-
import { BoxToolTemplate } from "./BoxToolTemplate";
|
|
7
|
-
import { BuilderToolBase } from "../BuilderToolBase";
|
|
8
|
-
export declare enum BoxToolModes {
|
|
9
|
-
Fill = "Fill",
|
|
10
|
-
Extrude = "Extrude",
|
|
11
|
-
Template = "Template",
|
|
12
|
-
Remove = "Remove"
|
|
13
|
-
}
|
|
14
|
-
interface BoxToolEvents {
|
|
15
|
-
"template-created": BoxToolTemplate;
|
|
16
|
-
}
|
|
17
|
-
export declare class BoxTool extends BuilderToolBase<BoxToolEvents> {
|
|
18
|
-
space: VoxelBuildSpace;
|
|
19
|
-
static ToolId: string;
|
|
20
|
-
static ModeArray: BoxToolModes[];
|
|
21
|
-
mode: BoxToolModes;
|
|
22
|
-
selection: VoxelBoxSelection;
|
|
23
|
-
boxSelection: BoxSelection;
|
|
24
|
-
constructor(space: VoxelBuildSpace);
|
|
25
|
-
private _started;
|
|
26
|
-
isSelectionStarted(): boolean;
|
|
27
|
-
updateOffset(offset: number): void;
|
|
28
|
-
updatePlacer(picked: VoxelPickResult | null, placerMode?: "start" | "end" | null): void;
|
|
29
|
-
use(voxelData: PaintVoxelData, usePlacingStrategy?: boolean): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
export {};
|