@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,33 @@
|
|
|
1
|
+
import { VoxelUpdateTask } from "../../VoxelUpdateTask";
|
|
2
|
+
import { canUpdate, updateArea } from "../Common";
|
|
3
|
+
import { VoxelTemplateRegister } from "../../../Templates/VoxelTemplateRegister";
|
|
4
|
+
const tasks = new VoxelUpdateTask();
|
|
5
|
+
export default function EraseVoxelSelection(dimension, [ox, oy, oz], selectionData, updateData) {
|
|
6
|
+
const selection = VoxelTemplateRegister.createSelection(selectionData);
|
|
7
|
+
tasks.setOriginAt([dimension, ox, oy, oz]);
|
|
8
|
+
const { x: sx, y: sy, z: sz } = selection.bounds.size;
|
|
9
|
+
for (let x = 0; x < sx; x++) {
|
|
10
|
+
for (let y = 0; y < sy; y++) {
|
|
11
|
+
for (let z = 0; z < sz; z++) {
|
|
12
|
+
const tx = ox + x;
|
|
13
|
+
const ty = oy + y;
|
|
14
|
+
const tz = oz + z;
|
|
15
|
+
if (!selection.isSelected(tx, ty, tz))
|
|
16
|
+
continue;
|
|
17
|
+
if (!canUpdate(tx, ty, tz, updateData))
|
|
18
|
+
continue;
|
|
19
|
+
if (!tasks.sDataCursor.inBounds(tx, ty, tz))
|
|
20
|
+
continue;
|
|
21
|
+
const voxel = tasks.sDataCursor.getVoxel(tx, ty, tz);
|
|
22
|
+
if (!voxel || voxel.isAir())
|
|
23
|
+
continue;
|
|
24
|
+
voxel.ids[voxel._index] = 0;
|
|
25
|
+
voxel.level[voxel._index] = 0;
|
|
26
|
+
voxel.secondary[voxel._index] = 0;
|
|
27
|
+
voxel.light[voxel._index] = 0;
|
|
28
|
+
voxel.updateVoxel(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
updateArea(tasks, ox, oy, oz, ox + sx, oy + sy, oz + sz);
|
|
33
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { VoxelUpdateTask } from "../../VoxelUpdateTask";
|
|
2
2
|
import { canUpdate, updateArea } from "../Common";
|
|
3
|
-
import { VoxelTemplateRegister } from "../../../Templates/
|
|
3
|
+
import { VoxelTemplateRegister } from "../../../Templates/VoxelTemplateRegister";
|
|
4
4
|
const tasks = new VoxelUpdateTask();
|
|
5
|
-
const raw = [0, 0, 0, 0];
|
|
6
5
|
export default function EraseVoxelTemplate(dimension, [ox, oy, oz], templateData, updateData) {
|
|
7
6
|
const voxelTemplate = VoxelTemplateRegister.create(templateData);
|
|
8
7
|
tasks.setOriginAt([dimension, ox, oy, oz]);
|
|
@@ -15,7 +15,7 @@ export function PaintVoxel(location, raw, updateData) {
|
|
|
15
15
|
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
16
16
|
voxel.setRaw(raw);
|
|
17
17
|
voxel.updateVoxel(0);
|
|
18
|
-
updateArea(tasks, x
|
|
18
|
+
updateArea(tasks, x, y, z, x, y, z);
|
|
19
19
|
if (ES.doPower) {
|
|
20
20
|
if (voxel.tags["dve_can_be_powered"] ||
|
|
21
21
|
voxel.tags["dve_is_power_source"] ||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VoxelUpdateTask } from "../../VoxelUpdateTask";
|
|
2
2
|
import { canUpdate, updateArea } from "../Common";
|
|
3
|
-
import { VoxelTemplateRegister } from "../../../Templates/
|
|
3
|
+
import { VoxelTemplateRegister } from "../../../Templates/VoxelTemplateRegister";
|
|
4
4
|
const tasks = new VoxelUpdateTask();
|
|
5
5
|
const raw = [0, 0, 0, 0];
|
|
6
6
|
export default function PaintVoxelTemplate(dimension, [ox, oy, oz], templateData, updateData) {
|
|
@@ -35,7 +35,7 @@ export function RGBRemove(tasks) {
|
|
|
35
35
|
const remove = tasks.rgb.remove;
|
|
36
36
|
const update = tasks.rgb.update;
|
|
37
37
|
const removeMap = tasks.rgb.removeMap;
|
|
38
|
-
const updateMap = tasks.
|
|
38
|
+
const updateMap = tasks.rgb.updateMap;
|
|
39
39
|
while (remove.length) {
|
|
40
40
|
const x = remove.shift();
|
|
41
41
|
const y = remove.shift();
|
package/Tasks/Tasks.types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type EraseVoxelTemplate from "./Paint/Erase/EraseVoxelTemplate.js";
|
|
|
5
5
|
import type EraseVoxelPath from "./Paint/Erase/EraseVoxelPath.js";
|
|
6
6
|
import { PaintVoxel } from "./Paint/Paint/PaintVoxel.js";
|
|
7
7
|
import PaintVoxelTemplate from "./Paint/Paint/PaintVoxelTemplate.js";
|
|
8
|
+
import EraseVoxelSelection from "./Paint/Erase/EraseVoxelSelection.js";
|
|
8
9
|
export type VoxelUpdateData = {
|
|
9
10
|
/**An array of allowed areas to update in. If not set will be ignored.*/
|
|
10
11
|
includedAreas?: [min: Vec3Array, max: Vec3Array][];
|
|
@@ -23,6 +24,7 @@ export type PaintVoxelPathTask = [
|
|
|
23
24
|
];
|
|
24
25
|
export type EraseVoxelTask = Parameters<typeof EraseVoxel>;
|
|
25
26
|
export type EraseVoxelTemplateTask = Parameters<typeof EraseVoxelTemplate>;
|
|
27
|
+
export type EraseVoxelSelectionTask = Parameters<typeof EraseVoxelSelection>;
|
|
26
28
|
export type EraseVoxelPathTask = Parameters<typeof EraseVoxelPath>;
|
|
27
29
|
export type WorldLockTasks = [
|
|
28
30
|
dimension: number,
|
package/Tasks/TasksIds.d.ts
CHANGED
package/Tasks/TasksIds.js
CHANGED
|
@@ -12,5 +12,6 @@ export var TasksIds;
|
|
|
12
12
|
TasksIds["PaintVoxelPath"] = "PaintVoxelPath";
|
|
13
13
|
TasksIds["EraseVoxel"] = "EraseVoxel";
|
|
14
14
|
TasksIds["EraseVoxelTemplate"] = "EraseVoxelTemplate";
|
|
15
|
+
TasksIds["EraseVoxelSelection"] = "EraseVoxelSelection";
|
|
15
16
|
TasksIds["EraseVoxelPath"] = "EraseVoxelPath";
|
|
16
17
|
})(TasksIds || (TasksIds = {}));
|
|
@@ -6,5 +6,7 @@ import { WorldGenRegister } from "./WorldGenRegister";
|
|
|
6
6
|
export default function (props) {
|
|
7
7
|
WorldGenRegister._worldThread = props.worldThread;
|
|
8
8
|
Threads.registerBinaryTask(TasksIds.Generate, (data) => new Promise((resolve) => WorldGeneration.generate(getLocationData(data), "generate", resolve)));
|
|
9
|
-
Threads.registerBinaryTask(TasksIds.Decorate, (data) => new Promise((resolve) =>
|
|
9
|
+
Threads.registerBinaryTask(TasksIds.Decorate, (data) => new Promise((resolve) => {
|
|
10
|
+
WorldGeneration.generate(getLocationData(data), "decorate", resolve);
|
|
11
|
+
}));
|
|
10
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flat3DIndex, Vec3Array
|
|
1
|
+
import { Flat3DIndex, Vec3Array } from "@amodx/math";
|
|
2
2
|
import { ArchivedVoxelTemplateData } from "./ArchivedVoxelTemplate.types";
|
|
3
3
|
import type { RawVoxelData } from "../../Voxels/Types/Voxel.types";
|
|
4
4
|
import { NumberPalette } from "../../Util/NumberPalette";
|
|
@@ -11,9 +11,7 @@ type TemplateCursor = {
|
|
|
11
11
|
raw: RawVoxelData;
|
|
12
12
|
};
|
|
13
13
|
export declare class ArchivedVoxelTemplate implements IVoxelTemplate {
|
|
14
|
-
private _data;
|
|
15
14
|
index: Flat3DIndex;
|
|
16
|
-
position: Vector3Like;
|
|
17
15
|
bounds: BoundingBox;
|
|
18
16
|
ids: BinaryBuffer;
|
|
19
17
|
level: BinaryBuffer;
|
|
@@ -21,8 +19,9 @@ export declare class ArchivedVoxelTemplate implements IVoxelTemplate {
|
|
|
21
19
|
voxelPalette: VoxelPaletteArchiveReader;
|
|
22
20
|
levelPalette: NumberPalette;
|
|
23
21
|
secondaryPalette: NumberPalette;
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
private data;
|
|
23
|
+
constructor(data: ArchivedVoxelTemplateData);
|
|
24
|
+
inBounds(x: number, y: number, z: number): boolean;
|
|
26
25
|
isAir(index: number): boolean;
|
|
27
26
|
isIncluded(index: number): boolean;
|
|
28
27
|
getIndex(x: number, y: number, z: number): number;
|
|
@@ -34,5 +33,6 @@ export declare class ArchivedVoxelTemplate implements IVoxelTemplate {
|
|
|
34
33
|
clone(): ArchivedVoxelTemplate;
|
|
35
34
|
getRaw(index: number, rawRef?: RawVoxelData): RawVoxelData;
|
|
36
35
|
toJSON(): ArchivedVoxelTemplateData;
|
|
36
|
+
fromJSON(data: ArchivedVoxelTemplateData): void;
|
|
37
37
|
}
|
|
38
38
|
export {};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Flat3DIndex } from "@amodx/math";
|
|
1
|
+
import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
2
2
|
import { NumberPalette } from "../../Util/NumberPalette";
|
|
3
3
|
import { VoxelPalettesRegister } from "../../Voxels/Data/VoxelPalettesRegister";
|
|
4
4
|
import { VoxelTagsRegister } from "../../Voxels/Data/VoxelTagsRegister";
|
|
5
5
|
import { BinaryBuffer, BinaryBufferFormat, } from "../../Util/BinaryBuffer/index";
|
|
6
6
|
import { VoxelPaletteArchiveReader } from "../../Voxels/Archive/VoxelPaletteArchiveReader";
|
|
7
7
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
8
|
+
const point = Vector3Like.Create();
|
|
8
9
|
export class ArchivedVoxelTemplate {
|
|
9
|
-
_data;
|
|
10
10
|
index = Flat3DIndex.GetXZYOrder();
|
|
11
|
-
position;
|
|
12
11
|
bounds;
|
|
13
12
|
ids;
|
|
14
13
|
level;
|
|
@@ -16,52 +15,15 @@ export class ArchivedVoxelTemplate {
|
|
|
16
15
|
voxelPalette;
|
|
17
16
|
levelPalette;
|
|
18
17
|
secondaryPalette;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.
|
|
22
|
-
this.position = { ..._data.position };
|
|
23
|
-
this.bounds.setMinPositionAndSize(_data.position, _data.bounds);
|
|
24
|
-
this.index.setBounds(_data.bounds.x, _data.bounds.y, _data.bounds.z);
|
|
25
|
-
this.voxelPalette = new VoxelPaletteArchiveReader(_data.palettes);
|
|
26
|
-
if (_data.palettes.level) {
|
|
27
|
-
this.levelPalette = new NumberPalette(BinaryBuffer.ToTypedArray(_data.palettes.level));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this.levelPalette = new NumberPalette([0]);
|
|
31
|
-
}
|
|
32
|
-
if (_data.palettes.secondary) {
|
|
33
|
-
this.secondaryPalette = new NumberPalette(BinaryBuffer.ToTypedArray(_data.palettes.secondary));
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.secondaryPalette = new NumberPalette([0]);
|
|
37
|
-
}
|
|
38
|
-
const volume = this.index.size;
|
|
39
|
-
this.ids = _data.buffers.ids
|
|
40
|
-
? new BinaryBuffer(_data.buffers.ids)
|
|
41
|
-
: new BinaryBuffer(BinaryBuffer.Create({
|
|
42
|
-
format: BinaryBufferFormat.Uint16,
|
|
43
|
-
byteLength: volume,
|
|
44
|
-
buffer: 0,
|
|
45
|
-
}));
|
|
46
|
-
this.level = _data.buffers.level
|
|
47
|
-
? new BinaryBuffer(_data.buffers.level)
|
|
48
|
-
: new BinaryBuffer(BinaryBuffer.Create({
|
|
49
|
-
format: BinaryBufferFormat.Uint8,
|
|
50
|
-
byteLength: volume,
|
|
51
|
-
buffer: 0,
|
|
52
|
-
}));
|
|
53
|
-
this.secondary = _data.buffers.secondary
|
|
54
|
-
? new BinaryBuffer(_data.buffers.secondary)
|
|
55
|
-
: new BinaryBuffer(BinaryBuffer.Create({
|
|
56
|
-
format: BinaryBufferFormat.Uint16,
|
|
57
|
-
byteLength: volume,
|
|
58
|
-
buffer: 0,
|
|
59
|
-
}));
|
|
18
|
+
data;
|
|
19
|
+
constructor(data) {
|
|
20
|
+
this.fromJSON(data);
|
|
60
21
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
22
|
+
inBounds(x, y, z) {
|
|
23
|
+
point.x = x + 0.5;
|
|
24
|
+
point.y = y + 0.5;
|
|
25
|
+
point.z = z + 0.5;
|
|
26
|
+
return this.bounds.intersectsPoint(point);
|
|
65
27
|
}
|
|
66
28
|
isAir(index) {
|
|
67
29
|
return this.getId(index) === 0;
|
|
@@ -123,6 +85,47 @@ export class ArchivedVoxelTemplate {
|
|
|
123
85
|
return rawRef;
|
|
124
86
|
}
|
|
125
87
|
toJSON() {
|
|
126
|
-
return this.
|
|
88
|
+
return this.data;
|
|
89
|
+
}
|
|
90
|
+
fromJSON(data) {
|
|
91
|
+
this.data = data;
|
|
92
|
+
this.bounds = new BoundingBox();
|
|
93
|
+
this.bounds.setSize(data.bounds);
|
|
94
|
+
this.index.setBounds(data.bounds.x, data.bounds.y, data.bounds.z);
|
|
95
|
+
this.voxelPalette = new VoxelPaletteArchiveReader(data.palettes);
|
|
96
|
+
if (data.palettes.level) {
|
|
97
|
+
this.levelPalette = new NumberPalette(BinaryBuffer.ToTypedArray(data.palettes.level));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
this.levelPalette = new NumberPalette([0]);
|
|
101
|
+
}
|
|
102
|
+
if (data.palettes.secondary) {
|
|
103
|
+
this.secondaryPalette = new NumberPalette(BinaryBuffer.ToTypedArray(data.palettes.secondary));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.secondaryPalette = new NumberPalette([0]);
|
|
107
|
+
}
|
|
108
|
+
const volume = this.index.size;
|
|
109
|
+
this.ids = data.buffers.ids
|
|
110
|
+
? new BinaryBuffer(data.buffers.ids)
|
|
111
|
+
: new BinaryBuffer(BinaryBuffer.Create({
|
|
112
|
+
format: BinaryBufferFormat.Uint16,
|
|
113
|
+
byteLength: volume,
|
|
114
|
+
buffer: 0,
|
|
115
|
+
}));
|
|
116
|
+
this.level = data.buffers.level
|
|
117
|
+
? new BinaryBuffer(data.buffers.level)
|
|
118
|
+
: new BinaryBuffer(BinaryBuffer.Create({
|
|
119
|
+
format: BinaryBufferFormat.Uint8,
|
|
120
|
+
byteLength: volume,
|
|
121
|
+
buffer: 0,
|
|
122
|
+
}));
|
|
123
|
+
this.secondary = data.buffers.secondary
|
|
124
|
+
? new BinaryBuffer(data.buffers.secondary)
|
|
125
|
+
: new BinaryBuffer(BinaryBuffer.Create({
|
|
126
|
+
format: BinaryBufferFormat.Uint16,
|
|
127
|
+
byteLength: volume,
|
|
128
|
+
buffer: 0,
|
|
129
|
+
}));
|
|
127
130
|
}
|
|
128
131
|
}
|
|
@@ -175,12 +175,10 @@ export default function CreateArchivedTemplate(dataCursor, bounds) {
|
|
|
175
175
|
secondary: "YXZ",
|
|
176
176
|
},
|
|
177
177
|
},
|
|
178
|
-
position: Vector3Like.Create(),
|
|
179
178
|
bounds: Vector3Like.Create(...index.getBounds()),
|
|
180
179
|
palettes,
|
|
181
180
|
buffers,
|
|
182
181
|
};
|
|
183
|
-
console.log(data);
|
|
184
182
|
const archived = new ArchivedVoxelTemplate(data);
|
|
185
183
|
return archived;
|
|
186
184
|
}
|
|
@@ -35,7 +35,6 @@ export default async function ExportArchiedTemplateJSON(templateData) {
|
|
|
35
35
|
engineVersion: templateData.engineVersion,
|
|
36
36
|
formatVersion: templateData.formatVersion,
|
|
37
37
|
dataKey: templateData.dataKey,
|
|
38
|
-
position: templateData.position,
|
|
39
38
|
bounds: templateData.bounds,
|
|
40
39
|
type: templateData.type,
|
|
41
40
|
buffers,
|
|
@@ -27,11 +27,9 @@ export default async function ImportArchivedTemplateJSON(jsonData) {
|
|
|
27
27
|
formatVersion: jsonData.formatVersion,
|
|
28
28
|
dataKey: jsonData.dataKey,
|
|
29
29
|
type: jsonData.type,
|
|
30
|
-
position: jsonData.position,
|
|
31
30
|
bounds: jsonData.bounds,
|
|
32
31
|
buffers,
|
|
33
32
|
palettes,
|
|
34
33
|
};
|
|
35
|
-
console.warn("IMPORT TEMPLATE", data, jsonData);
|
|
36
34
|
return data;
|
|
37
35
|
}
|
|
@@ -2,12 +2,17 @@ import { TemplateVoxelCursor } from "./TemplateVoxelCursor";
|
|
|
2
2
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
3
3
|
import { IVoxelTemplate } from "../../Templates/VoxelTemplates.types";
|
|
4
4
|
import { TemplateProxy } from "./TemplateProxy";
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
5
6
|
export declare class TemplateCursor implements DataCursorInterface {
|
|
6
7
|
_voxelIndex: number;
|
|
7
8
|
_proxy: TemplateProxy | null;
|
|
9
|
+
private _airCursor;
|
|
10
|
+
baseLightValue: number;
|
|
8
11
|
private voxel;
|
|
12
|
+
volumeBounds: BoundingBox;
|
|
13
|
+
constructor();
|
|
9
14
|
inBounds(x: number, y: number, z: number): boolean;
|
|
10
15
|
setTemplate(template: IVoxelTemplate): void;
|
|
11
|
-
getVoxel(x: number, y: number, z: number): TemplateVoxelCursor
|
|
16
|
+
getVoxel(x: number, y: number, z: number): TemplateVoxelCursor;
|
|
12
17
|
clone(): DataCursorInterface;
|
|
13
18
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { TemplateVoxelCursor } from "./TemplateVoxelCursor";
|
|
2
2
|
import { TemplateProxy } from "./TemplateProxy";
|
|
3
|
+
import { VoxelCursor } from "../../Voxels/Cursor/VoxelCursor";
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
5
|
+
const raw = [0, 0, 0, 0];
|
|
3
6
|
export class TemplateCursor {
|
|
4
7
|
_voxelIndex = 0;
|
|
5
8
|
_proxy = null;
|
|
9
|
+
_airCursor = new VoxelCursor();
|
|
10
|
+
baseLightValue = 0xf;
|
|
6
11
|
voxel = new TemplateVoxelCursor(this);
|
|
12
|
+
volumeBounds = new BoundingBox();
|
|
13
|
+
constructor() { }
|
|
7
14
|
inBounds(x, y, z) {
|
|
8
15
|
if (!this._proxy)
|
|
9
16
|
return false;
|
|
@@ -11,10 +18,14 @@ export class TemplateCursor {
|
|
|
11
18
|
}
|
|
12
19
|
setTemplate(template) {
|
|
13
20
|
this._proxy = new TemplateProxy(template);
|
|
21
|
+
this.volumeBounds.setMinMax(template.bounds.min, template.bounds.max);
|
|
14
22
|
}
|
|
15
23
|
getVoxel(x, y, z) {
|
|
16
|
-
if (!this._proxy)
|
|
17
|
-
|
|
24
|
+
if (!this._proxy || !this._proxy.inBounds(x, y, z)) {
|
|
25
|
+
raw[1] = this.baseLightValue;
|
|
26
|
+
this._airCursor.setRaw(raw);
|
|
27
|
+
return this._airCursor;
|
|
28
|
+
}
|
|
18
29
|
this._voxelIndex = this._proxy.template.index.getIndexXYZ(x, y, z);
|
|
19
30
|
this.voxel.loadIn();
|
|
20
31
|
return this.voxel;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
const point = Vector3Like.Create();
|
|
3
1
|
export class TemplateProxy {
|
|
4
2
|
template;
|
|
5
3
|
ids;
|
|
@@ -22,10 +20,7 @@ export class TemplateProxy {
|
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
22
|
inBounds(x, y, z) {
|
|
25
|
-
|
|
26
|
-
point.y = y;
|
|
27
|
-
point.z = z;
|
|
28
|
-
const inBounds = this.template.bounds.intersectsPoint(point);
|
|
23
|
+
const inBounds = this.template.inBounds(x, y, z);
|
|
29
24
|
if (!inBounds)
|
|
30
25
|
return false;
|
|
31
26
|
const index = this.template.getIndex(x, y, z);
|
|
@@ -25,5 +25,11 @@ export class TemplateVoxelCursor extends VoxelCursorInterface {
|
|
|
25
25
|
this._index = this.dataCursor._voxelIndex;
|
|
26
26
|
this.process();
|
|
27
27
|
}
|
|
28
|
+
getLight() {
|
|
29
|
+
const light = super.getLight();
|
|
30
|
+
if (light <= 0)
|
|
31
|
+
return this.dataCursor.baseLightValue;
|
|
32
|
+
return light;
|
|
33
|
+
}
|
|
28
34
|
updateVoxel(mode) { }
|
|
29
35
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Flat3DIndex, Vec3Array
|
|
1
|
+
import { Flat3DIndex, Vec3Array } from "@amodx/math";
|
|
2
2
|
import { IVoxelTemplate } from "../VoxelTemplates.types";
|
|
3
3
|
import { FullVoxelTemplateData } from "./FullVoxelTemplate.types";
|
|
4
4
|
import { RawVoxelData } from "../../Voxels/Types/Voxel.types";
|
|
5
5
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
|
-
export declare class FullVoxelTemplate implements IVoxelTemplate {
|
|
6
|
+
export declare class FullVoxelTemplate implements IVoxelTemplate<"full"> {
|
|
7
7
|
static CreateNew(bounds: Vec3Array, baseLightValue?: number): FullVoxelTemplateData;
|
|
8
8
|
index: Flat3DIndex;
|
|
9
|
-
position: Vector3Like;
|
|
10
9
|
bounds: BoundingBox;
|
|
11
10
|
ids: Uint16Array;
|
|
12
11
|
level: Uint8Array;
|
|
@@ -14,7 +13,7 @@ export declare class FullVoxelTemplate implements IVoxelTemplate {
|
|
|
14
13
|
secondary: Uint16Array;
|
|
15
14
|
mask?: Uint8Array;
|
|
16
15
|
constructor(data: FullVoxelTemplateData);
|
|
17
|
-
|
|
16
|
+
inBounds(x: number, y: number, z: number): boolean;
|
|
18
17
|
isAir(index: number): boolean;
|
|
19
18
|
isIncluded(index: number): boolean;
|
|
20
19
|
getIndex(x: number, y: number, z: number): number;
|
|
@@ -25,4 +24,5 @@ export declare class FullVoxelTemplate implements IVoxelTemplate {
|
|
|
25
24
|
getRaw(index: number, rawRef?: RawVoxelData): RawVoxelData;
|
|
26
25
|
clone(): FullVoxelTemplate;
|
|
27
26
|
toJSON(): FullVoxelTemplateData;
|
|
27
|
+
fromJSON(data: FullVoxelTemplateData): void;
|
|
28
28
|
}
|
|
@@ -2,6 +2,7 @@ import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
|
2
2
|
import { getBitArrayIndex } from "../../Util/Binary/BinaryArrays";
|
|
3
3
|
import { EngineSettings } from "../../Settings/EngineSettings";
|
|
4
4
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
5
|
+
const point = Vector3Like.Create();
|
|
5
6
|
export class FullVoxelTemplate {
|
|
6
7
|
static CreateNew(bounds, baseLightValue = 0) {
|
|
7
8
|
const voxelSize = bounds[0] * bounds[1] * bounds[2];
|
|
@@ -29,7 +30,6 @@ export class FullVoxelTemplate {
|
|
|
29
30
|
bufferStart += voxelSize;
|
|
30
31
|
return {
|
|
31
32
|
type: "full",
|
|
32
|
-
position: Vector3Like.Create(),
|
|
33
33
|
bounds: Vector3Like.Create(...bounds),
|
|
34
34
|
ids,
|
|
35
35
|
light,
|
|
@@ -38,7 +38,6 @@ export class FullVoxelTemplate {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
index = Flat3DIndex.GetXZYOrder();
|
|
41
|
-
position = Vector3Like.Create();
|
|
42
41
|
bounds;
|
|
43
42
|
ids;
|
|
44
43
|
level;
|
|
@@ -46,26 +45,20 @@ export class FullVoxelTemplate {
|
|
|
46
45
|
secondary;
|
|
47
46
|
mask;
|
|
48
47
|
constructor(data) {
|
|
49
|
-
this.
|
|
50
|
-
this.bounds = new BoundingBox();
|
|
51
|
-
this.bounds.setMinPositionAndSize(data.position, data.bounds);
|
|
52
|
-
this.index.setBounds(data.bounds.x, data.bounds.y, data.bounds.z);
|
|
53
|
-
this.ids = data.ids;
|
|
54
|
-
this.level = data.level;
|
|
55
|
-
this.light = data.light;
|
|
56
|
-
this.secondary = data.secondary;
|
|
57
|
-
if (data.mask)
|
|
58
|
-
this.mask = data.mask;
|
|
48
|
+
this.fromJSON(data);
|
|
59
49
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
inBounds(x, y, z) {
|
|
51
|
+
point.x = x + 0.5;
|
|
52
|
+
point.y = y + 0.5;
|
|
53
|
+
point.z = z + 0.5;
|
|
54
|
+
return this.bounds.intersectsPoint(point);
|
|
64
55
|
}
|
|
65
56
|
isAir(index) {
|
|
66
57
|
return this.ids[index] === 0;
|
|
67
58
|
}
|
|
68
59
|
isIncluded(index) {
|
|
60
|
+
if (index < 0 || index >= this.index.size)
|
|
61
|
+
return false;
|
|
69
62
|
if (this.mask) {
|
|
70
63
|
return getBitArrayIndex(this.mask, index) === 1;
|
|
71
64
|
}
|
|
@@ -94,13 +87,20 @@ export class FullVoxelTemplate {
|
|
|
94
87
|
return rawRef;
|
|
95
88
|
}
|
|
96
89
|
clone() {
|
|
97
|
-
const newTemplate = new FullVoxelTemplate(
|
|
90
|
+
const newTemplate = new FullVoxelTemplate({
|
|
91
|
+
type: "full",
|
|
92
|
+
bounds: { ...this.bounds.size },
|
|
93
|
+
ids: this.ids.slice(),
|
|
94
|
+
light: this.light.slice(),
|
|
95
|
+
level: this.level.slice(),
|
|
96
|
+
secondary: this.secondary.slice(),
|
|
97
|
+
...(this.mask ? { mask: this.mask.slice() } : {}),
|
|
98
|
+
});
|
|
98
99
|
return newTemplate;
|
|
99
100
|
}
|
|
100
101
|
toJSON() {
|
|
101
102
|
return {
|
|
102
103
|
type: "full",
|
|
103
|
-
position: this.position,
|
|
104
104
|
bounds: this.bounds.size,
|
|
105
105
|
ids: this.ids,
|
|
106
106
|
light: this.light,
|
|
@@ -109,4 +109,15 @@ export class FullVoxelTemplate {
|
|
|
109
109
|
...(this.mask ? { mask: this.mask } : {}),
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
+
fromJSON(data) {
|
|
113
|
+
this.bounds = new BoundingBox();
|
|
114
|
+
this.bounds.setSize(data.bounds);
|
|
115
|
+
this.index.setBounds(data.bounds.x, data.bounds.y, data.bounds.z);
|
|
116
|
+
this.ids = data.ids;
|
|
117
|
+
this.level = data.level;
|
|
118
|
+
this.light = data.light;
|
|
119
|
+
this.secondary = data.secondary;
|
|
120
|
+
if (data.mask)
|
|
121
|
+
this.mask = data.mask;
|
|
122
|
+
}
|
|
112
123
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IVoxelSelection } from "../Selection/VoxelSelection";
|
|
2
|
+
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
3
|
+
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
4
|
+
import { Vector3Like } from "@amodx/math";
|
|
5
|
+
export declare function ExtrudeSelection(cursor: DataCursorInterface, selection: IVoxelSelection, normal: Vector3Like): FullVoxelTemplate;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
2
|
+
export function ExtrudeSelection(cursor, selection, normal) {
|
|
3
|
+
const size = selection.bounds.size;
|
|
4
|
+
const template = new FullVoxelTemplate(FullVoxelTemplate.CreateNew([size.x, size.y, size.z]));
|
|
5
|
+
for (let x = selection.origin.x; x < selection.origin.x + size.x; x++) {
|
|
6
|
+
for (let y = selection.origin.y; y < selection.origin.y + size.y; y++) {
|
|
7
|
+
for (let z = selection.origin.z; z < selection.origin.z + size.z; z++) {
|
|
8
|
+
if (selection.isSelected(x, y, z)) {
|
|
9
|
+
let nx = x;
|
|
10
|
+
let ny = y;
|
|
11
|
+
let nz = z;
|
|
12
|
+
const index = template.getIndex(x - selection.origin.x, y - selection.origin.y, z - selection.origin.z);
|
|
13
|
+
while (true) {
|
|
14
|
+
nx -= normal.x;
|
|
15
|
+
ny -= normal.y;
|
|
16
|
+
nz -= normal.z;
|
|
17
|
+
if (!selection.isSelected(nx, ny, nz)) {
|
|
18
|
+
const voxel = cursor.getVoxel(nx, ny, nz);
|
|
19
|
+
if (!voxel || voxel.isAir())
|
|
20
|
+
break;
|
|
21
|
+
template.ids[index] = voxel.ids[voxel._index];
|
|
22
|
+
template.level[index] = voxel.level[voxel._index];
|
|
23
|
+
template.secondary[index] = voxel.secondary[voxel._index];
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
if (x < selection.origin.x || x >= selection.origin.x + size.x)
|
|
27
|
+
continue;
|
|
28
|
+
if (y < selection.origin.y || y >= selection.origin.y + size.y)
|
|
29
|
+
continue;
|
|
30
|
+
if (z < selection.origin.z || z >= selection.origin.z + size.z)
|
|
31
|
+
continue;
|
|
32
|
+
const nIndex = template.getIndex(nx - selection.origin.x, ny - selection.origin.y, nz - selection.origin.z);
|
|
33
|
+
if (!template.isAir(nIndex)) {
|
|
34
|
+
template.ids[index] = template.ids[nIndex];
|
|
35
|
+
template.level[index] = template.level[nIndex];
|
|
36
|
+
template.secondary[index] = template.secondary[nIndex];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return template;
|
|
44
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IVoxelSelection } from "../Selection/VoxelSelection";
|
|
2
|
+
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
3
|
+
import { PaintVoxelData } from "../../Voxels/Types/PaintVoxelData";
|
|
4
|
+
export declare function FillSelection(voxel: PaintVoxelData, selection: IVoxelSelection): FullVoxelTemplate;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
2
|
+
import { PaintVoxelData } from "../../Voxels/Types/PaintVoxelData";
|
|
3
|
+
export function FillSelection(voxel, selection) {
|
|
4
|
+
const size = selection.bounds.size;
|
|
5
|
+
const template = new FullVoxelTemplate(FullVoxelTemplate.CreateNew([size.x, size.y, size.z]));
|
|
6
|
+
const raw = PaintVoxelData.ToRaw(voxel);
|
|
7
|
+
for (let x = selection.origin.x; x < selection.origin.x + size.x; x++) {
|
|
8
|
+
for (let y = selection.origin.y; y < selection.origin.y + size.y; y++) {
|
|
9
|
+
for (let z = selection.origin.z; z < selection.origin.z + size.z; z++) {
|
|
10
|
+
if (selection.isSelected(x, y, z)) {
|
|
11
|
+
const index = template.getIndex(x - selection.origin.x, y - selection.origin.y, z - selection.origin.z);
|
|
12
|
+
template.ids[index] = raw[0];
|
|
13
|
+
template.level[index] = raw[2];
|
|
14
|
+
template.secondary[index] = raw[3];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return template;
|
|
20
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import { Vector3Axes } from "@amodx/math";
|
|
1
2
|
import { FullVoxelTemplate } from "../../Templates/Full/FullVoxelTemplate";
|
|
2
|
-
export
|
|
3
|
-
export default function FlipTemplate(template: FullVoxelTemplate, direction: TemplateFlipDirections): void;
|
|
3
|
+
export default function FlipTemplate(template: FullVoxelTemplate, axes: Vector3Axes): void;
|