@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
|
@@ -6,18 +6,12 @@ import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
|
6
6
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
7
|
export class VoxelSurfaceSelection {
|
|
8
8
|
origin = Vector3Like.Create();
|
|
9
|
-
size = Vector3Like.Create();
|
|
10
9
|
normal = Vector3Like.Create();
|
|
11
10
|
bitIndex;
|
|
12
11
|
index = Flat3DIndex.GetXZYOrder();
|
|
13
12
|
bounds = new BoundingBox();
|
|
14
|
-
extrusion = 0;
|
|
15
13
|
isSelected(x, y, z) {
|
|
16
|
-
if (
|
|
17
|
-
return false;
|
|
18
|
-
if (y < this.origin.y || y >= this.origin.y + this.size.y)
|
|
19
|
-
return false;
|
|
20
|
-
if (z < this.origin.z || z >= this.origin.z + this.size.z)
|
|
14
|
+
if (!this.bounds.intersectsXYZ(x + 0.5, y + 0.5, z + 0.5))
|
|
21
15
|
return false;
|
|
22
16
|
return (getBitArrayIndex(this.bitIndex, this.index.getIndexXYZ(x - this.origin.x, y - this.origin.y, z - this.origin.z)) === 1);
|
|
23
17
|
}
|
|
@@ -34,23 +28,24 @@ export class VoxelSurfaceSelection {
|
|
|
34
28
|
axis = "z";
|
|
35
29
|
const min = Vector3Like.Create(Infinity, Infinity, Infinity);
|
|
36
30
|
const max = Vector3Like.Create(-Infinity, -Infinity, -Infinity);
|
|
31
|
+
// 1) BFS to collect the *surface-adjacent* air layer (offset 1 in +normal)
|
|
37
32
|
const queue = [
|
|
38
33
|
position.x + normal.x,
|
|
39
34
|
position.y + normal.y,
|
|
40
35
|
position.z + normal.z,
|
|
41
36
|
];
|
|
42
37
|
let size = 0;
|
|
43
|
-
const
|
|
38
|
+
const visited = new Set();
|
|
44
39
|
while (queue.length) {
|
|
45
40
|
if (size > maxSize)
|
|
46
41
|
break;
|
|
47
42
|
const x = queue.shift();
|
|
48
43
|
const y = queue.shift();
|
|
49
44
|
const z = queue.shift();
|
|
50
|
-
const key = `${x}
|
|
51
|
-
if (
|
|
45
|
+
const key = `${x} ${y} ${z}`;
|
|
46
|
+
if (visited.has(key))
|
|
52
47
|
continue;
|
|
53
|
-
|
|
48
|
+
visited.add(key);
|
|
54
49
|
if (x < min.x)
|
|
55
50
|
min.x = x;
|
|
56
51
|
if (y < min.y)
|
|
@@ -63,11 +58,10 @@ export class VoxelSurfaceSelection {
|
|
|
63
58
|
max.y = y;
|
|
64
59
|
if (z > max.z)
|
|
65
60
|
max.z = z;
|
|
61
|
+
// Expand only in the 2D tangent plane to the face normal.
|
|
66
62
|
for (let i = 0; i < CardinalNeighbors2D.length; i++) {
|
|
67
63
|
const n = CardinalNeighbors2D[i];
|
|
68
|
-
let nx = x;
|
|
69
|
-
let ny = y;
|
|
70
|
-
let nz = z;
|
|
64
|
+
let nx = x, ny = y, nz = z;
|
|
71
65
|
if (axis == "x") {
|
|
72
66
|
ny += n[0];
|
|
73
67
|
nz += n[1];
|
|
@@ -83,6 +77,7 @@ export class VoxelSurfaceSelection {
|
|
|
83
77
|
const voxel = cursor.getVoxel(nx, ny, nz);
|
|
84
78
|
if (!voxel || !voxel.isAir())
|
|
85
79
|
continue;
|
|
80
|
+
// Must be "resting" on a solid (the face we clicked)
|
|
86
81
|
const bottomVoxel = cursor.getVoxel(nx - normal.x, ny - normal.y, nz - normal.z);
|
|
87
82
|
if (!bottomVoxel || bottomVoxel.isAir())
|
|
88
83
|
continue;
|
|
@@ -94,6 +89,48 @@ export class VoxelSurfaceSelection {
|
|
|
94
89
|
return false;
|
|
95
90
|
if (max.x == -Infinity || max.y == -Infinity || max.z == -Infinity)
|
|
96
91
|
return false;
|
|
92
|
+
// 2) Extrude outward along +normal for 'extrusion' layers.
|
|
93
|
+
// We grow layer-by-layer; each new layer must be air and contiguous to the previous layer stack.
|
|
94
|
+
if (extrusion > 0) {
|
|
95
|
+
// Collect the initial (surface-adjacent) layer as our starting front.
|
|
96
|
+
let front = [];
|
|
97
|
+
for (const key of visited) {
|
|
98
|
+
const [sx, sy, sz] = key.split(" ").map(Number);
|
|
99
|
+
front.push({ x: sx, y: sy, z: sz });
|
|
100
|
+
}
|
|
101
|
+
for (let d = 1; d <= extrusion; d++) {
|
|
102
|
+
const nextFront = [];
|
|
103
|
+
for (const p of front) {
|
|
104
|
+
const tx = p.x + normal.x;
|
|
105
|
+
const ty = p.y + normal.y;
|
|
106
|
+
const tz = p.z + normal.z;
|
|
107
|
+
const tKey = `${tx} ${ty} ${tz}`;
|
|
108
|
+
if (visited.has(tKey))
|
|
109
|
+
continue; // already added by another path
|
|
110
|
+
const world = cursor.getVoxel(tx, ty, tz);
|
|
111
|
+
if (!world || !world.isAir())
|
|
112
|
+
continue; // stop extrusion if we hit solid
|
|
113
|
+
visited.add(tKey);
|
|
114
|
+
nextFront.push({ x: tx, y: ty, z: tz });
|
|
115
|
+
if (tx < min.x)
|
|
116
|
+
min.x = tx;
|
|
117
|
+
if (ty < min.y)
|
|
118
|
+
min.y = ty;
|
|
119
|
+
if (tz < min.z)
|
|
120
|
+
min.z = tz;
|
|
121
|
+
if (tx > max.x)
|
|
122
|
+
max.x = tx;
|
|
123
|
+
if (ty > max.y)
|
|
124
|
+
max.y = ty;
|
|
125
|
+
if (tz > max.z)
|
|
126
|
+
max.z = tz;
|
|
127
|
+
}
|
|
128
|
+
if (nextFront.length === 0)
|
|
129
|
+
break; // nothing more to grow
|
|
130
|
+
front = nextFront;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// 3) Build compact bit mask over the final bounds.
|
|
97
134
|
const sizeX = max.x - min.x + 1;
|
|
98
135
|
const sizeY = max.y - min.y + 1;
|
|
99
136
|
const sizeZ = max.z - min.z + 1;
|
|
@@ -102,96 +139,44 @@ export class VoxelSurfaceSelection {
|
|
|
102
139
|
for (let x = min.x; x < min.x + sizeX; x++) {
|
|
103
140
|
for (let y = min.y; y < min.y + sizeY; y++) {
|
|
104
141
|
for (let z = min.z; z < min.z + sizeZ; z++) {
|
|
105
|
-
const key = `${x}
|
|
106
|
-
if (!
|
|
142
|
+
const key = `${x} ${y} ${z}`;
|
|
143
|
+
if (!visited.has(key))
|
|
107
144
|
continue;
|
|
108
145
|
setBitArrayIndex(this.bitIndex, this.index.getIndexXYZ(x - min.x, y - min.y, z - min.z), 1);
|
|
109
146
|
}
|
|
110
147
|
}
|
|
111
148
|
}
|
|
112
|
-
this.size.x = sizeX;
|
|
113
|
-
this.size.y = sizeY;
|
|
114
|
-
this.size.z = sizeZ;
|
|
115
149
|
this.origin.x = min.x;
|
|
116
150
|
this.origin.y = min.y;
|
|
117
151
|
this.origin.z = min.z;
|
|
118
152
|
this.bounds.setMinMax(this.origin, {
|
|
119
|
-
x: this.origin.x +
|
|
120
|
-
y: this.origin.y +
|
|
121
|
-
z: this.origin.z +
|
|
153
|
+
x: this.origin.x + sizeX,
|
|
154
|
+
y: this.origin.y + sizeY,
|
|
155
|
+
z: this.origin.z + sizeZ,
|
|
122
156
|
});
|
|
157
|
+
return true;
|
|
123
158
|
}
|
|
124
159
|
clone() {
|
|
125
160
|
const newSelection = new VoxelSurfaceSelection();
|
|
126
161
|
Vector3Like.Copy(newSelection.origin, this.origin);
|
|
127
|
-
Vector3Like.Copy(newSelection.size, this.size);
|
|
128
162
|
newSelection.bounds.setMinMax(this.bounds.min, this.bounds.max);
|
|
129
|
-
newSelection.
|
|
130
|
-
newSelection.bitIndex = structuredClone(this.bitIndex);
|
|
163
|
+
newSelection.bitIndex = this.bitIndex.slice();
|
|
131
164
|
newSelection.index.setBounds(...this.index.getBounds());
|
|
132
165
|
newSelection.bounds.setMinMax(this.bounds.min, this.bounds.max);
|
|
133
166
|
return newSelection;
|
|
134
167
|
}
|
|
135
|
-
toTemplate(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
voxel = voxelOrExtrude;
|
|
143
|
-
}
|
|
144
|
-
const template = new FullVoxelTemplate(FullVoxelTemplate.CreateNew([this.size.x, this.size.y, this.size.z]));
|
|
145
|
-
if (!extrude && voxel) {
|
|
146
|
-
const raw = PaintVoxelData.ToRaw(voxel);
|
|
147
|
-
for (let x = this.origin.x; x < this.origin.x + this.size.x; x++) {
|
|
148
|
-
for (let y = this.origin.y; y < this.origin.y + this.size.y; y++) {
|
|
149
|
-
for (let z = this.origin.z; z < this.origin.z + this.size.z; z++) {
|
|
150
|
-
if (this.isSelected(x, y, z)) {
|
|
151
|
-
const index = template.getIndex(x - this.origin.x, y - this.origin.y, z - this.origin.z);
|
|
152
|
-
template.ids[index] = raw[0];
|
|
153
|
-
template.level[index] = raw[2];
|
|
154
|
-
template.secondary[index] = raw[3];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return template;
|
|
160
|
-
}
|
|
161
|
-
for (let x = this.origin.x; x < this.origin.x + this.size.x; x++) {
|
|
162
|
-
for (let y = this.origin.y; y < this.origin.y + this.size.y; y++) {
|
|
163
|
-
for (let z = this.origin.z; z < this.origin.z + this.size.z; z++) {
|
|
168
|
+
toTemplate(voxel) {
|
|
169
|
+
const size = this.bounds.size;
|
|
170
|
+
const template = new FullVoxelTemplate(FullVoxelTemplate.CreateNew([size.x, size.y, size.z]));
|
|
171
|
+
const raw = PaintVoxelData.ToRaw(voxel);
|
|
172
|
+
for (let x = this.origin.x; x < this.origin.x + size.x; x++) {
|
|
173
|
+
for (let y = this.origin.y; y < this.origin.y + size.y; y++) {
|
|
174
|
+
for (let z = this.origin.z; z < this.origin.z + size.z; z++) {
|
|
164
175
|
if (this.isSelected(x, y, z)) {
|
|
165
|
-
let nx = x;
|
|
166
|
-
let ny = y;
|
|
167
|
-
let nz = z;
|
|
168
176
|
const index = template.getIndex(x - this.origin.x, y - this.origin.y, z - this.origin.z);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
nz -= this.normal.z;
|
|
173
|
-
if (!this.isSelected(nx, ny, nz)) {
|
|
174
|
-
const voxel = cursor.getVoxel(nx, ny, nz);
|
|
175
|
-
if (!voxel || voxel.isAir())
|
|
176
|
-
break;
|
|
177
|
-
template.ids[index] = voxel.ids[voxel._index];
|
|
178
|
-
template.level[index] = voxel.level[voxel._index];
|
|
179
|
-
template.secondary[index] = voxel.secondary[voxel._index];
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
if (x < this.origin.x || x >= this.origin.x + this.size.x)
|
|
183
|
-
continue;
|
|
184
|
-
if (y < this.origin.y || y >= this.origin.y + this.size.y)
|
|
185
|
-
continue;
|
|
186
|
-
if (z < this.origin.z || z >= this.origin.z + this.size.z)
|
|
187
|
-
continue;
|
|
188
|
-
const nIndex = template.getIndex(nx - this.origin.x, ny - this.origin.y, nz - this.origin.z);
|
|
189
|
-
if (!template.isAir(nIndex)) {
|
|
190
|
-
template.ids[index] = template.ids[nIndex];
|
|
191
|
-
template.level[index] = template.level[nIndex];
|
|
192
|
-
template.secondary[index] = template.secondary[nIndex];
|
|
193
|
-
}
|
|
194
|
-
}
|
|
177
|
+
template.ids[index] = raw[0];
|
|
178
|
+
template.level[index] = raw[2];
|
|
179
|
+
template.secondary[index] = raw[3];
|
|
195
180
|
}
|
|
196
181
|
}
|
|
197
182
|
}
|
|
@@ -200,11 +185,11 @@ export class VoxelSurfaceSelection {
|
|
|
200
185
|
}
|
|
201
186
|
toJSON() {
|
|
202
187
|
return {
|
|
188
|
+
type: "surface",
|
|
203
189
|
origin: { ...this.origin },
|
|
204
190
|
normal: { ...this.normal },
|
|
205
|
-
extrusion: this.extrusion,
|
|
206
191
|
bitIndex: this.bitIndex.slice(),
|
|
207
|
-
|
|
192
|
+
bounds: { ...this.bounds.size },
|
|
208
193
|
};
|
|
209
194
|
}
|
|
210
195
|
fromJSON(data) {
|
|
@@ -214,11 +199,12 @@ export class VoxelSurfaceSelection {
|
|
|
214
199
|
this.normal.x = data.normal.x;
|
|
215
200
|
this.normal.y = data.normal.y;
|
|
216
201
|
this.normal.z = data.normal.z;
|
|
217
|
-
this.extrusion = data.extrusion;
|
|
218
202
|
this.bitIndex = data.bitIndex;
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
203
|
+
this.bounds.setMinMax(this.origin, {
|
|
204
|
+
x: this.origin.x + data.bounds.x,
|
|
205
|
+
y: this.origin.y + data.bounds.y,
|
|
206
|
+
z: this.origin.z + data.bounds.z,
|
|
207
|
+
});
|
|
208
|
+
this.index.setBounds(data.bounds.x, data.bounds.y, data.bounds.z);
|
|
223
209
|
}
|
|
224
210
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { IVoxelSelection } from "./
|
|
3
|
-
import { IVoxelTemplate } from "../VoxelTemplates.types";
|
|
2
|
+
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
|
+
import { IVoxelTemplate, IVoxelTemplateData } from "../VoxelTemplates.types";
|
|
4
4
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
5
|
-
|
|
5
|
+
import type { VoxelTemplateRegister } from "../VoxelTemplateRegister";
|
|
6
|
+
export interface VoxelTemplateSelectionData extends IVoxelSelectionData<"template"> {
|
|
7
|
+
template: IVoxelTemplateData<any>;
|
|
8
|
+
}
|
|
9
|
+
export declare class VoxelTemplateSelection implements IVoxelSelection<"template"> {
|
|
10
|
+
static Register: typeof VoxelTemplateRegister;
|
|
6
11
|
origin: Vector3Like;
|
|
7
|
-
size: Vector3Like;
|
|
8
12
|
bounds: BoundingBox;
|
|
9
13
|
template: IVoxelTemplate;
|
|
10
14
|
isSelected(x: number, y: number, z: number): boolean;
|
|
11
15
|
clone(): VoxelTemplateSelection;
|
|
12
16
|
setTemplate(template: IVoxelTemplate): void;
|
|
17
|
+
toJSON(): VoxelTemplateSelectionData;
|
|
18
|
+
fromJSON(data: VoxelTemplateSelectionData): void;
|
|
13
19
|
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
3
|
export class VoxelTemplateSelection {
|
|
4
|
+
static Register;
|
|
4
5
|
origin = Vector3Like.Create();
|
|
5
|
-
size = Vector3Like.Create();
|
|
6
6
|
bounds = new BoundingBox();
|
|
7
7
|
template;
|
|
8
8
|
isSelected(x, y, z) {
|
|
9
|
-
if (
|
|
10
|
-
return false;
|
|
11
|
-
if (y < this.origin.y || y >= this.origin.y + this.size.y)
|
|
12
|
-
return false;
|
|
13
|
-
if (z < this.origin.z || z >= this.origin.z + this.size.z)
|
|
9
|
+
if (!this.bounds.intersectsXYZ(x + 0.5, y + 0.5, z + 0.5))
|
|
14
10
|
return false;
|
|
15
11
|
const rx = x - this.origin.x;
|
|
16
12
|
const ry = y - this.origin.y;
|
|
@@ -22,15 +18,27 @@ export class VoxelTemplateSelection {
|
|
|
22
18
|
clone() {
|
|
23
19
|
const newSelection = new VoxelTemplateSelection();
|
|
24
20
|
Vector3Like.Copy(newSelection.origin, this.origin);
|
|
25
|
-
Vector3Like.Copy(newSelection.size, this.size);
|
|
26
21
|
newSelection.bounds.setMinMax(this.bounds.min, this.bounds.max);
|
|
27
22
|
newSelection.template = this.template.clone();
|
|
28
23
|
return newSelection;
|
|
29
24
|
}
|
|
30
25
|
setTemplate(template) {
|
|
31
26
|
this.template = template;
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
this.bounds.setMinMax(this.origin, Vector3Like.Add(this.origin, template.bounds.size));
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
type: "template",
|
|
32
|
+
origin: { ...this.origin },
|
|
33
|
+
bounds: { ...this.bounds.size },
|
|
34
|
+
template: this.template.toJSON(),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
fromJSON(data) {
|
|
38
|
+
this.origin.x = data.origin.x;
|
|
39
|
+
this.origin.y = data.origin.y;
|
|
40
|
+
this.origin.z = data.origin.z;
|
|
41
|
+
const template = VoxelTemplateSelection.Register.create(data.template);
|
|
42
|
+
this.setTemplate(template);
|
|
35
43
|
}
|
|
36
44
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
|
+
export interface BoxVoxelShapeSelectionData extends IVoxelShapeSelectionData<"box-shape"> {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
depth: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class BoxVoxelShapeSelection implements IVoxelShapeSelection<"box-shape", BoxVoxelShapeSelectionData> {
|
|
10
|
+
static readonly Type = "box-shape";
|
|
11
|
+
static CreateNew(data: Partial<BoxVoxelShapeSelectionData>): BoxVoxelShapeSelectionData;
|
|
12
|
+
origin: Vector3Like;
|
|
13
|
+
bounds: BoundingBox;
|
|
14
|
+
_width: number;
|
|
15
|
+
get width(): number;
|
|
16
|
+
set width(width: number);
|
|
17
|
+
_height: number;
|
|
18
|
+
get height(): number;
|
|
19
|
+
set height(height: number);
|
|
20
|
+
_depth: number;
|
|
21
|
+
get depth(): number;
|
|
22
|
+
set depth(depth: number);
|
|
23
|
+
private _updateBounds;
|
|
24
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
25
|
+
clone(): BoxVoxelShapeSelection;
|
|
26
|
+
toJSON(): BoxVoxelShapeSelectionData;
|
|
27
|
+
fromJSON(data: BoxVoxelShapeSelectionData): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class BoxVoxelShapeSelection {
|
|
4
|
+
static Type = "box-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: BoxVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds ||
|
|
10
|
+
Vector3Like.Create(data.width || 5, data.height || 5, data.depth || 5),
|
|
11
|
+
width: data.width || 5,
|
|
12
|
+
height: data.height || 5,
|
|
13
|
+
depth: data.depth || 5,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
origin = Vector3Like.Create();
|
|
17
|
+
bounds = new BoundingBox();
|
|
18
|
+
_width = 1;
|
|
19
|
+
get width() {
|
|
20
|
+
return this._width;
|
|
21
|
+
}
|
|
22
|
+
set width(width) {
|
|
23
|
+
this._width = width;
|
|
24
|
+
this._updateBounds();
|
|
25
|
+
}
|
|
26
|
+
_height = 1;
|
|
27
|
+
get height() {
|
|
28
|
+
return this._height;
|
|
29
|
+
}
|
|
30
|
+
set height(height) {
|
|
31
|
+
this._height = height;
|
|
32
|
+
this._updateBounds();
|
|
33
|
+
}
|
|
34
|
+
_depth = 1;
|
|
35
|
+
get depth() {
|
|
36
|
+
return this._depth;
|
|
37
|
+
}
|
|
38
|
+
set depth(depth) {
|
|
39
|
+
this._depth = depth;
|
|
40
|
+
this._updateBounds();
|
|
41
|
+
}
|
|
42
|
+
_updateBounds() {
|
|
43
|
+
this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
|
|
44
|
+
}
|
|
45
|
+
isSelected(x, y, z) {
|
|
46
|
+
let rx = x - this.origin.x;
|
|
47
|
+
let ry = y - this.origin.y;
|
|
48
|
+
let rz = z - this.origin.z;
|
|
49
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
50
|
+
return false;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
clone() {
|
|
54
|
+
const newTemplate = new BoxVoxelShapeSelection();
|
|
55
|
+
newTemplate.fromJSON(this.toJSON());
|
|
56
|
+
return newTemplate;
|
|
57
|
+
}
|
|
58
|
+
toJSON() {
|
|
59
|
+
return {
|
|
60
|
+
type: BoxVoxelShapeSelection.Type,
|
|
61
|
+
origin: { ...this.origin },
|
|
62
|
+
bounds: { ...this.bounds.size },
|
|
63
|
+
width: this._width,
|
|
64
|
+
height: this._height,
|
|
65
|
+
depth: this._depth,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
fromJSON(data) {
|
|
69
|
+
this.origin.x = data.origin.x;
|
|
70
|
+
this.origin.y = data.origin.y;
|
|
71
|
+
this.origin.z = data.origin.z;
|
|
72
|
+
this._width = data.width;
|
|
73
|
+
this._height = data.height;
|
|
74
|
+
this._depth = data.depth;
|
|
75
|
+
this._updateBounds();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
|
+
export interface ConeVoxelShapeSelectionData extends IVoxelShapeSelectionData<"cone-shape"> {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
depth: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class ConeVoxelShapeSelection implements IVoxelShapeSelection<"cone-shape", ConeVoxelShapeSelectionData> {
|
|
10
|
+
static readonly Type = "cone-shape";
|
|
11
|
+
static CreateNew(data: Partial<ConeVoxelShapeSelectionData>): ConeVoxelShapeSelectionData;
|
|
12
|
+
origin: Vector3Like;
|
|
13
|
+
bounds: BoundingBox;
|
|
14
|
+
_width: number;
|
|
15
|
+
get width(): number;
|
|
16
|
+
set width(width: number);
|
|
17
|
+
_height: number;
|
|
18
|
+
get height(): number;
|
|
19
|
+
set height(height: number);
|
|
20
|
+
_depth: number;
|
|
21
|
+
get depth(): number;
|
|
22
|
+
set depth(depth: number);
|
|
23
|
+
private _updateBounds;
|
|
24
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
25
|
+
clone(): ConeVoxelShapeSelection;
|
|
26
|
+
toJSON(): ConeVoxelShapeSelectionData;
|
|
27
|
+
fromJSON(data: ConeVoxelShapeSelectionData): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class ConeVoxelShapeSelection {
|
|
4
|
+
static Type = "cone-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: ConeVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds ||
|
|
10
|
+
Vector3Like.Create(data.width || 1, data.height || 1, data.depth || 1),
|
|
11
|
+
width: data.width || 1,
|
|
12
|
+
height: data.height || 1,
|
|
13
|
+
depth: data.depth || 1,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
origin = Vector3Like.Create();
|
|
17
|
+
bounds = new BoundingBox();
|
|
18
|
+
_width = 1;
|
|
19
|
+
get width() {
|
|
20
|
+
return this._width;
|
|
21
|
+
}
|
|
22
|
+
set width(width) {
|
|
23
|
+
this._width = width;
|
|
24
|
+
this._updateBounds();
|
|
25
|
+
}
|
|
26
|
+
_height = 1;
|
|
27
|
+
get height() {
|
|
28
|
+
return this._height;
|
|
29
|
+
}
|
|
30
|
+
set height(height) {
|
|
31
|
+
this._height = height;
|
|
32
|
+
this._updateBounds();
|
|
33
|
+
}
|
|
34
|
+
_depth = 1;
|
|
35
|
+
get depth() {
|
|
36
|
+
return this._depth;
|
|
37
|
+
}
|
|
38
|
+
set depth(depth) {
|
|
39
|
+
this._depth = depth;
|
|
40
|
+
this._updateBounds();
|
|
41
|
+
}
|
|
42
|
+
_updateBounds() {
|
|
43
|
+
this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
|
|
44
|
+
}
|
|
45
|
+
isSelected(x, y, z) {
|
|
46
|
+
let rx = x - this.origin.x;
|
|
47
|
+
let ry = y - this.origin.y;
|
|
48
|
+
let rz = z - this.origin.z;
|
|
49
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
50
|
+
return false;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
clone() {
|
|
54
|
+
const newTemplate = new ConeVoxelShapeSelection();
|
|
55
|
+
newTemplate.fromJSON(this.toJSON());
|
|
56
|
+
return newTemplate;
|
|
57
|
+
}
|
|
58
|
+
toJSON() {
|
|
59
|
+
return {
|
|
60
|
+
type: ConeVoxelShapeSelection.Type,
|
|
61
|
+
origin: { ...this.origin },
|
|
62
|
+
bounds: { ...this.bounds.size },
|
|
63
|
+
width: this._width,
|
|
64
|
+
height: this._height,
|
|
65
|
+
depth: this._depth,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
fromJSON(data) {
|
|
69
|
+
this.origin.x = data.origin.x;
|
|
70
|
+
this.origin.y = data.origin.y;
|
|
71
|
+
this.origin.z = data.origin.z;
|
|
72
|
+
this._width = data.width;
|
|
73
|
+
this._height = data.height;
|
|
74
|
+
this._depth = data.depth;
|
|
75
|
+
this._updateBounds();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
|
+
export interface CylinderVoxelShapeSelectionData extends IVoxelShapeSelectionData<"cylinder-shape"> {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
depth: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class CylinderVoxelShapeSelection implements IVoxelShapeSelection<"cylinder-shape", CylinderVoxelShapeSelectionData> {
|
|
10
|
+
static readonly Type = "cylinder-shape";
|
|
11
|
+
static CreateNew(data: Partial<CylinderVoxelShapeSelectionData>): CylinderVoxelShapeSelectionData;
|
|
12
|
+
origin: Vector3Like;
|
|
13
|
+
bounds: BoundingBox;
|
|
14
|
+
_width: number;
|
|
15
|
+
get width(): number;
|
|
16
|
+
set width(width: number);
|
|
17
|
+
_height: number;
|
|
18
|
+
get height(): number;
|
|
19
|
+
set height(height: number);
|
|
20
|
+
_depth: number;
|
|
21
|
+
get depth(): number;
|
|
22
|
+
set depth(depth: number);
|
|
23
|
+
private _updateBounds;
|
|
24
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
25
|
+
clone(): CylinderVoxelShapeSelection;
|
|
26
|
+
toJSON(): CylinderVoxelShapeSelectionData;
|
|
27
|
+
fromJSON(data: CylinderVoxelShapeSelectionData): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class CylinderVoxelShapeSelection {
|
|
4
|
+
static Type = "cylinder-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: CylinderVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds ||
|
|
10
|
+
Vector3Like.Create(data.width || 1, data.height || 1, data.depth || 1),
|
|
11
|
+
width: data.width || 1,
|
|
12
|
+
height: data.height || 1,
|
|
13
|
+
depth: data.depth || 1,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
origin = Vector3Like.Create();
|
|
17
|
+
bounds = new BoundingBox();
|
|
18
|
+
_width = 1;
|
|
19
|
+
get width() {
|
|
20
|
+
return this._width;
|
|
21
|
+
}
|
|
22
|
+
set width(width) {
|
|
23
|
+
this._width = width;
|
|
24
|
+
this._updateBounds();
|
|
25
|
+
}
|
|
26
|
+
_height = 1;
|
|
27
|
+
get height() {
|
|
28
|
+
return this._height;
|
|
29
|
+
}
|
|
30
|
+
set height(height) {
|
|
31
|
+
this._height = height;
|
|
32
|
+
this._updateBounds();
|
|
33
|
+
}
|
|
34
|
+
_depth = 1;
|
|
35
|
+
get depth() {
|
|
36
|
+
return this._depth;
|
|
37
|
+
}
|
|
38
|
+
set depth(depth) {
|
|
39
|
+
this._depth = depth;
|
|
40
|
+
this._updateBounds();
|
|
41
|
+
}
|
|
42
|
+
_updateBounds() {
|
|
43
|
+
this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
|
|
44
|
+
}
|
|
45
|
+
isSelected(x, y, z) {
|
|
46
|
+
let rx = x - this.origin.x;
|
|
47
|
+
let ry = y - this.origin.y;
|
|
48
|
+
let rz = z - this.origin.z;
|
|
49
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
50
|
+
return false;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
clone() {
|
|
54
|
+
const newTemplate = new CylinderVoxelShapeSelection();
|
|
55
|
+
newTemplate.fromJSON(this.toJSON());
|
|
56
|
+
return newTemplate;
|
|
57
|
+
}
|
|
58
|
+
toJSON() {
|
|
59
|
+
return {
|
|
60
|
+
type: CylinderVoxelShapeSelection.Type,
|
|
61
|
+
origin: { ...this.origin },
|
|
62
|
+
bounds: { ...this.bounds.size },
|
|
63
|
+
width: this._width,
|
|
64
|
+
height: this._height,
|
|
65
|
+
depth: this._depth,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
fromJSON(data) {
|
|
69
|
+
this.origin.x = data.origin.x;
|
|
70
|
+
this.origin.y = data.origin.y;
|
|
71
|
+
this.origin.z = data.origin.z;
|
|
72
|
+
this._width = data.width;
|
|
73
|
+
this._height = data.height;
|
|
74
|
+
this._depth = data.depth;
|
|
75
|
+
this._updateBounds();
|
|
76
|
+
}
|
|
77
|
+
}
|