@divinevoxel/vlox 0.0.76 → 0.0.78
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Quad } from "../../../../../../Mesher/Geomtry/Primitives/Quad";
|
|
2
2
|
import { getQuadWeights, mapQuadUvs } from "./CalcFunctions";
|
|
3
3
|
import { TransformQuad } from "../../../../../../Mesher/Geomtry/Transform/TransformQuad";
|
|
4
|
-
import { QuadVoxelGometryInputs, } from "../../../../../../Mesher/Models/Nodes/Types/QuadVoxelGometryNodeTypes";
|
|
4
|
+
import { QuadVoxelGometryInputs, } from "../../../../../../Mesher/Voxels/Models/Nodes/Types/QuadVoxelGometryNodeTypes";
|
|
5
5
|
import { OcclusionFaceRegister } from "../../../Classes/OcclusionFaceRegister";
|
|
6
6
|
import { closestVoxelFace } from "../../../../../../Math/UtilFunctions";
|
|
7
7
|
export function CompileQuadGeometryNode(buildRules, input, points, node, transform = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { VoxelGeometryTransform } from "../../../../../../Mesher/Geomtry/Geometry.types";
|
|
3
|
-
import { CompiledTriangleVoxelGeomtryNode } from "../../../../../../Mesher/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
3
|
+
import { CompiledTriangleVoxelGeomtryNode } from "../../../../../../Mesher/Voxels/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
4
4
|
import { GeomtryInput } from "../../../Classes/GeomtryInput";
|
|
5
5
|
import { BaseVoxelTriangleData } from "../../../../VoxelModel.types";
|
|
6
6
|
export declare function CompileTriangleGeometryNode(buildRules: boolean, input: GeomtryInput, points: [Vec3Array, Vec3Array, Vec3Array], node: BaseVoxelTriangleData, transform?: VoxelGeometryTransform): CompiledTriangleVoxelGeomtryNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Triangle } from "../../../../../../Mesher/Geomtry/Primitives/Triangle";
|
|
2
2
|
import { getVertexWeights } from "./CalcFunctions";
|
|
3
3
|
import { TransformTriangle } from "../../../../../../Mesher/Geomtry/Transform/TransformTriangle";
|
|
4
|
-
import { TriangleVoxelGometryInputs, } from "../../../../../../Mesher/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
4
|
+
import { TriangleVoxelGometryInputs, } from "../../../../../../Mesher/Voxels/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
5
5
|
import { OcclusionFaceRegister } from "../../../Classes/OcclusionFaceRegister";
|
|
6
6
|
import { closestVoxelFace } from "../../../../../../Math/UtilFunctions";
|
|
7
7
|
export function CompileTriangleGeometryNode(buildRules, input, points, node, transform) {
|
|
@@ -51,6 +51,11 @@ export interface VoxelTriangleGeometryNode extends BaseVoxelTriangleData {
|
|
|
51
51
|
export interface VoxelGeometryTextureArgument {
|
|
52
52
|
type: "texture";
|
|
53
53
|
}
|
|
54
|
+
/**Creates a way to set multiple arguments to the same thing. What ever value is passed in will be passed to the arguments. */
|
|
55
|
+
export interface VoxelGeometryArgumentAliasList {
|
|
56
|
+
type: "arg-list";
|
|
57
|
+
arguments: string[];
|
|
58
|
+
}
|
|
54
59
|
export interface VoxelGeometryBooleanArgument {
|
|
55
60
|
type: "boolean";
|
|
56
61
|
default: boolean;
|
|
@@ -103,7 +108,7 @@ export interface VoxelGeometryData {
|
|
|
103
108
|
* Define the culling procedure for faces
|
|
104
109
|
*/
|
|
105
110
|
cullingProcedure?: CullingProcedureData;
|
|
106
|
-
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument>;
|
|
111
|
+
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument | VoxelGeometryArgumentAliasList>;
|
|
107
112
|
}
|
|
108
113
|
export interface VoxelGeometryLinkData {
|
|
109
114
|
geometryId: string;
|
|
@@ -23,5 +23,7 @@ export declare class PaintVoxelData {
|
|
|
23
23
|
static Clear(data: PaintVoxelData): PaintVoxelData;
|
|
24
24
|
/**Clears the target data and then copies properties from source to target. */
|
|
25
25
|
static Set(target: PaintVoxelData, source: Partial<PaintVoxelData>): PaintVoxelData;
|
|
26
|
+
/**Takes PaintVoxelData and convert mod and state strings to numbers and then */
|
|
27
|
+
static Populate(data: Partial<PaintVoxelData>): Partial<PaintVoxelData>;
|
|
26
28
|
private constructor();
|
|
27
29
|
}
|
|
@@ -140,6 +140,57 @@ export class PaintVoxelData {
|
|
|
140
140
|
target.secondaryStateString = source.secondaryStateString;
|
|
141
141
|
return target;
|
|
142
142
|
}
|
|
143
|
+
/**Takes PaintVoxelData and convert mod and state strings to numbers and then */
|
|
144
|
+
static Populate(data) {
|
|
145
|
+
let stringId = data.id
|
|
146
|
+
? data.id
|
|
147
|
+
: data.name
|
|
148
|
+
? VoxelPalettesRegister.voxelNametoIdMap.get(data.name)
|
|
149
|
+
: "dve_air";
|
|
150
|
+
let secondaryStringId = data.secondaryName
|
|
151
|
+
? data.secondaryVoxelId
|
|
152
|
+
: data.secondaryName
|
|
153
|
+
? VoxelPalettesRegister.voxelNametoIdMap.get(data.secondaryName)
|
|
154
|
+
: "dve_air";
|
|
155
|
+
if (data.name && !data.id) {
|
|
156
|
+
data.id = VoxelPalettesRegister.voxelNametoIdMap.get(data.name);
|
|
157
|
+
}
|
|
158
|
+
if (!data.name && !data.id) {
|
|
159
|
+
data.id = "dve_air";
|
|
160
|
+
}
|
|
161
|
+
delete data.name;
|
|
162
|
+
let state = data.state || 0;
|
|
163
|
+
let mod = data.mod || 0;
|
|
164
|
+
if (SchemaRegister.hasVoxelSchema(stringId)) {
|
|
165
|
+
const schema = SchemaRegister.getVoxelSchemas(stringId);
|
|
166
|
+
if (data.stateString && data.stateString !== "") {
|
|
167
|
+
state = schema.state.readString(data.stateString);
|
|
168
|
+
}
|
|
169
|
+
if (data.modString && data.modString !== "") {
|
|
170
|
+
mod = schema.mod.readString(data.modString);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
data.state = state;
|
|
174
|
+
data.mod = mod;
|
|
175
|
+
delete data.stateString;
|
|
176
|
+
delete data.modString;
|
|
177
|
+
let secondaryState = data.secondaryState || 0;
|
|
178
|
+
let secondaryMod = data.secondaryMod || 0;
|
|
179
|
+
if (secondaryStringId && SchemaRegister.hasVoxelSchema(secondaryStringId)) {
|
|
180
|
+
const schema = SchemaRegister.getVoxelSchemas(secondaryStringId);
|
|
181
|
+
if (data.secondaryStateString && data.secondaryStateString !== "") {
|
|
182
|
+
secondaryState = schema.state.readString(data.secondaryStateString);
|
|
183
|
+
}
|
|
184
|
+
if (data.secondaryModString && data.secondaryModString !== "") {
|
|
185
|
+
secondaryMod = schema.mod.readString(data.secondaryModString);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
data.secondaryState = secondaryState;
|
|
189
|
+
data.secondaryMod = secondaryMod;
|
|
190
|
+
delete data.secondaryModString;
|
|
191
|
+
delete data.secondaryStateString;
|
|
192
|
+
return data;
|
|
193
|
+
}
|
|
143
194
|
constructor(id = "dve_air", name = "", state = 0, stateString = "", mod = 0, modString = "", level = 0, levelState = 0, secondaryVoxelId = "dve_air", secondaryName = "", secondaryMod = 0, secondaryModString = "", secondaryState = 0, secondaryStateString = "") {
|
|
144
195
|
this.id = id;
|
|
145
196
|
this.name = name;
|
|
@@ -3,12 +3,16 @@ import { Vector3Like } from "@amodx/math";
|
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
4
|
import { WorldSectionCursorInterface } from "./WorldSectionCursor.interface";
|
|
5
5
|
import type { Section } from "../Section/index";
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
7
|
export declare class SectionCursor implements WorldSectionCursorInterface, DataCursorInterface {
|
|
7
8
|
_section: Section | null;
|
|
8
9
|
private voxel;
|
|
9
10
|
_voxelIndex: number;
|
|
10
11
|
_voxelPosition: Vector3Like;
|
|
11
12
|
_sectionPosition: Vector3Like;
|
|
13
|
+
volumeBounds: BoundingBox;
|
|
14
|
+
get volumePosition(): Vector3Like;
|
|
15
|
+
constructor();
|
|
12
16
|
inBounds(x: number, y: number, z: number): boolean;
|
|
13
17
|
setSection(section: Section): void;
|
|
14
18
|
loadSection(dimension: number, x: number, y: number, z: number): boolean;
|
|
@@ -2,29 +2,26 @@ import { WorldRegister } from "../WorldRegister";
|
|
|
2
2
|
import { WorldVoxelCursor } from "./WorldVoxelCursor";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
4
|
import { Vector3Like } from "@amodx/math";
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
|
+
const point = Vector3Like.Create();
|
|
5
7
|
export class SectionCursor {
|
|
6
8
|
_section;
|
|
7
9
|
voxel = new WorldVoxelCursor(this);
|
|
8
10
|
_voxelIndex = 0;
|
|
9
11
|
_voxelPosition = Vector3Like.Create();
|
|
10
12
|
_sectionPosition = Vector3Like.Create();
|
|
13
|
+
volumeBounds = new BoundingBox();
|
|
14
|
+
get volumePosition() {
|
|
15
|
+
return this._sectionPosition;
|
|
16
|
+
}
|
|
17
|
+
constructor() {
|
|
18
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(0, 0, 0), Vector3Like.Create(WorldSpaces.section.bounds.x, WorldSpaces.section.bounds.y, WorldSpaces.section.bounds.z));
|
|
19
|
+
}
|
|
11
20
|
inBounds(x, y, z) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return false;
|
|
17
|
-
if (y < this._sectionPosition.y)
|
|
18
|
-
return false;
|
|
19
|
-
if (z < this._sectionPosition.z)
|
|
20
|
-
return false;
|
|
21
|
-
if (x > maxX)
|
|
22
|
-
return false;
|
|
23
|
-
if (y > maxY)
|
|
24
|
-
return false;
|
|
25
|
-
if (z > maxZ)
|
|
26
|
-
return false;
|
|
27
|
-
return true;
|
|
21
|
+
point.x = x - this._sectionPosition.x + 0.5;
|
|
22
|
+
point.y = y - this._sectionPosition.y + 0.5;
|
|
23
|
+
point.z = z - this._sectionPosition.z + 0.5;
|
|
24
|
+
return this.volumeBounds.intersectsPoint(point);
|
|
28
25
|
}
|
|
29
26
|
setSection(section) {
|
|
30
27
|
this._section = section;
|
|
@@ -4,6 +4,7 @@ import { WorldVoxelCursor } from "./WorldVoxelCursor";
|
|
|
4
4
|
import { Vector3Like } from "@amodx/math";
|
|
5
5
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
6
6
|
import { WorldSectionCursorInterface } from "./WorldSectionCursor.interface";
|
|
7
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
8
|
export declare class SectorCursor implements DataCursorInterface, WorldSectionCursorInterface {
|
|
8
9
|
_current: Sector | null;
|
|
9
10
|
_section: Section | null;
|
|
@@ -11,6 +12,9 @@ export declare class SectorCursor implements DataCursorInterface, WorldSectionCu
|
|
|
11
12
|
_voxelIndex: number;
|
|
12
13
|
_voxelPosition: Vector3Like;
|
|
13
14
|
_sectorPosition: Vector3Like;
|
|
15
|
+
volumeBounds: BoundingBox;
|
|
16
|
+
get volumePosition(): Vector3Like;
|
|
17
|
+
constructor();
|
|
14
18
|
inBounds(x: number, y: number, z: number): boolean;
|
|
15
19
|
setSector(sector: Sector): boolean;
|
|
16
20
|
loadSector(dimension: number, x: number, y: number, z: number): boolean;
|
|
@@ -2,6 +2,8 @@ import { WorldRegister } from "../WorldRegister";
|
|
|
2
2
|
import { WorldVoxelCursor } from "./WorldVoxelCursor";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
4
|
import { Vector3Like } from "@amodx/math";
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
|
+
const point = Vector3Like.Create();
|
|
5
7
|
export class SectorCursor {
|
|
6
8
|
_current = null;
|
|
7
9
|
_section;
|
|
@@ -9,23 +11,18 @@ export class SectorCursor {
|
|
|
9
11
|
_voxelIndex = 0;
|
|
10
12
|
_voxelPosition = Vector3Like.Create();
|
|
11
13
|
_sectorPosition = Vector3Like.Create();
|
|
14
|
+
volumeBounds = new BoundingBox();
|
|
15
|
+
get volumePosition() {
|
|
16
|
+
return this._sectorPosition;
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(0, 0, 0), Vector3Like.Create(WorldSpaces.sector.bounds.x, WorldSpaces.sector.bounds.y, WorldSpaces.sector.bounds.z));
|
|
20
|
+
}
|
|
12
21
|
inBounds(x, y, z) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return false;
|
|
18
|
-
if (y < this._sectorPosition.y)
|
|
19
|
-
return false;
|
|
20
|
-
if (z < this._sectorPosition.z)
|
|
21
|
-
return false;
|
|
22
|
-
if (x > maxX)
|
|
23
|
-
return false;
|
|
24
|
-
if (y > maxY)
|
|
25
|
-
return false;
|
|
26
|
-
if (z > maxZ)
|
|
27
|
-
return false;
|
|
28
|
-
return true;
|
|
22
|
+
point.x = x - this._sectorPosition.x + 0.5;
|
|
23
|
+
point.y = y - this._sectorPosition.y + 0.5;
|
|
24
|
+
point.z = z - this._sectorPosition.z + 0.5;
|
|
25
|
+
return this.volumeBounds.intersectsPoint(point);
|
|
29
26
|
}
|
|
30
27
|
setSector(sector) {
|
|
31
28
|
this._current = sector;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { SectorCursor } from "./SectorCursor";
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
4
5
|
export declare class WorldCursor implements DataCursorInterface {
|
|
6
|
+
volumeBounds: BoundingBox;
|
|
5
7
|
sectorCursors: Record<number, Record<number, SectorCursor | null>>;
|
|
6
8
|
origin: Vector3Like;
|
|
7
9
|
dimension: number;
|
|
8
10
|
_lastPosition: Vector3Like;
|
|
11
|
+
constructor();
|
|
12
|
+
private updateBounds;
|
|
9
13
|
setFocalPoint(dimension: number, x: number, y: number, z: number): void;
|
|
10
14
|
inBounds(x: number, y: number, z: number): boolean;
|
|
11
15
|
getSector(x: number, y: number, z: number): SectorCursor | null;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { SectorCursor } from "./SectorCursor";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
4
5
|
let cursorCache = [];
|
|
5
6
|
const tempPosition = Vector3Like.Create();
|
|
6
7
|
export class WorldCursor {
|
|
8
|
+
volumeBounds = new BoundingBox();
|
|
7
9
|
sectorCursors = {};
|
|
8
10
|
origin = Vector3Like.Create();
|
|
9
11
|
dimension = 0;
|
|
10
12
|
_lastPosition = Vector3Like.Create();
|
|
13
|
+
constructor() {
|
|
14
|
+
this.updateBounds();
|
|
15
|
+
}
|
|
16
|
+
updateBounds() {
|
|
17
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(WorldSpaces.world.bounds.MinX, WorldSpaces.world.bounds.MinY, WorldSpaces.world.bounds.MinZ), Vector3Like.Create(WorldSpaces.world.bounds.MaxX, WorldSpaces.world.bounds.MaxY, WorldSpaces.world.bounds.MaxZ));
|
|
18
|
+
}
|
|
11
19
|
setFocalPoint(dimension, x, y, z) {
|
|
12
20
|
const sectorPos = WorldSpaces.sector.getPosition(x, y, z, tempPosition);
|
|
13
21
|
for (const row in this.sectorCursors) {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { LocationData } from "../../Math";
|
|
2
2
|
export declare class SectorHeightMap {
|
|
3
|
+
/**
|
|
4
|
+
* Gets the relative height of the sector. Meaning will get the tallest sector in a square around it.
|
|
5
|
+
*/
|
|
3
6
|
static getRelative(location: LocationData): number;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the exact heigh of the single sector.
|
|
9
|
+
*/
|
|
4
10
|
static getAbsolute(dimension: number, x: number, sy: number, z: number): number;
|
|
5
11
|
}
|
|
@@ -2,6 +2,9 @@ import { MooreNeighborhood2D } from "../../Math/CardinalNeighbors";
|
|
|
2
2
|
import { WorldRegister } from "../WorldRegister";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
4
|
export class SectorHeightMap {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the relative height of the sector. Meaning will get the tallest sector in a square around it.
|
|
7
|
+
*/
|
|
5
8
|
static getRelative(location) {
|
|
6
9
|
location = [...location];
|
|
7
10
|
const sectionWidth = WorldSpaces.section.bounds.x;
|
|
@@ -18,6 +21,9 @@ export class SectorHeightMap {
|
|
|
18
21
|
}
|
|
19
22
|
return maxHeight;
|
|
20
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the exact heigh of the single sector.
|
|
26
|
+
*/
|
|
21
27
|
static getAbsolute(dimension, x, sy, z) {
|
|
22
28
|
const sector = WorldRegister.sectors.get(dimension, x, sy, z);
|
|
23
29
|
if (!sector)
|
|
@@ -4,14 +4,17 @@ import { SectionSnapShot } from "./SectionSnapShot";
|
|
|
4
4
|
import { Sector } from "../Sector";
|
|
5
5
|
import { SectorCursor } from "../Cursor/SectorCursor";
|
|
6
6
|
import { SectionCursor } from "../Cursor/SectionCursor";
|
|
7
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
8
|
export declare class SectionSnapshotCursor implements DataCursorInterface {
|
|
8
9
|
origin: Vector3Like;
|
|
9
10
|
sectorOrigin: Vector3Like;
|
|
10
11
|
dimension: number;
|
|
12
|
+
volumeBounds: BoundingBox;
|
|
11
13
|
sectors: Sector[];
|
|
12
14
|
cursors: SectorCursor[];
|
|
13
15
|
index: Flat3DIndex;
|
|
14
16
|
constructor();
|
|
17
|
+
private updateBounds;
|
|
15
18
|
private _snapShot;
|
|
16
19
|
private _centeralCursor;
|
|
17
20
|
getCenteralCursor(): SectionCursor | null;
|
|
@@ -3,11 +3,13 @@ import { WorldSpaces } from "../WorldSpaces";
|
|
|
3
3
|
import { Sector } from "../Sector";
|
|
4
4
|
import { SectorCursor } from "../Cursor/SectorCursor";
|
|
5
5
|
import { SectionCursor } from "../Cursor/SectionCursor";
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
7
|
const tempPosition = Vector3Like.Create();
|
|
7
8
|
export class SectionSnapshotCursor {
|
|
8
9
|
origin = Vector3Like.Create();
|
|
9
10
|
sectorOrigin = Vector3Like.Create();
|
|
10
11
|
dimension = 0;
|
|
12
|
+
volumeBounds = new BoundingBox();
|
|
11
13
|
sectors = [];
|
|
12
14
|
cursors = [];
|
|
13
15
|
index = Flat3DIndex.GetXYZOrder();
|
|
@@ -29,6 +31,10 @@ export class SectionSnapshotCursor {
|
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
this.updateBounds();
|
|
35
|
+
}
|
|
36
|
+
updateBounds() {
|
|
37
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(WorldSpaces.world.bounds.MinX, WorldSpaces.world.bounds.MinY, WorldSpaces.world.bounds.MinZ), Vector3Like.Create(WorldSpaces.world.bounds.MaxX, WorldSpaces.world.bounds.MaxY, WorldSpaces.world.bounds.MaxZ));
|
|
32
38
|
}
|
|
33
39
|
_snapShot;
|
|
34
40
|
_centeralCursor = new SectionCursor();
|
package/World/WorldSpaces.js
CHANGED
|
@@ -137,13 +137,13 @@ class VoxelSpace {
|
|
|
137
137
|
}
|
|
138
138
|
class Hash {
|
|
139
139
|
static hashVec3(vector3) {
|
|
140
|
-
return `${vector3.x}
|
|
140
|
+
return `${vector3.x}_${vector3.y}_${vector3.z}`;
|
|
141
141
|
}
|
|
142
142
|
static hashVec3Array(vector3) {
|
|
143
|
-
return `${vector3[0]}
|
|
143
|
+
return `${vector3[0]}_${vector3[1]}_${vector3[2]}`;
|
|
144
144
|
}
|
|
145
145
|
static hashXYZ(x, y, z) {
|
|
146
|
-
return `${x}
|
|
146
|
+
return `${x}_${y}_${z}`;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
export class WorldSpaces {
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
import { VoxelFaces } from "../../Math";
|
|
1
2
|
import { WorldCursor } from "../../World/Cursor/WorldCursor";
|
|
2
3
|
import { DimensionSegment } from "./DimensionSegment";
|
|
3
4
|
import { Vector3Like } from "@amodx/math";
|
|
4
5
|
import { PriorityQueue } from "../../Util/PriorityQueue";
|
|
5
6
|
import { VoxelUpdate } from "../Voxels/Behaviors";
|
|
7
|
+
import { SimulationBrush } from "../Tools/SimulationBrush";
|
|
6
8
|
declare class UpdatedBounds {
|
|
7
9
|
displayMin: Vector3Like;
|
|
8
10
|
displayMax: Vector3Like;
|
|
9
11
|
dimension: number;
|
|
10
12
|
start(dimension?: number): void;
|
|
11
13
|
updateDisplay(x: number, y: number, z: number): void;
|
|
12
|
-
markDisplayDirty():
|
|
14
|
+
markDisplayDirty(): boolean;
|
|
13
15
|
}
|
|
14
16
|
export declare class DimensionSimulation {
|
|
15
17
|
dimension: DimensionSegment;
|
|
16
18
|
private cursor;
|
|
17
19
|
nDataCursor: WorldCursor;
|
|
18
20
|
sDataCursor: WorldCursor;
|
|
21
|
+
tickCursor: Record<VoxelFaces, WorldCursor>;
|
|
19
22
|
bounds: UpdatedBounds;
|
|
23
|
+
brush: SimulationBrush;
|
|
20
24
|
updateQueue: PriorityQueue<VoxelUpdate>;
|
|
21
25
|
constructor(dimension: DimensionSegment);
|
|
22
26
|
setOrigin(x: number, y: number, z: number): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WorldSpaces } from "../../World/WorldSpaces";
|
|
2
|
+
import { VoxelFaces } from "../../Math";
|
|
2
3
|
import { WorldCursor } from "../../World/Cursor/WorldCursor";
|
|
3
4
|
import { WorldRegister } from "../../World/WorldRegister";
|
|
4
5
|
import { Vector3Like } from "@amodx/math";
|
|
@@ -62,6 +63,7 @@ class UpdatedBounds {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
66
|
+
return true;
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
export class DimensionSimulation {
|
|
@@ -69,10 +71,20 @@ export class DimensionSimulation {
|
|
|
69
71
|
cursor = new WorldCursor();
|
|
70
72
|
nDataCursor = new WorldCursor();
|
|
71
73
|
sDataCursor = new WorldCursor();
|
|
74
|
+
tickCursor = {
|
|
75
|
+
[VoxelFaces.Up]: new WorldCursor(),
|
|
76
|
+
[VoxelFaces.Down]: new WorldCursor(),
|
|
77
|
+
[VoxelFaces.North]: new WorldCursor(),
|
|
78
|
+
[VoxelFaces.South]: new WorldCursor(),
|
|
79
|
+
[VoxelFaces.East]: new WorldCursor(),
|
|
80
|
+
[VoxelFaces.West]: new WorldCursor(),
|
|
81
|
+
};
|
|
72
82
|
bounds = new UpdatedBounds();
|
|
83
|
+
brush;
|
|
73
84
|
updateQueue = new PriorityQueue();
|
|
74
85
|
constructor(dimension) {
|
|
75
86
|
this.dimension = dimension;
|
|
87
|
+
this.brush = dimension.getBrush();
|
|
76
88
|
}
|
|
77
89
|
setOrigin(x, y, z) {
|
|
78
90
|
this.cursor.setFocalPoint(this.dimension.id, x, y, z);
|
|
@@ -4,6 +4,7 @@ import { Sector } from "../../World/Sector";
|
|
|
4
4
|
import { TickQueue } from "../Tick/TickQueue";
|
|
5
5
|
import { DimensionSegment } from "./DimensionSegment";
|
|
6
6
|
import { Thread } from "@amodx/threads";
|
|
7
|
+
import { SectionCursor } from "../../World/Cursor/SectionCursor";
|
|
7
8
|
export declare class SimulationSector {
|
|
8
9
|
dimension: DimensionSegment;
|
|
9
10
|
position: Vec3Array;
|
|
@@ -14,9 +15,11 @@ export declare class SimulationSector {
|
|
|
14
15
|
sector: Sector | null;
|
|
15
16
|
_rendered: boolean;
|
|
16
17
|
_genAllDone: boolean;
|
|
18
|
+
_firstTick: boolean;
|
|
17
19
|
/**An array of the last tick each section was built at */
|
|
18
20
|
_displayTicks: Uint32Array<ArrayBuffer>;
|
|
19
21
|
tickQueue: TickQueue;
|
|
22
|
+
sectionCursor: SectionCursor;
|
|
20
23
|
neighbors: SimulationSector[];
|
|
21
24
|
fullNeighbors: boolean;
|
|
22
25
|
readonly maxNeighbors: number;
|
|
@@ -5,9 +5,11 @@ import { WorldSpaces } from "../../World/WorldSpaces";
|
|
|
5
5
|
import { WorldRegister } from "../../World/WorldRegister";
|
|
6
6
|
import { WorldSimulationTasks } from "../Internal/WorldSimulationTasks";
|
|
7
7
|
import { TickQueue } from "../Tick/TickQueue";
|
|
8
|
+
import { VoxelBehaviorsRegister } from "../Voxels/Behaviors";
|
|
8
9
|
import { MooreNeighborhood2D } from "../../Math/CardinalNeighbors";
|
|
9
10
|
import { WorldDataSyncIds } from "../../World/Types/WorldDataSyncIds";
|
|
10
11
|
import { EngineSettings } from "../../Settings/EngineSettings";
|
|
12
|
+
import { SectionCursor } from "../../World/Cursor/SectionCursor";
|
|
11
13
|
const tempPosition = Vector3Like.Create();
|
|
12
14
|
export class SimulationSector {
|
|
13
15
|
dimension;
|
|
@@ -19,9 +21,11 @@ export class SimulationSector {
|
|
|
19
21
|
sector = null;
|
|
20
22
|
_rendered = false;
|
|
21
23
|
_genAllDone = false;
|
|
24
|
+
_firstTick = false;
|
|
22
25
|
/**An array of the last tick each section was built at */
|
|
23
26
|
_displayTicks = new Uint32Array(WorldSpaces.sector.sectionVolumne);
|
|
24
27
|
tickQueue;
|
|
28
|
+
sectionCursor = new SectionCursor();
|
|
25
29
|
neighbors = [];
|
|
26
30
|
fullNeighbors = false;
|
|
27
31
|
maxNeighbors = MooreNeighborhood2D.length - 1;
|
|
@@ -114,48 +118,74 @@ export class SimulationSector {
|
|
|
114
118
|
}
|
|
115
119
|
this._rendered = true;
|
|
116
120
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
attempts--;
|
|
144
|
-
continue;
|
|
121
|
+
if (this.ticking) {
|
|
122
|
+
this.dimension.simulation.setOrigin(...this.position);
|
|
123
|
+
this.dimension.simulation.bounds.start(this.dimension.id);
|
|
124
|
+
this.tickQueue.run();
|
|
125
|
+
const [min, max] = sector.getMinMax();
|
|
126
|
+
if (min == Math.abs(Infinity) || max == Math.abs(Infinity))
|
|
127
|
+
return true;
|
|
128
|
+
const height = max - min + 1;
|
|
129
|
+
let attempts = 100;
|
|
130
|
+
let ticks = 20;
|
|
131
|
+
while (attempts) {
|
|
132
|
+
const randomX = Math.floor(WorldSpaces.section.bounds.x * Math.random()) +
|
|
133
|
+
this.sector.position[0];
|
|
134
|
+
const randomY = Math.floor(height * Math.random()) + min + this.sector.position[1];
|
|
135
|
+
const randomZ = Math.floor(WorldSpaces.section.bounds.z * Math.random()) +
|
|
136
|
+
this.sector.position[2];
|
|
137
|
+
const voxel = this.dimension.simulation.nDataCursor.getVoxel(randomX, randomY, randomZ);
|
|
138
|
+
if (!voxel || voxel.isAir()) {
|
|
139
|
+
attempts--;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
const behavior = VoxelBehaviorsRegister.get(voxel.tags["dve_simulation_behavior"]);
|
|
143
|
+
behavior.onTick(this.dimension.simulation, randomX, randomY, randomZ);
|
|
144
|
+
ticks--;
|
|
145
|
+
if (!ticks)
|
|
146
|
+
break;
|
|
145
147
|
}
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
let allNeighborsTicking = true;
|
|
149
|
+
for (const neighbors of this.neighbors) {
|
|
150
|
+
if (!neighbors.ticking || !neighbors._genAllDone) {
|
|
151
|
+
allNeighborsTicking = false;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (!this._firstTick && this.renderering && allNeighborsTicking) {
|
|
156
|
+
for (const section of sector.sections) {
|
|
157
|
+
this.sectionCursor.setSection(section);
|
|
158
|
+
const [minY, maxY] = section.getMinMax();
|
|
159
|
+
if (minY == Infinity && maxY == -Infinity) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const { x: cx, y: cy, z: cz } = this.sectionCursor._sectionPosition;
|
|
163
|
+
const slice = WorldSpaces.section.bounds.x * WorldSpaces.section.bounds.z;
|
|
164
|
+
const startY = minY * slice;
|
|
165
|
+
const endY = (maxY + 1) * slice;
|
|
166
|
+
// console.warn([startY,endY],{...this.sectionCursor._voxelPosition})
|
|
167
|
+
for (let i = startY; i < endY; i++) {
|
|
168
|
+
if (!(i % slice)) {
|
|
169
|
+
const y = i / slice;
|
|
170
|
+
if (!section.getHasVoxel(y) && !section.getHasVoxelDirty(y)) {
|
|
171
|
+
i += slice - 1;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (!section.ids[i] || section.getBuried(i))
|
|
176
|
+
continue;
|
|
177
|
+
const voxel = this.sectionCursor.getVoxelAtIndex(i);
|
|
178
|
+
const x = cx + this.sectionCursor._voxelPosition.x;
|
|
179
|
+
const y = cy + this.sectionCursor._voxelPosition.y;
|
|
180
|
+
const z = cz + this.sectionCursor._voxelPosition.z;
|
|
181
|
+
const behavior = VoxelBehaviorsRegister.get(voxel.tags["dve_simulation_behavior"]);
|
|
182
|
+
behavior.needUpdate(this.dimension.simulation, x, y, z);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
this._firstTick = true;
|
|
186
|
+
}
|
|
187
|
+
this.dimension.simulation.bounds.markDisplayDirty();
|
|
188
|
+
}
|
|
159
189
|
return true;
|
|
160
190
|
}
|
|
161
191
|
generateUpdate() {
|
|
@@ -171,8 +171,11 @@ export class WorldSimulationTasks {
|
|
|
171
171
|
.sector?.getSection(location[1], location[2], location[3])
|
|
172
172
|
?.setInProgress(true);
|
|
173
173
|
if (EngineSettings.settings.memoryAndCPU.useSharedMemory) {
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
WorldSimulationTools.taskTool.build.section
|
|
175
|
+
.runAsync(location)
|
|
176
|
+
.then(() => {
|
|
177
|
+
task.completeTask(taskId);
|
|
178
|
+
});
|
|
176
179
|
return;
|
|
177
180
|
}
|
|
178
181
|
const [dim, x, y, z] = location;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GeneratorData } from "../Dimensions/Generator";
|
|
2
|
+
/**# InitalLoad
|
|
3
|
+
* ---
|
|
4
|
+
* Load the world without building.
|
|
5
|
+
*/
|
|
6
|
+
export declare function BuildOnly(props: {
|
|
7
|
+
dimension?: number;
|
|
8
|
+
logTasks?: true;
|
|
9
|
+
genData: Partial<GeneratorData>;
|
|
10
|
+
}): Promise<unknown>;
|