@divinevoxel/vlox 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Builder/Tools/Brush/BrushTool.d.ts +16 -9
- package/Builder/Tools/Brush/BrushTool.js +258 -52
- package/Builder/Tools/BuilderToolBase.d.ts +36 -0
- package/Builder/Tools/BuilderToolBase.js +39 -0
- package/Builder/Tools/Hand/HandTool.d.ts +9 -7
- package/Builder/Tools/Hand/HandTool.js +40 -23
- package/Builder/Tools/Path/PahtTool.d.ts +12 -7
- package/Builder/Tools/Path/PahtTool.js +32 -21
- package/Builder/Tools/Sculpt/SculptTool.d.ts +34 -0
- package/Builder/Tools/Sculpt/SculptTool.js +102 -0
- package/Builder/Tools/Shape/ShapeTool.d.ts +32 -0
- package/Builder/Tools/Shape/ShapeTool.js +78 -0
- package/Builder/Tools/Template/TemplateTool.d.ts +35 -0
- package/Builder/Tools/Template/TemplateTool.js +73 -0
- package/Builder/Tools/Wand/WandTool.d.ts +9 -7
- package/Builder/Tools/Wand/WandTool.js +43 -20
- package/Builder/Tools/Wrench/WrenchTool.d.ts +7 -7
- package/Builder/Tools/Wrench/WrenchTool.js +22 -13
- package/Builder/Util/FreeBoxSelection.d.ts +12 -0
- package/Builder/Util/FreeBoxSelection.js +21 -0
- package/Builder/Util/FreePointSelection.d.ts +14 -0
- package/Builder/Util/FreePointSelection.js +39 -0
- package/Builder/Util/SurfaceBoxSelection.d.ts +12 -0
- package/Builder/{Tools/Box/BoxSelection.js → Util/SurfaceBoxSelection.js} +1 -3
- package/Builder/VoxelBuildSpace.d.ts +37 -25
- package/Builder/VoxelBuildSpace.js +99 -40
- package/Builder/World/InitTasks.js +17 -22
- package/Mesher/Geomtry/Proto/ProtoMesh.d.ts +18 -0
- package/Mesher/Geomtry/Proto/ProtoMesh.js +73 -0
- package/Mesher/Geomtry/{VoxelMeshBuffers.d.ts → Proto/ProtoMeshBuffer.d.ts} +2 -2
- package/Mesher/Geomtry/{VoxelMeshBuffers.js → Proto/ProtoMeshBuffer.js} +2 -2
- package/Mesher/Geomtry/Shapes/Box.d.ts +2 -9
- package/Mesher/Geomtry/Shapes/Box.js +7 -12
- package/Mesher/Geomtry/Transform/TransformBox.js +5 -2
- package/Mesher/InitMesher.js +4 -4
- package/Mesher/InitTask.js +2 -2
- package/Mesher/Items/Base/CompactItemMesh.d.ts +3 -0
- package/Mesher/Items/Base/CompactItemMesh.js +20 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.d.ts +5 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.js +131 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.d.ts +48 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.js +114 -0
- package/Mesher/Items/MeshTexture.d.ts +1 -0
- package/Mesher/Items/MeshTexture.js +214 -0
- package/Mesher/Items/MeshTextureO.js +277 -0
- package/Mesher/Items/Models/ItemModelBuilder.d.ts +27 -0
- package/Mesher/Items/Models/ItemModelBuilder.js +64 -0
- package/Mesher/Types/ItemMesh.types.d.ts +5 -0
- package/Mesher/Types/ItemMesh.types.js +12 -0
- package/Mesher/Types/Mesher.types.d.ts +15 -9
- package/Mesher/Types/Mesher.types.js +14 -0
- package/Mesher/Types/VoxelMesh.types.js +7 -6
- package/Mesher/Voxels/Base/CompactTemplateMesh.d.ts +3 -0
- package/Mesher/{Functions/CompactVoxelMesh.js → Voxels/Base/CompactTemplateMesh.js} +4 -40
- package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.d.ts +2 -2
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.js +9 -8
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.d.ts +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.d.ts +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.js +2 -2
- package/Mesher/Voxels/MeshTemplate.d.ts +3 -0
- package/Mesher/Voxels/MeshTemplate.js +81 -0
- package/Mesher/{Functions → Voxels}/MeshVoxel.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/MeshVoxel.js +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.js +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/GetTexture.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.js +14 -16
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.d.ts +2 -2
- package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +24 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/ConsistentRotationTextureProcedure.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -5
- package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +205 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +28 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +109 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.js +2 -0
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.js +3 -3
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.d.ts +7 -7
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.js +6 -5
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.js +1 -1
- package/Renderer/Classes/DVESectionMeshes.d.ts +1 -1
- package/Renderer/MeshManager.js +1 -1
- package/Settings/EngineSettings.types.d.ts +2 -1
- package/Settings/EngineSettings.types.js +3 -1
- package/Tasks/Paint/Common.js +14 -9
- package/Tasks/Paint/Erase/EraseVoxelSelection.d.ts +4 -0
- package/Tasks/Paint/Erase/EraseVoxelSelection.js +33 -0
- package/Tasks/Paint/Erase/EraseVoxelTemplate.js +1 -2
- package/Tasks/Paint/Paint/PaintVoxel.js +1 -1
- package/Tasks/Paint/Paint/PaintVoxelTemplate.js +1 -1
- package/Tasks/Propagation/Illumanation/RGBUpdate.js +1 -1
- package/Tasks/Tasks.types.d.ts +2 -0
- package/Tasks/TasksIds.d.ts +1 -0
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/WorldGeneration/InitTasks.js +3 -1
- package/Templates/Archive/ArchivedVoxelTemplate.d.ts +5 -5
- package/Templates/Archive/ArchivedVoxelTemplate.js +52 -49
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +0 -2
- package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +0 -1
- package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +0 -2
- package/Templates/Cursor/TemplateCursor.d.ts +6 -1
- package/Templates/Cursor/TemplateCursor.js +13 -2
- package/Templates/Cursor/TemplateProxy.js +1 -6
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
- package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
- package/Templates/Full/FullVoxelTemplate.d.ts +4 -4
- package/Templates/Full/FullVoxelTemplate.js +29 -18
- package/Templates/Functions/ExtrudeSelection.d.ts +5 -0
- package/Templates/Functions/ExtrudeSelection.js +44 -0
- package/Templates/Functions/FillSelection.d.ts +4 -0
- package/Templates/Functions/FillSelection.js +20 -0
- package/Templates/Functions/FlipTemplate.d.ts +2 -2
- package/Templates/Functions/FlipTemplate.js +8 -8
- package/Templates/Functions/RotateTemplate.d.ts +2 -2
- package/Templates/Path/VoxelPath.js +2 -1
- package/Templates/Selection/VoxelBFSSelection.d.ts +3 -6
- package/Templates/Selection/VoxelBFSSelection.js +20 -24
- package/Templates/Selection/{VoxelBoxSelection.d.ts → VoxelBoundsSelection.d.ts} +9 -6
- package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +29 -22
- package/Templates/Selection/VoxelPointSelection.d.ts +8 -6
- package/Templates/Selection/VoxelPointSelection.js +25 -24
- package/Templates/Selection/VoxelSelection.d.ts +18 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +5 -12
- package/Templates/Selection/VoxelSurfaceSelection.js +76 -90
- package/Templates/Selection/VoxelTemplateSelection.d.ts +10 -4
- package/Templates/Selection/VoxelTemplateSelection.js +18 -10
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +92 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +37 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +137 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +20 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +61 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.d.ts +5 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.js +1 -0
- package/Templates/Shapes/VoxelShape.types.d.ts +2 -0
- package/Templates/Shapes/VoxelShape.types.js +8 -0
- package/Templates/Shapes/VoxelShapeTemplate.d.ts +37 -0
- package/Templates/Shapes/{BasicVoxelShapeTemplate.js → VoxelShapeTemplate.js} +43 -37
- package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +4 -13
- package/Templates/Shapes/VoxelShapeTemplate.types.js +0 -1
- package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
- package/Templates/VoxelTemplateRegister.js +60 -0
- package/Templates/VoxelTemplates.types.d.ts +2 -3
- package/Textures/Classes/CompiledTexture.d.ts +2 -0
- package/Textures/Classes/CompiledTexture.js +19 -1
- package/Textures/Functions/BuildTextureData.js +13 -0
- package/Textures/TextureManager.d.ts +1 -0
- package/Textures/TextureManager.js +11 -5
- package/Tools/Brush/Brush.d.ts +2 -0
- package/Tools/Brush/Brush.js +19 -0
- package/Tools/Tasks/TasksTool.d.ts +2 -1
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
- package/Voxels/Cursor/VoxelLightData.js +2 -2
- package/Voxels/Functions/BuildTagData.js +1 -1
- package/Voxels/Indexes/VoxelIndex.d.ts +1 -0
- package/Voxels/Indexes/VoxelIndex.js +11 -13
- package/Voxels/InitVoxelData.js +5 -14
- package/Voxels/Interaction/Functions/PickVoxel.d.ts +0 -5
- package/Voxels/Interaction/Functions/PickVoxel.js +64 -85
- package/Voxels/Interaction/Functions/PickVoxelWorld.js +6 -3
- package/Voxels/Models/CompiledVoxelModel.types.d.ts +1 -1
- package/Voxels/Models/Defaults/CubeVoxelGeometry.js +11 -0
- package/Voxels/Models/Defaults/CubeVoxelModels.js +44 -99
- package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -3
- package/Voxels/Models/Defaults/PanelVoxelGeometry.js +2 -226
- package/Voxels/Models/Defaults/PanelVoxelModels.d.ts +1 -0
- package/Voxels/Models/Defaults/PanelVoxelModels.js +100 -258
- package/Voxels/Models/Defaults/StairVoxelModel.js +2 -2
- package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +4 -1
- package/Voxels/Models/Rules/Classes/GeomtryInput.js +26 -5
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +23 -8
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +1 -1
- package/Voxels/Models/VoxelModel.types.d.ts +6 -1
- package/Voxels/Types/PaintVoxelData.d.ts +2 -0
- package/Voxels/Types/PaintVoxelData.js +51 -0
- package/World/Cursor/SectionCursor.d.ts +4 -0
- package/World/Cursor/SectionCursor.js +13 -16
- package/World/Cursor/SectorCursor.d.ts +4 -0
- package/World/Cursor/SectorCursor.js +13 -16
- package/World/Cursor/WorldCursor.d.ts +4 -0
- package/World/Cursor/WorldCursor.js +8 -0
- package/World/Sector/SectorHeightMap.d.ts +6 -0
- package/World/Sector/SectorHeightMap.js +6 -0
- package/World/SnapShot/SectionSnapShotCursor.d.ts +3 -0
- package/World/SnapShot/SectionSnapShotCursor.js +6 -0
- package/World/WorldSpaces.js +3 -3
- package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +5 -1
- package/WorldSimulation/Dimensions/DimensionSimulation.js +12 -0
- package/WorldSimulation/Dimensions/Generator.d.ts +1 -0
- package/WorldSimulation/Dimensions/Generator.js +1 -0
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +3 -0
- package/WorldSimulation/Dimensions/SimulationSector.js +71 -41
- package/WorldSimulation/Internal/WorldSimulationTasks.js +5 -2
- package/WorldSimulation/Procedures/BuildOnly.d.ts +10 -0
- package/WorldSimulation/Procedures/BuildOnly.js +55 -0
- package/WorldSimulation/Procedures/InitalLoad.js +3 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +2 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.js +11 -3
- package/WorldSimulation/Tasks/TaskSegment.d.ts +2 -1
- package/WorldSimulation/Tasks/TaskSegment.js +3 -1
- package/WorldSimulation/Tick/TickQueue.d.ts +2 -0
- package/WorldSimulation/Tick/TickQueue.js +26 -0
- package/WorldSimulation/Tools/SimulationBrush.d.ts +3 -0
- package/WorldSimulation/Tools/SimulationBrush.js +52 -0
- package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +3 -0
- package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -1
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +2 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +6 -0
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +39 -14
- package/WorldSimulation/WorldSimulation.d.ts +10 -0
- package/WorldSimulation/WorldSimulation.js +41 -1
- package/package.json +1 -30
- package/Builder/Tools/Box/BoxSelection.d.ts +0 -12
- package/Builder/Tools/Box/BoxTool.d.ts +0 -31
- package/Builder/Tools/Box/BoxTool.js +0 -91
- package/Builder/Tools/Box/BoxToolTemplate.d.ts +0 -13
- package/Builder/Tools/Box/BoxToolTemplate.js +0 -23
- package/Builder/VoxelBuilder.types.d.ts +0 -0
- package/Builder/VoxelBuilder.types.js +0 -1
- package/Mesher/Functions/CompactVoxelMesh.d.ts +0 -3
- package/Mesher/Functions/MeshTexture.js +0 -278
- package/Mesher/Geomtry/VoxelMesh.d.ts +0 -12
- package/Mesher/Geomtry/VoxelMesh.js +0 -25
- package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +0 -25
- package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +0 -162
- package/Templates/Selection/VoxelSelecton.d.ts +0 -9
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -36
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/BoxVoxelTemplate.js +0 -83
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/ConeVoxelTemplate.js +0 -73
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/CylinderVoxelTemplate.js +0 -73
- package/Templates/Shapes/EllipsoidVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/EllipsoidVoxelTemplate.js +0 -89
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -73
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -31
- package/Templates/Shapes/PyramidVoxelTemplate.js +0 -148
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -15
- package/Templates/Shapes/SphereVoxelTemplate.js +0 -59
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/TorusVoxelTemplate.js +0 -73
- package/Templates/VoxelTempateRegister.js +0 -30
- /package/Mesher/{Functions/MeshTexture.d.ts → Items/MeshTextureO.d.ts} +0 -0
- /package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/GetTexture.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.js +0 -0
- /package/Templates/Selection/{VoxelSelecton.js → VoxelSelection.js} +0 -0
|
@@ -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 EllipsoidVoxelShapeSelectionData extends IVoxelShapeSelectionData<"ellipsoid-shape"> {
|
|
5
|
+
radiusX: number;
|
|
6
|
+
radiusY: number;
|
|
7
|
+
radiusZ: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class EllipsoidVoxelShapeSelection implements IVoxelShapeSelection<"ellipsoid-shape", EllipsoidVoxelShapeSelectionData> {
|
|
10
|
+
static readonly Type = "ellipsoid-shape";
|
|
11
|
+
static CreateNew(data: Partial<EllipsoidVoxelShapeSelectionData>): EllipsoidVoxelShapeSelectionData;
|
|
12
|
+
origin: Vector3Like;
|
|
13
|
+
bounds: BoundingBox;
|
|
14
|
+
private _radiusX;
|
|
15
|
+
get radiusX(): number;
|
|
16
|
+
set radiusX(radius: number);
|
|
17
|
+
private _radiusY;
|
|
18
|
+
get radiusY(): number;
|
|
19
|
+
set radiusY(radius: number);
|
|
20
|
+
private _radiusZ;
|
|
21
|
+
get radiusZ(): number;
|
|
22
|
+
set radiusZ(radius: number);
|
|
23
|
+
private _updateBounds;
|
|
24
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
25
|
+
clone(): EllipsoidVoxelShapeSelection;
|
|
26
|
+
toJSON(): EllipsoidVoxelShapeSelectionData;
|
|
27
|
+
fromJSON(data: EllipsoidVoxelShapeSelectionData): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class EllipsoidVoxelShapeSelection {
|
|
4
|
+
static Type = "ellipsoid-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: EllipsoidVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds || Vector3Like.Create(),
|
|
10
|
+
radiusX: data.radiusX || 5,
|
|
11
|
+
radiusY: data.radiusY || 5,
|
|
12
|
+
radiusZ: data.radiusZ || 5,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
origin = Vector3Like.Create();
|
|
16
|
+
bounds = new BoundingBox();
|
|
17
|
+
_radiusX = 0;
|
|
18
|
+
get radiusX() {
|
|
19
|
+
return this._radiusX;
|
|
20
|
+
}
|
|
21
|
+
set radiusX(radius) {
|
|
22
|
+
const oldRadius = this._radiusX;
|
|
23
|
+
this._radiusX = radius;
|
|
24
|
+
if (oldRadius != radius) {
|
|
25
|
+
this._updateBounds();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
_radiusY = 0;
|
|
29
|
+
get radiusY() {
|
|
30
|
+
return this._radiusY;
|
|
31
|
+
}
|
|
32
|
+
set radiusY(radius) {
|
|
33
|
+
const oldRadius = this._radiusY;
|
|
34
|
+
this._radiusY = radius;
|
|
35
|
+
if (oldRadius != radius) {
|
|
36
|
+
this._updateBounds();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
_radiusZ = 0;
|
|
40
|
+
get radiusZ() {
|
|
41
|
+
return this._radiusZ;
|
|
42
|
+
}
|
|
43
|
+
set radiusZ(radius) {
|
|
44
|
+
const oldRadius = this._radiusZ;
|
|
45
|
+
this._radiusZ = radius;
|
|
46
|
+
if (oldRadius != radius) {
|
|
47
|
+
this._updateBounds();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_updateBounds() {
|
|
51
|
+
this.bounds.setSize(Vector3Like.Create(this._radiusX * 2 + 1, this._radiusY * 2 + 1, this._radiusZ * 2 + 1));
|
|
52
|
+
}
|
|
53
|
+
isSelected(x, y, z) {
|
|
54
|
+
let rx = x - this.origin.x;
|
|
55
|
+
let ry = y - this.origin.y;
|
|
56
|
+
let rz = z - this.origin.z;
|
|
57
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
58
|
+
return false;
|
|
59
|
+
const cx = Math.floor(this.bounds.size.x / 2);
|
|
60
|
+
const cy = Math.floor(this.bounds.size.y / 2);
|
|
61
|
+
const cz = Math.floor(this.bounds.size.z / 2);
|
|
62
|
+
const normX = (rx - cx) / this.radiusX;
|
|
63
|
+
const normY = (ry - cy) / this.radiusY;
|
|
64
|
+
const normZ = (rz - cz) / this.radiusZ;
|
|
65
|
+
const distance = Math.sqrt(normX * normX + normY * normY + normZ * normZ);
|
|
66
|
+
return distance <= 1;
|
|
67
|
+
}
|
|
68
|
+
clone() {
|
|
69
|
+
const newTemplate = new EllipsoidVoxelShapeSelection();
|
|
70
|
+
newTemplate.fromJSON(this.toJSON());
|
|
71
|
+
return newTemplate;
|
|
72
|
+
}
|
|
73
|
+
toJSON() {
|
|
74
|
+
return {
|
|
75
|
+
type: "ellipsoid-shape",
|
|
76
|
+
origin: { ...this.origin },
|
|
77
|
+
bounds: { ...this.bounds.size },
|
|
78
|
+
radiusX: this._radiusX,
|
|
79
|
+
radiusY: this._radiusY,
|
|
80
|
+
radiusZ: this._radiusZ,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
fromJSON(data) {
|
|
84
|
+
this.origin.x = data.origin.x;
|
|
85
|
+
this.origin.y = data.origin.y;
|
|
86
|
+
this.origin.z = data.origin.z;
|
|
87
|
+
this._radiusX = data.radiusX;
|
|
88
|
+
this._radiusY = data.radiusY;
|
|
89
|
+
this._radiusZ = data.radiusZ;
|
|
90
|
+
this._updateBounds();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -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 OctahedronVoxelShapeSelectionData extends IVoxelShapeSelectionData<"octahedron-shape"> {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
depth: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class OctahedronVoxelShapeSelection implements IVoxelShapeSelection<"octahedron-shape", OctahedronVoxelShapeSelectionData> {
|
|
10
|
+
static readonly Type = "octahedron-shape";
|
|
11
|
+
static CreateNew(data: Partial<OctahedronVoxelShapeSelectionData>): OctahedronVoxelShapeSelectionData;
|
|
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(): OctahedronVoxelShapeSelection;
|
|
26
|
+
toJSON(): OctahedronVoxelShapeSelectionData;
|
|
27
|
+
fromJSON(data: OctahedronVoxelShapeSelectionData): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class OctahedronVoxelShapeSelection {
|
|
4
|
+
static Type = "octahedron-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: OctahedronVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds || Vector3Like.Create(),
|
|
10
|
+
width: data.width || 1,
|
|
11
|
+
height: data.height || 1,
|
|
12
|
+
depth: data.depth || 1,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
origin = Vector3Like.Create();
|
|
16
|
+
bounds = new BoundingBox();
|
|
17
|
+
_width = 1;
|
|
18
|
+
get width() {
|
|
19
|
+
return this._width;
|
|
20
|
+
}
|
|
21
|
+
set width(width) {
|
|
22
|
+
this._width = width;
|
|
23
|
+
this._updateBounds();
|
|
24
|
+
}
|
|
25
|
+
_height = 1;
|
|
26
|
+
get height() {
|
|
27
|
+
return this._height;
|
|
28
|
+
}
|
|
29
|
+
set height(height) {
|
|
30
|
+
this._height = height;
|
|
31
|
+
this._updateBounds();
|
|
32
|
+
}
|
|
33
|
+
_depth = 1;
|
|
34
|
+
get depth() {
|
|
35
|
+
return this._depth;
|
|
36
|
+
}
|
|
37
|
+
set depth(depth) {
|
|
38
|
+
this._depth = depth;
|
|
39
|
+
this._updateBounds();
|
|
40
|
+
}
|
|
41
|
+
_updateBounds() {
|
|
42
|
+
this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
|
|
43
|
+
}
|
|
44
|
+
isSelected(x, y, z) {
|
|
45
|
+
let rx = x - this.origin.x;
|
|
46
|
+
let ry = y - this.origin.y;
|
|
47
|
+
let rz = z - this.origin.z;
|
|
48
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
49
|
+
return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
clone() {
|
|
53
|
+
const newTemplate = new OctahedronVoxelShapeSelection();
|
|
54
|
+
newTemplate.fromJSON(this.toJSON());
|
|
55
|
+
return newTemplate;
|
|
56
|
+
}
|
|
57
|
+
toJSON() {
|
|
58
|
+
return {
|
|
59
|
+
type: "octahedron-shape",
|
|
60
|
+
origin: { ...this.origin },
|
|
61
|
+
bounds: { ...this.bounds.size },
|
|
62
|
+
width: this._width,
|
|
63
|
+
height: this._height,
|
|
64
|
+
depth: this._depth,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
fromJSON(data) {
|
|
68
|
+
this.origin.x = data.origin.x;
|
|
69
|
+
this.origin.y = data.origin.y;
|
|
70
|
+
this.origin.z = data.origin.z;
|
|
71
|
+
this._width = data.width;
|
|
72
|
+
this._height = data.height;
|
|
73
|
+
this._depth = data.depth;
|
|
74
|
+
this._updateBounds();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
import { VoxelShapeShapeDirections } from "../VoxelShape.types";
|
|
4
|
+
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
5
|
+
export interface PyramidVoxelShapeSelectionData extends IVoxelShapeSelectionData<"pyramid-shape"> {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
depth: number;
|
|
9
|
+
fallOff: number;
|
|
10
|
+
direction: VoxelShapeShapeDirections;
|
|
11
|
+
}
|
|
12
|
+
export declare class PyramidVoxelShapeSelection implements IVoxelShapeSelection<"pyramid-shape", PyramidVoxelShapeSelectionData> {
|
|
13
|
+
static readonly Type = "pyramid-shape";
|
|
14
|
+
static CreateNew(data: Partial<PyramidVoxelShapeSelectionData>): PyramidVoxelShapeSelectionData;
|
|
15
|
+
origin: Vector3Like;
|
|
16
|
+
bounds: BoundingBox;
|
|
17
|
+
private _fallOff;
|
|
18
|
+
get fallOff(): number;
|
|
19
|
+
set fallOff(fallOFf: number);
|
|
20
|
+
private _direction;
|
|
21
|
+
get direction(): VoxelShapeShapeDirections;
|
|
22
|
+
set direction(direction: VoxelShapeShapeDirections);
|
|
23
|
+
_width: number;
|
|
24
|
+
get width(): number;
|
|
25
|
+
set width(width: number);
|
|
26
|
+
_height: number;
|
|
27
|
+
get height(): number;
|
|
28
|
+
set height(height: number);
|
|
29
|
+
_depth: number;
|
|
30
|
+
get depth(): number;
|
|
31
|
+
set depth(depth: number);
|
|
32
|
+
private _updateBounds;
|
|
33
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
34
|
+
clone(): PyramidVoxelShapeSelection;
|
|
35
|
+
toJSON(): PyramidVoxelShapeSelectionData;
|
|
36
|
+
fromJSON(data: PyramidVoxelShapeSelectionData): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class PyramidVoxelShapeSelection {
|
|
4
|
+
static Type = "pyramid-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: PyramidVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds || Vector3Like.Create(),
|
|
10
|
+
width: data.width || 6,
|
|
11
|
+
height: data.height || 6,
|
|
12
|
+
depth: data.depth || 6,
|
|
13
|
+
fallOff: data.fallOff || 1,
|
|
14
|
+
direction: data.direction || "+y",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
origin = Vector3Like.Create();
|
|
18
|
+
bounds = new BoundingBox();
|
|
19
|
+
_fallOff = 0;
|
|
20
|
+
get fallOff() {
|
|
21
|
+
return this._fallOff;
|
|
22
|
+
}
|
|
23
|
+
set fallOff(fallOFf) {
|
|
24
|
+
this._fallOff = fallOFf;
|
|
25
|
+
}
|
|
26
|
+
_direction = "+y";
|
|
27
|
+
get direction() {
|
|
28
|
+
return this._direction;
|
|
29
|
+
}
|
|
30
|
+
set direction(direction) {
|
|
31
|
+
this._direction = direction;
|
|
32
|
+
}
|
|
33
|
+
_width = 1;
|
|
34
|
+
get width() {
|
|
35
|
+
return this._width;
|
|
36
|
+
}
|
|
37
|
+
set width(width) {
|
|
38
|
+
this._width = width;
|
|
39
|
+
this._updateBounds();
|
|
40
|
+
}
|
|
41
|
+
_height = 1;
|
|
42
|
+
get height() {
|
|
43
|
+
return this._height;
|
|
44
|
+
}
|
|
45
|
+
set height(height) {
|
|
46
|
+
this._height = height;
|
|
47
|
+
this._updateBounds();
|
|
48
|
+
}
|
|
49
|
+
_depth = 1;
|
|
50
|
+
get depth() {
|
|
51
|
+
return this._depth;
|
|
52
|
+
}
|
|
53
|
+
set depth(depth) {
|
|
54
|
+
this._depth = depth;
|
|
55
|
+
this._updateBounds();
|
|
56
|
+
}
|
|
57
|
+
_updateBounds() {
|
|
58
|
+
this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
|
|
59
|
+
}
|
|
60
|
+
isSelected(x, y, z) {
|
|
61
|
+
let rx = x - this.origin.x;
|
|
62
|
+
let ry = y - this.origin.y;
|
|
63
|
+
let rz = z - this.origin.z;
|
|
64
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
65
|
+
return false;
|
|
66
|
+
switch (this.direction) {
|
|
67
|
+
case "+y": {
|
|
68
|
+
// Pyramid pointing up
|
|
69
|
+
const normalizedFallOff = ry * this.fallOff;
|
|
70
|
+
const minX = normalizedFallOff;
|
|
71
|
+
const minZ = normalizedFallOff;
|
|
72
|
+
const maxX = this.width - normalizedFallOff;
|
|
73
|
+
const maxZ = this.depth - normalizedFallOff;
|
|
74
|
+
if (rx >= minX && rz >= minZ && rx < maxX && rz < maxZ)
|
|
75
|
+
return true;
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
case "-y": {
|
|
79
|
+
// Pyramid pointing down
|
|
80
|
+
const normalizedFallOff = (this.height - 1 - ry) * this.fallOff;
|
|
81
|
+
const minX = normalizedFallOff;
|
|
82
|
+
const minZ = normalizedFallOff;
|
|
83
|
+
const maxX = this.width - normalizedFallOff;
|
|
84
|
+
const maxZ = this.depth - normalizedFallOff;
|
|
85
|
+
if (rx >= minX && rz >= minZ && rx < maxX && rz < maxZ)
|
|
86
|
+
return true;
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
case "+x": {
|
|
90
|
+
// Pyramid pointing right
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
case "-x": {
|
|
94
|
+
// Pyramid pointing left
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
case "+z": {
|
|
98
|
+
// Pyramid pointing forward
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
case "-z": {
|
|
102
|
+
// Pyramid pointing backward
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
default:
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
clone() {
|
|
110
|
+
const newTemplate = new PyramidVoxelShapeSelection();
|
|
111
|
+
newTemplate.fromJSON(this.toJSON());
|
|
112
|
+
return newTemplate;
|
|
113
|
+
}
|
|
114
|
+
toJSON() {
|
|
115
|
+
return {
|
|
116
|
+
type: "pyramid-shape",
|
|
117
|
+
origin: { ...this.origin },
|
|
118
|
+
bounds: { ...this.bounds.size },
|
|
119
|
+
fallOff: this._fallOff,
|
|
120
|
+
direction: this._direction,
|
|
121
|
+
width: this._width,
|
|
122
|
+
height: this._height,
|
|
123
|
+
depth: this._depth,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
fromJSON(data) {
|
|
127
|
+
this.origin.x = data.origin.x;
|
|
128
|
+
this.origin.y = data.origin.y;
|
|
129
|
+
this.origin.z = data.origin.z;
|
|
130
|
+
this._width = data.width;
|
|
131
|
+
this._height = data.height;
|
|
132
|
+
this._depth = data.depth;
|
|
133
|
+
this._direction = data.direction;
|
|
134
|
+
this._fallOff = data.fallOff;
|
|
135
|
+
this._updateBounds();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
|
+
export interface SphereVoxelShapeSelectionData extends IVoxelShapeSelectionData<"sphere-shape"> {
|
|
5
|
+
radius: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class SphereVoxelShapeSelection implements IVoxelShapeSelection<"sphere-shape", SphereVoxelShapeSelectionData> {
|
|
8
|
+
static readonly Type = "sphere-shape";
|
|
9
|
+
static CreateNew(data: Partial<SphereVoxelShapeSelectionData>): SphereVoxelShapeSelectionData;
|
|
10
|
+
origin: Vector3Like;
|
|
11
|
+
bounds: BoundingBox;
|
|
12
|
+
_radius: number;
|
|
13
|
+
get radius(): number;
|
|
14
|
+
set radius(radius: number);
|
|
15
|
+
private _updateBounds;
|
|
16
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
17
|
+
clone(): SphereVoxelShapeSelection;
|
|
18
|
+
toJSON(): SphereVoxelShapeSelectionData;
|
|
19
|
+
fromJSON(data: SphereVoxelShapeSelectionData): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class SphereVoxelShapeSelection {
|
|
4
|
+
static Type = "sphere-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: SphereVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds || Vector3Like.Create(),
|
|
10
|
+
radius: data.radius || 2,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
origin = Vector3Like.Create();
|
|
14
|
+
bounds = new BoundingBox();
|
|
15
|
+
_radius = 1;
|
|
16
|
+
get radius() {
|
|
17
|
+
return this._radius;
|
|
18
|
+
}
|
|
19
|
+
set radius(radius) {
|
|
20
|
+
this._radius = radius;
|
|
21
|
+
this._updateBounds();
|
|
22
|
+
}
|
|
23
|
+
_updateBounds() {
|
|
24
|
+
this.bounds.setSize(Vector3Like.Create(this._radius * 2 + 1, this._radius * 2 + 1, this._radius * 2 + 1));
|
|
25
|
+
}
|
|
26
|
+
isSelected(x, y, z) {
|
|
27
|
+
let rx = x - this.origin.x;
|
|
28
|
+
let ry = y - this.origin.y;
|
|
29
|
+
let rz = z - this.origin.z;
|
|
30
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
31
|
+
return false;
|
|
32
|
+
const cx = Math.floor(this.bounds.size.x / 2);
|
|
33
|
+
const cy = Math.floor(this.bounds.size.y / 2);
|
|
34
|
+
const cz = Math.floor(this.bounds.size.z / 2);
|
|
35
|
+
const normX = (rx - cx) / this.radius;
|
|
36
|
+
const normY = (ry - cy) / this.radius;
|
|
37
|
+
const normZ = (rz - cz) / this.radius;
|
|
38
|
+
const distance = Math.sqrt(normX * normX + normY * normY + normZ * normZ);
|
|
39
|
+
return distance <= 1;
|
|
40
|
+
}
|
|
41
|
+
clone() {
|
|
42
|
+
const newTemplate = new SphereVoxelShapeSelection();
|
|
43
|
+
newTemplate.fromJSON(this.toJSON());
|
|
44
|
+
return newTemplate;
|
|
45
|
+
}
|
|
46
|
+
toJSON() {
|
|
47
|
+
return {
|
|
48
|
+
type: "sphere-shape",
|
|
49
|
+
origin: { ...this.origin },
|
|
50
|
+
bounds: { ...this.bounds.size },
|
|
51
|
+
radius: this._radius,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
fromJSON(data) {
|
|
55
|
+
this.origin.x = data.origin.x;
|
|
56
|
+
this.origin.y = data.origin.y;
|
|
57
|
+
this.origin.z = data.origin.z;
|
|
58
|
+
this.radius = data.radius;
|
|
59
|
+
this._updateBounds();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -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 TorusVoxelShapeSelectionData extends IVoxelShapeSelectionData<"torus-shape"> {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
depth: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class TorusVoxelShapeSelection implements IVoxelShapeSelection<"torus-shape", TorusVoxelShapeSelectionData> {
|
|
10
|
+
static readonly Type = "torus-shape";
|
|
11
|
+
static CreateNew(data: Partial<TorusVoxelShapeSelectionData>): TorusVoxelShapeSelectionData;
|
|
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(): TorusVoxelShapeSelection;
|
|
26
|
+
toJSON(): TorusVoxelShapeSelectionData;
|
|
27
|
+
fromJSON(data: TorusVoxelShapeSelectionData): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export class TorusVoxelShapeSelection {
|
|
4
|
+
static Type = "torus-shape";
|
|
5
|
+
static CreateNew(data) {
|
|
6
|
+
return {
|
|
7
|
+
type: TorusVoxelShapeSelection.Type,
|
|
8
|
+
origin: data.origin || Vector3Like.Create(),
|
|
9
|
+
bounds: data.bounds || Vector3Like.Create(),
|
|
10
|
+
width: data.width || 1,
|
|
11
|
+
height: data.height || 1,
|
|
12
|
+
depth: data.depth || 1,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
origin = Vector3Like.Create();
|
|
16
|
+
bounds = new BoundingBox();
|
|
17
|
+
_width = 1;
|
|
18
|
+
get width() {
|
|
19
|
+
return this._width;
|
|
20
|
+
}
|
|
21
|
+
set width(width) {
|
|
22
|
+
this._width = width;
|
|
23
|
+
this._updateBounds();
|
|
24
|
+
}
|
|
25
|
+
_height = 1;
|
|
26
|
+
get height() {
|
|
27
|
+
return this._height;
|
|
28
|
+
}
|
|
29
|
+
set height(height) {
|
|
30
|
+
this._height = height;
|
|
31
|
+
this._updateBounds();
|
|
32
|
+
}
|
|
33
|
+
_depth = 1;
|
|
34
|
+
get depth() {
|
|
35
|
+
return this._depth;
|
|
36
|
+
}
|
|
37
|
+
set depth(depth) {
|
|
38
|
+
this._depth = depth;
|
|
39
|
+
this._updateBounds();
|
|
40
|
+
}
|
|
41
|
+
_updateBounds() {
|
|
42
|
+
this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
|
|
43
|
+
}
|
|
44
|
+
isSelected(x, y, z) {
|
|
45
|
+
let rx = x - this.origin.x;
|
|
46
|
+
let ry = y - this.origin.y;
|
|
47
|
+
let rz = z - this.origin.z;
|
|
48
|
+
if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
|
|
49
|
+
return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
clone() {
|
|
53
|
+
const newTemplate = new TorusVoxelShapeSelection();
|
|
54
|
+
newTemplate.fromJSON(this.toJSON());
|
|
55
|
+
return newTemplate;
|
|
56
|
+
}
|
|
57
|
+
toJSON() {
|
|
58
|
+
return {
|
|
59
|
+
type: "torus-shape",
|
|
60
|
+
origin: { ...this.origin },
|
|
61
|
+
bounds: { ...this.bounds.size },
|
|
62
|
+
width: this._width,
|
|
63
|
+
height: this._height,
|
|
64
|
+
depth: this._depth,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
fromJSON(data) {
|
|
68
|
+
this.origin.x = data.origin.x;
|
|
69
|
+
this.origin.y = data.origin.y;
|
|
70
|
+
this.origin.z = data.origin.z;
|
|
71
|
+
this._width = data.width;
|
|
72
|
+
this._height = data.height;
|
|
73
|
+
this._depth = data.depth;
|
|
74
|
+
this._updateBounds();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IVoxelSelection, IVoxelSelectionData } from "../../Selection/VoxelSelection";
|
|
2
|
+
export interface IVoxelShapeSelectionData<Type extends string> extends IVoxelSelectionData<Type> {
|
|
3
|
+
}
|
|
4
|
+
export interface IVoxelShapeSelection<Type extends string, Data extends IVoxelShapeSelectionData<Type>> extends IVoxelSelection<Type, Data> {
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Flat3DIndex } from "@amodx/math";
|
|
2
|
+
import { PaintVoxelData, RawVoxelData } from "../../Voxels";
|
|
3
|
+
import { VoxelShapeTemplateData, VoxelShapeTemplateFillModes } from "./VoxelShapeTemplate.types";
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
5
|
+
import { IVoxelTemplate } from "../VoxelTemplates.types";
|
|
6
|
+
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./Selections/VoxelShapeSelection";
|
|
7
|
+
import type { VoxelTemplateRegister } from "../VoxelTemplateRegister";
|
|
8
|
+
export declare class VoxelShapeTemplate implements IVoxelTemplate<"shape", VoxelShapeTemplateData> {
|
|
9
|
+
static Register: typeof VoxelTemplateRegister;
|
|
10
|
+
static CreateNew(data: Partial<VoxelShapeTemplateData>): VoxelShapeTemplateData;
|
|
11
|
+
index: Flat3DIndex;
|
|
12
|
+
bounds: BoundingBox;
|
|
13
|
+
fillMode: VoxelShapeTemplateFillModes;
|
|
14
|
+
fillVoxel: PaintVoxelData;
|
|
15
|
+
faceVoxel: PaintVoxelData;
|
|
16
|
+
edgeVoxel: PaintVoxelData;
|
|
17
|
+
pointVoxel: PaintVoxelData;
|
|
18
|
+
_fillVoxel: RawVoxelData;
|
|
19
|
+
_faceVoxel: RawVoxelData;
|
|
20
|
+
_edgeVoxel: RawVoxelData;
|
|
21
|
+
_pointVoxel: RawVoxelData;
|
|
22
|
+
shapeSelection: IVoxelShapeSelection<any, IVoxelShapeSelectionData<any>>;
|
|
23
|
+
constructor(data?: VoxelShapeTemplateData);
|
|
24
|
+
inBounds(x: number, y: number, z: number): boolean;
|
|
25
|
+
setVoxels(fill: PaintVoxelData, face?: PaintVoxelData, edge?: PaintVoxelData, point?: PaintVoxelData): void;
|
|
26
|
+
getIndex(x: number, y: number, z: number): number;
|
|
27
|
+
isIncluded(index: number): boolean;
|
|
28
|
+
isAir(index: number): boolean;
|
|
29
|
+
getId(index: number): number;
|
|
30
|
+
getLight(index: number): number;
|
|
31
|
+
getLevel(index: number): number;
|
|
32
|
+
getSecondary(index: number): number;
|
|
33
|
+
getRaw(index: number, rawRef?: RawVoxelData): RawVoxelData;
|
|
34
|
+
clone(): VoxelShapeTemplate;
|
|
35
|
+
toJSON(): VoxelShapeTemplateData;
|
|
36
|
+
fromJSON(data: VoxelShapeTemplateData): void;
|
|
37
|
+
}
|