@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
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Flat3DIndex } from "@amodx/math";
|
|
2
|
-
const flipArray = ([sizeX, sizeY, sizeZ], array,
|
|
2
|
+
const flipArray = ([sizeX, sizeY, sizeZ], array, axes, index) => {
|
|
3
3
|
const newArray = new Array(array.length);
|
|
4
4
|
for (let x = 0; x < sizeX; x++) {
|
|
5
5
|
for (let y = 0; y < sizeY; y++) {
|
|
6
6
|
for (let z = 0; z < sizeZ; z++) {
|
|
7
7
|
const oldIndex = index.getIndexXYZ(x, y, z);
|
|
8
8
|
let newCoords = [x, y, z];
|
|
9
|
-
if (
|
|
9
|
+
if (axes === "x") {
|
|
10
10
|
newCoords[0] = sizeX - 1 - x;
|
|
11
11
|
}
|
|
12
|
-
else if (
|
|
12
|
+
else if (axes === "y") {
|
|
13
13
|
newCoords[1] = sizeY - 1 - y;
|
|
14
14
|
}
|
|
15
|
-
else if (
|
|
15
|
+
else if (axes === "z") {
|
|
16
16
|
newCoords[2] = sizeZ - 1 - z;
|
|
17
17
|
}
|
|
18
18
|
const newIndexFlat = index.getIndexXYZ(...newCoords);
|
|
@@ -24,20 +24,20 @@ const flipArray = ([sizeX, sizeY, sizeZ], array, direction, index) => {
|
|
|
24
24
|
array[i] = newArray[i];
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
export default function FlipTemplate(template,
|
|
27
|
+
export default function FlipTemplate(template, axes) {
|
|
28
28
|
const { x: sizeX, y: sizeY, z: sizeZ } = template.bounds.size;
|
|
29
29
|
const index = Flat3DIndex.GetXZYOrder();
|
|
30
30
|
index.setBounds(sizeX, sizeY, sizeZ);
|
|
31
31
|
if (typeof template.ids === "object") {
|
|
32
32
|
const ids = template.ids;
|
|
33
|
-
flipArray([sizeX, sizeY, sizeZ], ids,
|
|
33
|
+
flipArray([sizeX, sizeY, sizeZ], ids, axes, index);
|
|
34
34
|
}
|
|
35
35
|
if (typeof template.level === "object") {
|
|
36
36
|
const level = template.level;
|
|
37
|
-
flipArray([sizeX, sizeY, sizeZ], level,
|
|
37
|
+
flipArray([sizeX, sizeY, sizeZ], level, axes, index);
|
|
38
38
|
}
|
|
39
39
|
if (typeof template.secondary === "object") {
|
|
40
40
|
const secondary = template.secondary;
|
|
41
|
-
flipArray([sizeX, sizeY, sizeZ], secondary,
|
|
41
|
+
flipArray([sizeX, sizeY, sizeZ], secondary, axes, index);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { Vector3Axes } from "@amodx/math";
|
|
1
2
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
2
|
-
export type TemplateRotationAxes = "x" | "y" | "z";
|
|
3
3
|
export type TemplateRotationAngles = 90 | 180 | 270 | -90 | -180 | -270;
|
|
4
|
-
export default function RotateTemplate(template: FullVoxelTemplate, angle: TemplateRotationAngles, axes?:
|
|
4
|
+
export default function RotateTemplate(template: FullVoxelTemplate, angle: TemplateRotationAngles, axes?: Vector3Axes): void;
|
|
@@ -8,6 +8,7 @@ export class VoxelPathSegment extends TypedEventTarget {
|
|
|
8
8
|
start: data.start ? data.start : [0, 0, 0],
|
|
9
9
|
end: data.end ? data.end : [0, 0, 0],
|
|
10
10
|
voxel: data.voxel ? data.voxel : PaintVoxelData.Create(),
|
|
11
|
+
transient: data.transient ? data.transient : undefined,
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
start;
|
|
@@ -38,7 +39,6 @@ export class VoxelPathSegment extends TypedEventTarget {
|
|
|
38
39
|
this.end[1] = ey;
|
|
39
40
|
this.end[2] = ez;
|
|
40
41
|
if (updated) {
|
|
41
|
-
console.warn("UPDATED");
|
|
42
42
|
this.dispatch("updated", {});
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -105,6 +105,7 @@ export class VoxelPath extends TypedEventTarget {
|
|
|
105
105
|
for (let i = this.segments.length - 1; i > -1; i--) {
|
|
106
106
|
this.segments[i].index--;
|
|
107
107
|
if (this.segments[i] == segment) {
|
|
108
|
+
console.log("found segment to remove", i);
|
|
108
109
|
this.segments.splice(i, 1);
|
|
109
110
|
break;
|
|
110
111
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
2
|
-
import { IVoxelSelection } from "./
|
|
2
|
+
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
4
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
5
5
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
|
-
export interface VoxelBFSSelectionData {
|
|
7
|
-
origin: Vector3Like;
|
|
8
|
-
size: Vector3Like;
|
|
6
|
+
export interface VoxelBFSSelectionData extends IVoxelSelectionData<"bfs"> {
|
|
9
7
|
bitIndex: Uint8Array;
|
|
10
8
|
}
|
|
11
|
-
export declare class VoxelBFSSelection implements IVoxelSelection, VoxelBFSSelectionData {
|
|
9
|
+
export declare class VoxelBFSSelection implements IVoxelSelection<"bfs", VoxelBFSSelectionData> {
|
|
12
10
|
origin: Vector3Like;
|
|
13
|
-
size: Vector3Like;
|
|
14
11
|
bitIndex: Uint8Array;
|
|
15
12
|
index: Flat3DIndex;
|
|
16
13
|
bounds: BoundingBox;
|
|
@@ -5,16 +5,11 @@ import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
|
5
5
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
6
|
export class VoxelBFSSelection {
|
|
7
7
|
origin = Vector3Like.Create();
|
|
8
|
-
size = Vector3Like.Create();
|
|
9
8
|
bitIndex;
|
|
10
9
|
index = Flat3DIndex.GetXZYOrder();
|
|
11
10
|
bounds = new BoundingBox();
|
|
12
11
|
isSelected(x, y, z) {
|
|
13
|
-
if (
|
|
14
|
-
return false;
|
|
15
|
-
if (y < this.origin.y || y >= this.origin.y + this.size.y)
|
|
16
|
-
return false;
|
|
17
|
-
if (z < this.origin.z || z >= this.origin.z + this.size.z)
|
|
12
|
+
if (!this.bounds.intersectsXYZ(x + 0.5, y + 0.5, z + 0.5))
|
|
18
13
|
return false;
|
|
19
14
|
return (getBitArrayIndex(this.bitIndex, this.index.getIndexXYZ(x - this.origin.x, y - this.origin.y, z - this.origin.z)) === 1);
|
|
20
15
|
}
|
|
@@ -80,24 +75,23 @@ export class VoxelBFSSelection {
|
|
|
80
75
|
}
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
|
-
this.size.x = sizeX;
|
|
84
|
-
this.size.y = sizeY;
|
|
85
|
-
this.size.z = sizeZ;
|
|
86
78
|
this.origin.x = min.x;
|
|
87
79
|
this.origin.y = min.y;
|
|
88
80
|
this.origin.z = min.z;
|
|
81
|
+
this.bounds.setMinMax(this.origin, {
|
|
82
|
+
x: this.origin.x + sizeX,
|
|
83
|
+
y: this.origin.y + sizeY,
|
|
84
|
+
z: this.origin.z + sizeZ,
|
|
85
|
+
});
|
|
89
86
|
}
|
|
90
87
|
toTemplate(cursor) {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
this.size.y,
|
|
94
|
-
this.size.z,
|
|
95
|
-
]);
|
|
88
|
+
const size = this.bounds.size;
|
|
89
|
+
const templateData = FullVoxelTemplate.CreateNew([size.x, size.y, size.z]);
|
|
96
90
|
templateData.mask = this.bitIndex.slice();
|
|
97
91
|
const template = new FullVoxelTemplate(templateData);
|
|
98
|
-
for (let x = this.origin.x; x < this.origin.x +
|
|
99
|
-
for (let y = this.origin.y; y < this.origin.y +
|
|
100
|
-
for (let z = this.origin.z; z < this.origin.z +
|
|
92
|
+
for (let x = this.origin.x; x < this.origin.x + size.x; x++) {
|
|
93
|
+
for (let y = this.origin.y; y < this.origin.y + size.y; y++) {
|
|
94
|
+
for (let z = this.origin.z; z < this.origin.z + size.z; z++) {
|
|
101
95
|
if (!this.isSelected(x, y, z))
|
|
102
96
|
continue;
|
|
103
97
|
const voxel = cursor.getVoxel(x, y, z);
|
|
@@ -115,16 +109,16 @@ export class VoxelBFSSelection {
|
|
|
115
109
|
clone() {
|
|
116
110
|
const newSelection = new VoxelBFSSelection();
|
|
117
111
|
Vector3Like.Copy(newSelection.origin, this.origin);
|
|
118
|
-
Vector3Like.Copy(newSelection.size, this.size);
|
|
119
112
|
newSelection.bounds.setMinMax(this.bounds.min, this.bounds.max);
|
|
120
|
-
newSelection.bitIndex =
|
|
113
|
+
newSelection.bitIndex = this.bitIndex.slice();
|
|
121
114
|
newSelection.index.setBounds(...this.index.getBounds());
|
|
122
115
|
return newSelection;
|
|
123
116
|
}
|
|
124
117
|
toJSON() {
|
|
125
118
|
return {
|
|
119
|
+
type: "bfs",
|
|
126
120
|
origin: { ...this.origin },
|
|
127
|
-
|
|
121
|
+
bounds: { ...this.bounds.size },
|
|
128
122
|
bitIndex: this.bitIndex.slice(),
|
|
129
123
|
};
|
|
130
124
|
}
|
|
@@ -132,10 +126,12 @@ export class VoxelBFSSelection {
|
|
|
132
126
|
this.origin.x = data.origin.x;
|
|
133
127
|
this.origin.y = data.origin.y;
|
|
134
128
|
this.origin.z = data.origin.z;
|
|
135
|
-
this.size.x = data.size.x;
|
|
136
|
-
this.size.y = data.size.y;
|
|
137
|
-
this.size.z = data.size.z;
|
|
138
129
|
this.bitIndex = data.bitIndex;
|
|
139
|
-
this.
|
|
130
|
+
this.bounds.setMinMax(this.origin, {
|
|
131
|
+
x: this.origin.x + data.bounds.x,
|
|
132
|
+
y: this.origin.y + data.bounds.y,
|
|
133
|
+
z: this.origin.z + data.bounds.z,
|
|
134
|
+
});
|
|
135
|
+
this.index.setBounds(data.bounds.x, data.bounds.y, data.bounds.z);
|
|
140
136
|
}
|
|
141
137
|
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { IVoxelSelection } from "./
|
|
3
|
-
import {
|
|
2
|
+
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
|
+
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
4
4
|
import { IVoxelshapeTemplateBaseData } from "../Shapes/VoxelShapeTemplate.types";
|
|
5
5
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
6
6
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
|
-
export
|
|
7
|
+
export interface VoxelBoundsSelectionData extends IVoxelSelectionData<"bounds"> {
|
|
8
|
+
}
|
|
9
|
+
export declare class VoxelBoundsSelection implements IVoxelSelection<"bounds", VoxelBoundsSelectionData> {
|
|
8
10
|
origin: Vector3Like;
|
|
9
11
|
end: Vector3Like;
|
|
10
|
-
size: Vector3Like;
|
|
11
12
|
bounds: BoundingBox;
|
|
12
13
|
isSelected(x: number, y: number, z: number): boolean;
|
|
13
14
|
reConstruct(startPosition: Vector3Like, startNormal: Vector3Like, endPosition: Vector3Like, endNormal: Vector3Like, offset?: number): void;
|
|
14
|
-
clone():
|
|
15
|
-
toTemplate(data?: Partial<IVoxelshapeTemplateBaseData>):
|
|
15
|
+
clone(): VoxelBoundsSelection;
|
|
16
|
+
toTemplate(data?: Partial<IVoxelshapeTemplateBaseData>): VoxelShapeTemplate;
|
|
16
17
|
toExtrudedTemplate(cursor: DataCursorInterface, normal: Vector3Like): void;
|
|
18
|
+
toJSON(): VoxelBoundsSelectionData;
|
|
19
|
+
fromJSON(data: VoxelBoundsSelectionData): void;
|
|
17
20
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Vec3ArrayLike, Vector3Like } from "@amodx/math";
|
|
2
|
-
import {
|
|
2
|
+
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
3
|
+
import { BoxVoxelShapeSelection } from "../Shapes/Selections/BoxVoxelShapeSelection";
|
|
3
4
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
4
5
|
const getMinMax = (...points) => {
|
|
5
6
|
if (points.length === 0) {
|
|
@@ -22,17 +23,12 @@ const getMinMax = (...points) => {
|
|
|
22
23
|
const getSize = (start, end) => {
|
|
23
24
|
return Vector3Like.Create(end.x - start.x, end.y - start.y, end.z - start.z);
|
|
24
25
|
};
|
|
25
|
-
export class
|
|
26
|
+
export class VoxelBoundsSelection {
|
|
26
27
|
origin = Vector3Like.Create();
|
|
27
28
|
end = Vector3Like.Create();
|
|
28
|
-
size = Vector3Like.Create();
|
|
29
29
|
bounds = new BoundingBox();
|
|
30
30
|
isSelected(x, y, z) {
|
|
31
|
-
if (
|
|
32
|
-
return false;
|
|
33
|
-
if (y < this.origin.y || y >= this.end.y)
|
|
34
|
-
return false;
|
|
35
|
-
if (z < this.origin.z || z >= this.end.z)
|
|
31
|
+
if (!this.bounds.intersectsXYZ(x + 0.5, y + 0.5, z + 0.5))
|
|
36
32
|
return false;
|
|
37
33
|
return true;
|
|
38
34
|
}
|
|
@@ -78,9 +74,6 @@ export class VoxelBoxSelection {
|
|
|
78
74
|
this.end.x = startPosition.x + startNormal.x;
|
|
79
75
|
this.end.y = startPosition.y + startNormal.y;
|
|
80
76
|
this.end.z = startPosition.z + startNormal.z;
|
|
81
|
-
this.size.x = 1;
|
|
82
|
-
this.size.y = 1;
|
|
83
|
-
this.size.z = 1;
|
|
84
77
|
}
|
|
85
78
|
else {
|
|
86
79
|
this.origin.x = finalMin[0];
|
|
@@ -89,28 +82,42 @@ export class VoxelBoxSelection {
|
|
|
89
82
|
this.end.x = finalMax[0];
|
|
90
83
|
this.end.y = finalMax[1];
|
|
91
84
|
this.end.z = finalMax[2];
|
|
92
|
-
this.size.x = finalSize[0];
|
|
93
|
-
this.size.y = finalSize[1];
|
|
94
|
-
this.size.z = finalSize[2];
|
|
95
85
|
}
|
|
96
86
|
this.bounds.setMinMax(this.origin, this.end);
|
|
97
87
|
}
|
|
98
88
|
clone() {
|
|
99
|
-
const newSelection = new
|
|
89
|
+
const newSelection = new VoxelBoundsSelection();
|
|
100
90
|
Vector3Like.Copy(newSelection.origin, this.origin);
|
|
101
|
-
Vector3Like.Copy(newSelection.size, this.size);
|
|
102
91
|
Vector3Like.Copy(newSelection.end, this.end);
|
|
103
92
|
newSelection.bounds.setMinMax(this.bounds.min, this.bounds.max);
|
|
104
93
|
return newSelection;
|
|
105
94
|
}
|
|
106
95
|
toTemplate(data) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
96
|
+
return new VoxelShapeTemplate(VoxelShapeTemplate.CreateNew({
|
|
97
|
+
shapeSelection: BoxVoxelShapeSelection.CreateNew({
|
|
98
|
+
width: this.bounds.size.x,
|
|
99
|
+
height: this.bounds.size.y,
|
|
100
|
+
depth: this.bounds.size.z,
|
|
101
|
+
}),
|
|
111
102
|
...(data ? data : {}),
|
|
112
|
-
});
|
|
113
|
-
return new BoxVoxelTemplate(boxTemplate);
|
|
103
|
+
}));
|
|
114
104
|
}
|
|
115
105
|
toExtrudedTemplate(cursor, normal) { }
|
|
106
|
+
toJSON() {
|
|
107
|
+
return {
|
|
108
|
+
type: "bounds",
|
|
109
|
+
origin: { ...this.origin },
|
|
110
|
+
bounds: { ...this.bounds.size },
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
fromJSON(data) {
|
|
114
|
+
this.origin.x = data.origin.x;
|
|
115
|
+
this.origin.y = data.origin.y;
|
|
116
|
+
this.origin.z = data.origin.z;
|
|
117
|
+
this.bounds.setMinMax(this.origin, {
|
|
118
|
+
x: this.origin.x + data.bounds.x,
|
|
119
|
+
y: this.origin.y + data.bounds.y,
|
|
120
|
+
z: this.origin.z + data.bounds.z,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
116
123
|
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { IVoxelSelection } from "./
|
|
3
|
-
import {
|
|
2
|
+
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
|
+
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
4
4
|
import { IVoxelshapeTemplateBaseData } from "../Shapes/VoxelShapeTemplate.types";
|
|
5
5
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
6
6
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
|
-
export
|
|
7
|
+
export interface VoxelPointSelectionData extends IVoxelSelectionData<"point"> {
|
|
8
|
+
}
|
|
9
|
+
export declare class VoxelPointSelection implements IVoxelSelection<"point", VoxelPointSelectionData> {
|
|
8
10
|
origin: Vector3Like;
|
|
9
|
-
end: Vector3Like;
|
|
10
|
-
size: Vector3Like;
|
|
11
11
|
bounds: BoundingBox;
|
|
12
12
|
isSelected(x: number, y: number, z: number): boolean;
|
|
13
13
|
reConstruct(position: Vector3Like): void;
|
|
14
14
|
clone(): VoxelPointSelection;
|
|
15
|
-
toTemplate(data?: Partial<IVoxelshapeTemplateBaseData>):
|
|
15
|
+
toTemplate(data?: Partial<IVoxelshapeTemplateBaseData>): VoxelShapeTemplate;
|
|
16
16
|
toExtrudedTemplate(cursor: DataCursorInterface, normal: Vector3Like): void;
|
|
17
|
+
toJSON(): VoxelPointSelectionData;
|
|
18
|
+
fromJSON(data: any): void;
|
|
17
19
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import {
|
|
2
|
+
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
3
|
+
import { BoxVoxelShapeSelection } from "../Shapes/Selections/BoxVoxelShapeSelection";
|
|
3
4
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
4
5
|
export class VoxelPointSelection {
|
|
5
6
|
origin = Vector3Like.Create();
|
|
6
|
-
end = Vector3Like.Create();
|
|
7
|
-
size = Vector3Like.Create();
|
|
8
7
|
bounds = new BoundingBox();
|
|
9
8
|
isSelected(x, y, z) {
|
|
10
|
-
if (
|
|
11
|
-
return false;
|
|
12
|
-
if (y < this.origin.y || y >= this.end.y)
|
|
13
|
-
return false;
|
|
14
|
-
if (z < this.origin.z || z >= this.end.z)
|
|
9
|
+
if (!this.bounds.intersectsXYZ(x + 0.5, y + 0.5, z + 0.5))
|
|
15
10
|
return false;
|
|
16
11
|
return true;
|
|
17
12
|
}
|
|
@@ -19,30 +14,36 @@ export class VoxelPointSelection {
|
|
|
19
14
|
this.origin.x = position.x;
|
|
20
15
|
this.origin.y = position.y;
|
|
21
16
|
this.origin.z = position.z;
|
|
22
|
-
this.
|
|
23
|
-
this.end.y = this.origin.y + 1;
|
|
24
|
-
this.end.z = this.origin.z + 1;
|
|
25
|
-
this.size.x = 1;
|
|
26
|
-
this.size.y = 1;
|
|
27
|
-
this.size.z = 1;
|
|
28
|
-
this.bounds.setMinMax(this.origin, this.end);
|
|
17
|
+
this.bounds.setMinMax(this.origin, Vector3Like.AddScalar(this.origin, 1));
|
|
29
18
|
}
|
|
30
19
|
clone() {
|
|
31
20
|
const newSelection = new VoxelPointSelection();
|
|
32
21
|
Vector3Like.Copy(newSelection.origin, this.origin);
|
|
33
|
-
Vector3Like.Copy(newSelection.size, this.size);
|
|
34
|
-
Vector3Like.Copy(newSelection.end, this.end);
|
|
35
22
|
newSelection.bounds.setMinMax(this.bounds.min, this.bounds.max);
|
|
36
23
|
return newSelection;
|
|
37
24
|
}
|
|
38
25
|
toTemplate(data) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
...(data ? data : {}),
|
|
44
|
-
});
|
|
45
|
-
return new BoxVoxelTemplate(boxTemplate);
|
|
26
|
+
return new VoxelShapeTemplate(VoxelShapeTemplate.CreateNew({
|
|
27
|
+
shapeSelection: BoxVoxelShapeSelection.CreateNew({}),
|
|
28
|
+
...data,
|
|
29
|
+
}));
|
|
46
30
|
}
|
|
47
31
|
toExtrudedTemplate(cursor, normal) { }
|
|
32
|
+
toJSON() {
|
|
33
|
+
return {
|
|
34
|
+
type: "point",
|
|
35
|
+
origin: { ...this.origin },
|
|
36
|
+
bounds: { ...this.bounds.size },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
fromJSON(data) {
|
|
40
|
+
this.origin.x = data.origin.x;
|
|
41
|
+
this.origin.y = data.origin.y;
|
|
42
|
+
this.origin.z = data.origin.z;
|
|
43
|
+
this.bounds.setMinMax(this.origin, {
|
|
44
|
+
x: this.origin.x + data.bounds.x,
|
|
45
|
+
y: this.origin.y + data.bounds.y,
|
|
46
|
+
z: this.origin.z + data.bounds.z,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
48
49
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
3
|
+
export interface IVoxelSelection<Type extends string = "", Data extends IVoxelSelectionData<Type> = any> {
|
|
4
|
+
origin: Vector3Like;
|
|
5
|
+
bounds: BoundingBox;
|
|
6
|
+
isSelected(x: number, y: number, z: number): boolean;
|
|
7
|
+
clone(): IVoxelSelection;
|
|
8
|
+
toJSON(): Data;
|
|
9
|
+
fromJSON(data: Data): void;
|
|
10
|
+
}
|
|
11
|
+
export interface IVoxelSelectionData<Type extends string> {
|
|
12
|
+
type: Type;
|
|
13
|
+
origin: Vector3Like;
|
|
14
|
+
bounds: Vector3Like;
|
|
15
|
+
}
|
|
16
|
+
export interface IVoxelSelectionConstructor<Type extends string, Data extends IVoxelSelectionData<Type> = any> {
|
|
17
|
+
new (): IVoxelSelection<Type, Data>;
|
|
18
|
+
}
|
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
2
|
-
import { IVoxelSelection } from "./
|
|
2
|
+
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
4
|
import { PaintVoxelData } from "../../Voxels/Types/PaintVoxelData";
|
|
5
5
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
6
6
|
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
|
-
export interface VoxelSurfaceSelectionData {
|
|
8
|
-
origin: Vector3Like;
|
|
9
|
-
size: Vector3Like;
|
|
7
|
+
export interface VoxelSurfaceSelectionData extends IVoxelSelectionData<"surface"> {
|
|
10
8
|
normal: Vector3Like;
|
|
11
9
|
bitIndex: Uint8Array;
|
|
12
|
-
extrusion: number;
|
|
13
10
|
}
|
|
14
|
-
export declare class VoxelSurfaceSelection implements IVoxelSelection
|
|
11
|
+
export declare class VoxelSurfaceSelection implements IVoxelSelection<"surface"> {
|
|
15
12
|
origin: Vector3Like;
|
|
16
|
-
size: Vector3Like;
|
|
17
13
|
normal: Vector3Like;
|
|
18
14
|
bitIndex: Uint8Array;
|
|
19
15
|
index: Flat3DIndex;
|
|
20
16
|
bounds: BoundingBox;
|
|
21
|
-
extrusion: number;
|
|
22
17
|
isSelected(x: number, y: number, z: number): boolean;
|
|
23
|
-
reConstruct(cursor: DataCursorInterface, position: Vector3Like, normal: Vector3Like, extrusion: number, maxSize?: number):
|
|
18
|
+
reConstruct(cursor: DataCursorInterface, position: Vector3Like, normal: Vector3Like, extrusion: number, maxSize?: number): boolean;
|
|
24
19
|
clone(): VoxelSurfaceSelection;
|
|
25
|
-
toTemplate(
|
|
26
|
-
toTemplate(cursor: DataCursorInterface, extrude: true): FullVoxelTemplate;
|
|
27
|
-
toTemplate(cursor: DataCursorInterface, voxel: PaintVoxelData): FullVoxelTemplate;
|
|
20
|
+
toTemplate(voxel: PaintVoxelData): FullVoxelTemplate;
|
|
28
21
|
toJSON(): VoxelSurfaceSelectionData;
|
|
29
22
|
fromJSON(data: VoxelSurfaceSelectionData): void;
|
|
30
23
|
}
|