@divinevoxel/vlox 0.0.75 → 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/RayProvider.d.ts +6 -0
- package/Builder/Tools/Brush/BrushTool.d.ts +55 -0
- package/Builder/Tools/Brush/BrushTool.js +352 -0
- package/Builder/Tools/BuilderToolBase.d.ts +39 -0
- package/Builder/Tools/BuilderToolBase.js +42 -0
- package/Builder/Tools/Hand/HandTool.d.ts +24 -0
- package/Builder/Tools/Hand/HandTool.js +73 -0
- package/Builder/Tools/Path/PahtTool.d.ts +34 -0
- package/Builder/Tools/Path/PahtTool.js +128 -0
- 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 +30 -0
- package/Builder/Tools/Wand/WandTool.js +90 -0
- package/Builder/Tools/Wrench/WrenchTool.d.ts +47 -0
- package/Builder/Tools/Wrench/WrenchTool.js +184 -0
- 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/Util/SurfaceBoxSelection.js +25 -0
- package/Builder/VoxelBuildSpace.d.ts +73 -0
- package/Builder/VoxelBuildSpace.js +224 -0
- package/Builder/World/InitTasks.d.ts +1 -0
- package/Builder/World/InitTasks.js +129 -0
- package/Builder/World/VoxelBuildSpaceWorld.d.ts +4 -0
- package/Builder/World/VoxelBuildSpaceWorld.js +10 -0
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +5 -5
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +5 -5
- 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 +11 -7
- 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 +3 -3
- 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 +6 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +3 -3
- 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/EraseVoxel.js +1 -1
- 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/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 +6 -5
- package/Templates/Archive/ArchivedVoxelTemplate.js +56 -49
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +4 -4
- 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 +16 -3
- package/Templates/Cursor/TemplateProxy.d.ts +1 -0
- package/Templates/Cursor/TemplateProxy.js +9 -0
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
- package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
- package/Templates/Full/FullVoxelTemplate.d.ts +5 -4
- package/Templates/Full/FullVoxelTemplate.js +32 -17
- 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.d.ts +4 -0
- package/Templates/Path/VoxelPath.js +18 -0
- package/Templates/Path/VoxelPath.types.d.ts +1 -0
- package/Templates/Selection/VoxelBFSSelection.d.ts +6 -6
- package/Templates/Selection/VoxelBFSSelection.js +29 -22
- package/Templates/Selection/VoxelBoundsSelection.d.ts +20 -0
- package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +38 -20
- package/Templates/Selection/VoxelPointSelection.d.ts +19 -0
- package/Templates/Selection/VoxelPointSelection.js +49 -0
- package/Templates/Selection/VoxelSelection.d.ts +18 -0
- package/Templates/Selection/VoxelSelection.js +1 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +8 -12
- package/Templates/Selection/VoxelSurfaceSelection.js +88 -84
- package/Templates/Selection/VoxelTemplateSelection.d.ts +13 -4
- package/Templates/Selection/VoxelTemplateSelection.js +27 -9
- 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 +5 -12
- package/Templates/Shapes/VoxelShapeTemplate.types.js +5 -1
- package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
- package/Templates/VoxelTemplateRegister.js +60 -0
- package/Templates/VoxelTemplates.types.d.ts +3 -3
- package/Textures/Classes/CompiledTexture.d.ts +2 -0
- package/Textures/Classes/CompiledTexture.js +19 -1
- package/Textures/Classes/TextureAnimationTexture.d.ts +1 -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/Util/BinaryBuffer/Functions/BinaryBufferConvert.d.ts +1 -1
- package/Util/BinaryBuffer/Functions/BinaryBufferToTypedArray.d.ts +1 -1
- package/Util/LocationData.d.ts +1 -1
- package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +2 -0
- package/Voxels/Cursor/VoxelCursor.interface.js +2 -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 +21 -46
- package/Voxels/Interaction/VoxelPickResult.d.ts +1 -0
- package/Voxels/Interaction/VoxelPickResult.js +3 -0
- 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/State/Schema/BinarySchemaNode.d.ts +2 -1
- package/Voxels/State/Schema/BinarySchemaNode.js +5 -2
- package/Voxels/State/Schema/Conditions/SameVoxelConditions.js +2 -0
- package/Voxels/Types/PaintVoxelData.d.ts +13 -1
- package/Voxels/Types/PaintVoxelData.js +151 -14
- package/World/Archive/Functions/Shared/LightSegments.d.ts +1 -1
- 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/Sector.d.ts +1 -1
- 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 +4 -1
- 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/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/VoxelBoxSelection.d.ts +0 -14
- package/Templates/Selection/VoxelSelecton.d.ts +0 -6
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -35
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/BoxVoxelTemplate.js +0 -75
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/ConeVoxelTemplate.js +0 -69
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/CylinderVoxelTemplate.js +0 -69
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -69
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -30
- package/Templates/Shapes/PyramidVoxelTemplate.js +0 -140
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -24
- package/Templates/Shapes/SphereVoxelTemplate.js +0 -97
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/TorusVoxelTemplate.js +0 -69
- package/Templates/VoxelTempateRegister.js +0 -30
- /package/{Mesher/Models/Nodes/Types/GeomtryNode.types.js → Builder/RayProvider.js} +0 -0
- /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/{Templates/Selection/VoxelSelecton.js → Mesher/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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { VoxelPointSelection } from "../../../Templates/Selection/VoxelPointSelection";
|
|
2
|
+
import { BuilderToolBase } from "../BuilderToolBase";
|
|
3
|
+
import { VoxelPath, VoxelPathSegment } from "../../../Templates/Path/VoxelPath";
|
|
4
|
+
import { FreePointSelection } from "../../Util/FreePointSelection";
|
|
5
|
+
export var PathToolModes;
|
|
6
|
+
(function (PathToolModes) {
|
|
7
|
+
PathToolModes["PlacePoints"] = "Place Points";
|
|
8
|
+
PathToolModes["MovePoints"] = "Move Points";
|
|
9
|
+
PathToolModes["RemovePoints"] = "Remove Points";
|
|
10
|
+
PathToolModes["FillPath"] = "Fill Path";
|
|
11
|
+
PathToolModes["RemovePath"] = "Remvoe Path";
|
|
12
|
+
})(PathToolModes || (PathToolModes = {}));
|
|
13
|
+
export class PathTool extends BuilderToolBase {
|
|
14
|
+
static ToolId = "Path";
|
|
15
|
+
static ModeArray = [
|
|
16
|
+
PathToolModes.PlacePoints,
|
|
17
|
+
PathToolModes.MovePoints,
|
|
18
|
+
PathToolModes.RemovePoints,
|
|
19
|
+
PathToolModes.FillPath,
|
|
20
|
+
PathToolModes.RemovePath,
|
|
21
|
+
];
|
|
22
|
+
mode = PathToolModes.PlacePoints;
|
|
23
|
+
selection = new VoxelPointSelection();
|
|
24
|
+
pointSelection = new FreePointSelection(this.space, this.selection);
|
|
25
|
+
path = new VoxelPath(VoxelPath.CreateNew({}));
|
|
26
|
+
get distance() {
|
|
27
|
+
return this.pointSelection.distance;
|
|
28
|
+
}
|
|
29
|
+
set distance(value) {
|
|
30
|
+
this.pointSelection.distance = value;
|
|
31
|
+
}
|
|
32
|
+
voxelData;
|
|
33
|
+
_placedSegment = false;
|
|
34
|
+
setMode(mode) {
|
|
35
|
+
const lastMode = this.mode;
|
|
36
|
+
this.mode = mode;
|
|
37
|
+
if (lastMode == PathToolModes.PlacePoints) {
|
|
38
|
+
for (const segment of this.path.segments) {
|
|
39
|
+
if (segment.transient) {
|
|
40
|
+
this.path.removeSegment(segment);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (mode == PathToolModes.PlacePoints && this.path.segments.length) {
|
|
45
|
+
const point = this.path.lastSegment().getPoint(1);
|
|
46
|
+
this._placedSegment = false;
|
|
47
|
+
this.path.addSegment(VoxelPathSegment.CreateNew({
|
|
48
|
+
transient: true,
|
|
49
|
+
start: [...point],
|
|
50
|
+
end: [
|
|
51
|
+
this.selection.origin.x,
|
|
52
|
+
this.selection.origin.y,
|
|
53
|
+
this.selection.origin.z,
|
|
54
|
+
],
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
cancel() {
|
|
59
|
+
this._lastPicked = null;
|
|
60
|
+
}
|
|
61
|
+
async update() {
|
|
62
|
+
if (this.mode == PathToolModes.PlacePoints) {
|
|
63
|
+
const updated = this.pointSelection.update();
|
|
64
|
+
if (!updated)
|
|
65
|
+
return;
|
|
66
|
+
const last = this.path.lastSegment();
|
|
67
|
+
if (last) {
|
|
68
|
+
last.setPoints(last.start, [
|
|
69
|
+
this.selection.origin.x,
|
|
70
|
+
this.selection.origin.y,
|
|
71
|
+
this.selection.origin.z,
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async use() {
|
|
78
|
+
if (this.mode == PathToolModes.PlacePoints) {
|
|
79
|
+
this._placedSegment = true;
|
|
80
|
+
if (!this.path.totalSegments) {
|
|
81
|
+
this.path.addSegment(VoxelPathSegment.CreateNew({
|
|
82
|
+
transient: true,
|
|
83
|
+
start: [
|
|
84
|
+
this.selection.origin.x,
|
|
85
|
+
this.selection.origin.y,
|
|
86
|
+
this.selection.origin.z,
|
|
87
|
+
],
|
|
88
|
+
end: [
|
|
89
|
+
this.selection.origin.x,
|
|
90
|
+
this.selection.origin.y,
|
|
91
|
+
this.selection.origin.z,
|
|
92
|
+
],
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
const lastSegment = this.path.lastSegment();
|
|
97
|
+
lastSegment.transient = false;
|
|
98
|
+
this.path.addSegment(VoxelPathSegment.CreateNew({
|
|
99
|
+
transient: true,
|
|
100
|
+
start: [...lastSegment.end],
|
|
101
|
+
end: [
|
|
102
|
+
this.selection.origin.x,
|
|
103
|
+
this.selection.origin.y,
|
|
104
|
+
this.selection.origin.z,
|
|
105
|
+
],
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (this.mode == PathToolModes.FillPath) {
|
|
110
|
+
for (const segment of this.path.segments) {
|
|
111
|
+
segment.voxel = this.voxelData;
|
|
112
|
+
}
|
|
113
|
+
await this.space.paintPath([0, 0, 0], this.path.toJSON());
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (this.mode == PathToolModes.RemovePath) {
|
|
117
|
+
await this.space.erasePath([0, 0, 0], this.path.toJSON());
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
getOptionValue(id) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
getCurrentOptions() {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
updateOption(property, value) { }
|
|
128
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VoxelBuildSpace } from "../../VoxelBuildSpace";
|
|
2
|
+
import { PaintVoxelData } from "../../../Voxels";
|
|
3
|
+
import { VoxelBoundsSelection } from "../../../Templates/Selection/VoxelBoundsSelection";
|
|
4
|
+
import { Vector3Like } from "@amodx/math";
|
|
5
|
+
import { SurfaceBoxSelection } from "../../Util/SurfaceBoxSelection";
|
|
6
|
+
import { BuilderToolBase, ToolOptionsData } from "../BuilderToolBase";
|
|
7
|
+
export declare enum SculptToolModes {
|
|
8
|
+
Fill = "Fill",
|
|
9
|
+
Extrude = "Extrude",
|
|
10
|
+
Remove = "Remove"
|
|
11
|
+
}
|
|
12
|
+
interface SculptToolEvents {
|
|
13
|
+
}
|
|
14
|
+
export declare class SculptTool extends BuilderToolBase<SculptToolEvents> {
|
|
15
|
+
static ToolId: string;
|
|
16
|
+
static ModeArray: SculptToolModes[];
|
|
17
|
+
mode: SculptToolModes;
|
|
18
|
+
selection: VoxelBoundsSelection;
|
|
19
|
+
boxSelection: SurfaceBoxSelection;
|
|
20
|
+
voxelData: PaintVoxelData;
|
|
21
|
+
usePlacingStrategy: boolean;
|
|
22
|
+
constructor(space: VoxelBuildSpace);
|
|
23
|
+
cancel(): void;
|
|
24
|
+
private _started;
|
|
25
|
+
isSelectionStarted(): boolean;
|
|
26
|
+
updateOffset(offset: number): void;
|
|
27
|
+
_normal: Vector3Like;
|
|
28
|
+
update(placerMode?: "start" | "end" | null): Promise<void>;
|
|
29
|
+
use(): Promise<void>;
|
|
30
|
+
getOptionValue(id: string): null;
|
|
31
|
+
getCurrentOptions(): ToolOptionsData;
|
|
32
|
+
updateOption(property: string, value: any): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { VoxelBoundsSelection } from "../../../Templates/Selection/VoxelBoundsSelection";
|
|
2
|
+
import { Vector3Like } from "@amodx/math";
|
|
3
|
+
import { SurfaceBoxSelection } from "../../Util/SurfaceBoxSelection";
|
|
4
|
+
import { BuilderToolBase } from "../BuilderToolBase";
|
|
5
|
+
export var SculptToolModes;
|
|
6
|
+
(function (SculptToolModes) {
|
|
7
|
+
SculptToolModes["Fill"] = "Fill";
|
|
8
|
+
SculptToolModes["Extrude"] = "Extrude";
|
|
9
|
+
SculptToolModes["Remove"] = "Remove";
|
|
10
|
+
})(SculptToolModes || (SculptToolModes = {}));
|
|
11
|
+
export class SculptTool extends BuilderToolBase {
|
|
12
|
+
static ToolId = "Sculpt";
|
|
13
|
+
static ModeArray = [
|
|
14
|
+
SculptToolModes.Fill,
|
|
15
|
+
SculptToolModes.Extrude,
|
|
16
|
+
SculptToolModes.Remove,
|
|
17
|
+
];
|
|
18
|
+
mode = SculptToolModes.Fill;
|
|
19
|
+
selection = new VoxelBoundsSelection();
|
|
20
|
+
boxSelection;
|
|
21
|
+
voxelData;
|
|
22
|
+
usePlacingStrategy = true;
|
|
23
|
+
constructor(space) {
|
|
24
|
+
super(space);
|
|
25
|
+
this.boxSelection = new SurfaceBoxSelection(this.space, this.selection);
|
|
26
|
+
}
|
|
27
|
+
cancel() {
|
|
28
|
+
this._started = false;
|
|
29
|
+
}
|
|
30
|
+
_started = false;
|
|
31
|
+
isSelectionStarted() {
|
|
32
|
+
return this._started;
|
|
33
|
+
}
|
|
34
|
+
updateOffset(offset) {
|
|
35
|
+
this.boxSelection.offset = offset;
|
|
36
|
+
this.boxSelection.update();
|
|
37
|
+
}
|
|
38
|
+
_normal;
|
|
39
|
+
async update(placerMode = null) {
|
|
40
|
+
const picked = this.isSelectionStarted()
|
|
41
|
+
? null
|
|
42
|
+
: await this.space.pickWithProvider(this.rayProviderIndex);
|
|
43
|
+
this._lastPicked = picked;
|
|
44
|
+
if (!this._started && !placerMode && picked) {
|
|
45
|
+
if (this.mode == SculptToolModes.Fill ||
|
|
46
|
+
this.mode == SculptToolModes.Extrude) {
|
|
47
|
+
this.selection.reConstruct(picked.normalPosition, picked.normal, Vector3Like.Add(picked.normalPosition, Vector3Like.Create(1, 1, 1)), picked.normal);
|
|
48
|
+
}
|
|
49
|
+
if (this.mode == SculptToolModes.Remove) {
|
|
50
|
+
this.selection.reConstruct(picked.position, picked.normal, Vector3Like.Add(picked.position, Vector3Like.Create(1, 1, 1)), picked.normal);
|
|
51
|
+
}
|
|
52
|
+
this._normal = { ...picked.normal };
|
|
53
|
+
}
|
|
54
|
+
if (!this._started && placerMode == "start" && picked) {
|
|
55
|
+
this.boxSelection.offset = 0;
|
|
56
|
+
Vector3Like.Copy(this.boxSelection.planeNormal, picked.normal);
|
|
57
|
+
if (this.mode == SculptToolModes.Fill ||
|
|
58
|
+
this.mode == SculptToolModes.Extrude) {
|
|
59
|
+
Vector3Like.Copy(this.boxSelection.planeOrigin, picked.normalPosition);
|
|
60
|
+
}
|
|
61
|
+
if (this.mode == SculptToolModes.Remove) {
|
|
62
|
+
Vector3Like.Copy(this.boxSelection.planeOrigin, picked.position);
|
|
63
|
+
}
|
|
64
|
+
this.boxSelection.update();
|
|
65
|
+
this._started = true;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (this._started && !placerMode && !picked) {
|
|
69
|
+
this.boxSelection.update();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (this._started && placerMode == "end") {
|
|
73
|
+
this.boxSelection.update();
|
|
74
|
+
this._started = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async use() {
|
|
78
|
+
if (this.mode == SculptToolModes.Fill) {
|
|
79
|
+
await this.space.paintTemplate(Vector3Like.ToArray(this.selection.origin), this.selection
|
|
80
|
+
.toTemplate({
|
|
81
|
+
fillVoxel: this.voxelData,
|
|
82
|
+
})
|
|
83
|
+
.toJSON());
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (this.mode == SculptToolModes.Extrude) {
|
|
87
|
+
const template = await this.space.getExtrudedSelectionTemplate(this.selection.toJSON(), this._normal);
|
|
88
|
+
await this.space.paintTemplate(this.selection.origin, template.toJSON());
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (this.mode == SculptToolModes.Remove) {
|
|
92
|
+
await this.space.eraseTemplate(Vector3Like.ToArray(this.selection.origin), this.selection.toTemplate({}).toJSON());
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
getOptionValue(id) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
getCurrentOptions() {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
updateOption(property, value) { }
|
|
102
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PaintVoxelData } from "../../../Voxels";
|
|
2
|
+
import { BuilderToolBase, ToolOptionsData } from "../BuilderToolBase";
|
|
3
|
+
import { VoxelPointSelection } from "../../../Templates/Selection/VoxelPointSelection";
|
|
4
|
+
import { FreePointSelection } from "../../Util/FreePointSelection";
|
|
5
|
+
import { FreeBoxSelection } from "../../Util/FreeBoxSelection";
|
|
6
|
+
export declare enum ShapeToolModes {
|
|
7
|
+
Fill = "Fill",
|
|
8
|
+
Remove = "Remove"
|
|
9
|
+
}
|
|
10
|
+
interface BoxToolEvents {
|
|
11
|
+
}
|
|
12
|
+
export declare class ShapeTool extends BuilderToolBase<BoxToolEvents> {
|
|
13
|
+
static ToolId: string;
|
|
14
|
+
static ModeArray: ShapeToolModes[];
|
|
15
|
+
mode: ShapeToolModes;
|
|
16
|
+
selection: VoxelPointSelection;
|
|
17
|
+
pointSelection: FreePointSelection;
|
|
18
|
+
boxSelection: FreeBoxSelection | null;
|
|
19
|
+
voxelData: PaintVoxelData;
|
|
20
|
+
usePlacingStrategy: boolean;
|
|
21
|
+
get distance(): number;
|
|
22
|
+
set distance(distance: number);
|
|
23
|
+
private _started;
|
|
24
|
+
isSelectionStarted(): boolean;
|
|
25
|
+
cancel(): void;
|
|
26
|
+
update(placerMode?: "start" | "end" | null): Promise<void>;
|
|
27
|
+
use(): Promise<void>;
|
|
28
|
+
getOptionValue(id: string): null;
|
|
29
|
+
getCurrentOptions(): ToolOptionsData;
|
|
30
|
+
updateOption(property: string, value: any): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { BuilderToolBase } from "../BuilderToolBase";
|
|
3
|
+
import { VoxelPointSelection } from "../../../Templates/Selection/VoxelPointSelection";
|
|
4
|
+
import { FreePointSelection } from "../../Util/FreePointSelection";
|
|
5
|
+
import { FreeBoxSelection } from "../../Util/FreeBoxSelection";
|
|
6
|
+
export var ShapeToolModes;
|
|
7
|
+
(function (ShapeToolModes) {
|
|
8
|
+
ShapeToolModes["Fill"] = "Fill";
|
|
9
|
+
ShapeToolModes["Remove"] = "Remove";
|
|
10
|
+
})(ShapeToolModes || (ShapeToolModes = {}));
|
|
11
|
+
export class ShapeTool extends BuilderToolBase {
|
|
12
|
+
static ToolId = "Shape";
|
|
13
|
+
static ModeArray = [
|
|
14
|
+
ShapeToolModes.Fill,
|
|
15
|
+
ShapeToolModes.Remove,
|
|
16
|
+
];
|
|
17
|
+
mode = ShapeToolModes.Fill;
|
|
18
|
+
selection = new VoxelPointSelection();
|
|
19
|
+
pointSelection = new FreePointSelection(this.space, this.selection);
|
|
20
|
+
boxSelection = null;
|
|
21
|
+
voxelData;
|
|
22
|
+
usePlacingStrategy = true;
|
|
23
|
+
get distance() {
|
|
24
|
+
return this.pointSelection.distance;
|
|
25
|
+
}
|
|
26
|
+
set distance(distance) {
|
|
27
|
+
if (this.boxSelection)
|
|
28
|
+
this.pointSelection.distance = distance;
|
|
29
|
+
}
|
|
30
|
+
_started = false;
|
|
31
|
+
isSelectionStarted() {
|
|
32
|
+
return this._started;
|
|
33
|
+
}
|
|
34
|
+
cancel() {
|
|
35
|
+
this._started = false;
|
|
36
|
+
this.boxSelection = null;
|
|
37
|
+
}
|
|
38
|
+
async update(placerMode = null) {
|
|
39
|
+
if (this.boxSelection) {
|
|
40
|
+
this.boxSelection.update();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.pointSelection.update();
|
|
44
|
+
}
|
|
45
|
+
if (placerMode == "start") {
|
|
46
|
+
this._started = true;
|
|
47
|
+
this.boxSelection = new FreeBoxSelection(this.space, this.pointSelection);
|
|
48
|
+
}
|
|
49
|
+
if (placerMode == "end") {
|
|
50
|
+
this._started = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async use() {
|
|
54
|
+
if (!this.boxSelection)
|
|
55
|
+
return;
|
|
56
|
+
if (this.mode == ShapeToolModes.Fill) {
|
|
57
|
+
await this.space.paintTemplate(Vector3Like.ToArray(this.boxSelection.selection.origin), this.boxSelection.selection
|
|
58
|
+
.toTemplate({
|
|
59
|
+
fillVoxel: this.voxelData,
|
|
60
|
+
})
|
|
61
|
+
.toJSON());
|
|
62
|
+
this.boxSelection = null;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (this.mode == ShapeToolModes.Remove) {
|
|
66
|
+
await this.space.eraseTemplate(Vector3Like.ToArray(this.boxSelection.selection.origin), this.boxSelection.selection.toTemplate({}).toJSON());
|
|
67
|
+
this.boxSelection = null;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
getOptionValue(id) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
getCurrentOptions() {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
updateOption(property, value) { }
|
|
78
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BuilderToolBase, ToolOptionsData } from "../BuilderToolBase";
|
|
2
|
+
import { VoxelBoundsSelection } from "../../../Templates/Selection/VoxelBoundsSelection";
|
|
3
|
+
import { FreeBoxSelection } from "../../Util/FreeBoxSelection";
|
|
4
|
+
import { FullVoxelTemplate } from "../../../Templates/Full/FullVoxelTemplate";
|
|
5
|
+
import { VoxelPointSelection } from "../../../Templates/Selection/VoxelPointSelection";
|
|
6
|
+
import { FreePointSelection } from "../../Util/FreePointSelection";
|
|
7
|
+
export declare enum TemplateToolModes {
|
|
8
|
+
Select = "Select",
|
|
9
|
+
Place = "Place",
|
|
10
|
+
Remove = "Remove"
|
|
11
|
+
}
|
|
12
|
+
interface TemplateToolEvents {
|
|
13
|
+
"selection-created": VoxelBoundsSelection;
|
|
14
|
+
}
|
|
15
|
+
export declare class TemplateTool extends BuilderToolBase<TemplateToolEvents> {
|
|
16
|
+
static ToolId: string;
|
|
17
|
+
static ModeArray: TemplateToolModes[];
|
|
18
|
+
mode: TemplateToolModes;
|
|
19
|
+
selection: VoxelPointSelection;
|
|
20
|
+
pointSelection: FreePointSelection;
|
|
21
|
+
boxSelection: FreeBoxSelection | null;
|
|
22
|
+
usePlacingStrategy: boolean;
|
|
23
|
+
get distance(): number;
|
|
24
|
+
set distance(distance: number);
|
|
25
|
+
private _started;
|
|
26
|
+
selectionToTemplate(selection: VoxelBoundsSelection): Promise<FullVoxelTemplate>;
|
|
27
|
+
isSelectionStarted(): boolean;
|
|
28
|
+
update(placerMode?: "start" | "end" | null): Promise<void>;
|
|
29
|
+
cancel(): void;
|
|
30
|
+
use(): Promise<void>;
|
|
31
|
+
getOptionValue(id: string): null;
|
|
32
|
+
getCurrentOptions(): ToolOptionsData;
|
|
33
|
+
updateOption(property: string, value: any): void;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BuilderToolBase } from "../BuilderToolBase";
|
|
2
|
+
import { FreeBoxSelection } from "../../Util/FreeBoxSelection";
|
|
3
|
+
import { VoxelPointSelection } from "../../../Templates/Selection/VoxelPointSelection";
|
|
4
|
+
import { FreePointSelection } from "../../Util/FreePointSelection";
|
|
5
|
+
export var TemplateToolModes;
|
|
6
|
+
(function (TemplateToolModes) {
|
|
7
|
+
TemplateToolModes["Select"] = "Select";
|
|
8
|
+
TemplateToolModes["Place"] = "Place";
|
|
9
|
+
TemplateToolModes["Remove"] = "Remove";
|
|
10
|
+
})(TemplateToolModes || (TemplateToolModes = {}));
|
|
11
|
+
export class TemplateTool extends BuilderToolBase {
|
|
12
|
+
static ToolId = "Template";
|
|
13
|
+
static ModeArray = [
|
|
14
|
+
TemplateToolModes.Select,
|
|
15
|
+
TemplateToolModes.Place,
|
|
16
|
+
TemplateToolModes.Remove,
|
|
17
|
+
];
|
|
18
|
+
mode = TemplateToolModes.Select;
|
|
19
|
+
selection = new VoxelPointSelection();
|
|
20
|
+
pointSelection = new FreePointSelection(this.space, this.selection);
|
|
21
|
+
boxSelection = null;
|
|
22
|
+
usePlacingStrategy = true;
|
|
23
|
+
get distance() {
|
|
24
|
+
return this.pointSelection.distance;
|
|
25
|
+
}
|
|
26
|
+
set distance(distance) {
|
|
27
|
+
if (this.boxSelection)
|
|
28
|
+
this.pointSelection.distance = distance;
|
|
29
|
+
}
|
|
30
|
+
_started = false;
|
|
31
|
+
async selectionToTemplate(selection) {
|
|
32
|
+
const bounds = selection.bounds.getMinMax();
|
|
33
|
+
return await this.space.createTemplate(bounds);
|
|
34
|
+
}
|
|
35
|
+
isSelectionStarted() {
|
|
36
|
+
return this._started;
|
|
37
|
+
}
|
|
38
|
+
async update(placerMode = null) {
|
|
39
|
+
if (this.boxSelection) {
|
|
40
|
+
this.boxSelection.update();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.pointSelection.update();
|
|
44
|
+
}
|
|
45
|
+
if (placerMode == "start") {
|
|
46
|
+
this._started = true;
|
|
47
|
+
this.boxSelection = new FreeBoxSelection(this.space, this.pointSelection);
|
|
48
|
+
}
|
|
49
|
+
if (placerMode == "end") {
|
|
50
|
+
this._started = false;
|
|
51
|
+
this.boxSelection = null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
cancel() {
|
|
55
|
+
this._started = false;
|
|
56
|
+
this._lastPicked = null;
|
|
57
|
+
this.boxSelection = null;
|
|
58
|
+
}
|
|
59
|
+
async use() {
|
|
60
|
+
if (!this.boxSelection)
|
|
61
|
+
return;
|
|
62
|
+
if (this.mode == TemplateToolModes.Select) {
|
|
63
|
+
this.dispatch("selection-created", this.boxSelection.selection);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getOptionValue(id) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
getCurrentOptions() {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
updateOption(property, value) { }
|
|
73
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PaintVoxelData } from "../../../Voxels/Types/PaintVoxelData";
|
|
2
|
+
import { VoxelSurfaceSelection } from "../../../Templates/Selection/VoxelSurfaceSelection";
|
|
3
|
+
import { VoxelBFSSelection } from "../../../Templates/Selection/VoxelBFSSelection";
|
|
4
|
+
import { BuilderToolBase, ToolOptionsData } from "../BuilderToolBase";
|
|
5
|
+
export declare enum WandToolModes {
|
|
6
|
+
Place = "Place",
|
|
7
|
+
Extrude = "Extrude",
|
|
8
|
+
Remove = "Remove"
|
|
9
|
+
}
|
|
10
|
+
interface WandToolEvents {
|
|
11
|
+
}
|
|
12
|
+
export declare class WandTool extends BuilderToolBase<WandToolEvents> {
|
|
13
|
+
static ToolId: string;
|
|
14
|
+
static ModeArray: WandToolModes[];
|
|
15
|
+
mode: WandToolModes;
|
|
16
|
+
maxCount: number;
|
|
17
|
+
extrusion: number;
|
|
18
|
+
get selection(): VoxelSurfaceSelection | VoxelBFSSelection;
|
|
19
|
+
surfaceSelection: VoxelSurfaceSelection;
|
|
20
|
+
bfsSelection: VoxelBFSSelection;
|
|
21
|
+
voxelData: PaintVoxelData;
|
|
22
|
+
usePlacingStrategy: boolean;
|
|
23
|
+
update(): Promise<void>;
|
|
24
|
+
cancel(): void;
|
|
25
|
+
use(): Promise<void>;
|
|
26
|
+
getOptionValue(id: string): null;
|
|
27
|
+
getCurrentOptions(): ToolOptionsData;
|
|
28
|
+
updateOption(property: string, value: any): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { VoxelSurfaceSelection } from "../../../Templates/Selection/VoxelSurfaceSelection";
|
|
2
|
+
import { VoxelBFSSelection } from "../../../Templates/Selection/VoxelBFSSelection";
|
|
3
|
+
import { BuilderToolBase } from "../BuilderToolBase";
|
|
4
|
+
export var WandToolModes;
|
|
5
|
+
(function (WandToolModes) {
|
|
6
|
+
WandToolModes["Place"] = "Place";
|
|
7
|
+
WandToolModes["Extrude"] = "Extrude";
|
|
8
|
+
WandToolModes["Remove"] = "Remove";
|
|
9
|
+
})(WandToolModes || (WandToolModes = {}));
|
|
10
|
+
export class WandTool extends BuilderToolBase {
|
|
11
|
+
static ToolId = "Wand";
|
|
12
|
+
static ModeArray = [
|
|
13
|
+
WandToolModes.Place,
|
|
14
|
+
WandToolModes.Extrude,
|
|
15
|
+
WandToolModes.Remove,
|
|
16
|
+
];
|
|
17
|
+
mode = WandToolModes.Place;
|
|
18
|
+
maxCount = 1000;
|
|
19
|
+
extrusion = 0;
|
|
20
|
+
get selection() {
|
|
21
|
+
if (this.mode == WandToolModes.Place ||
|
|
22
|
+
this.mode == WandToolModes.Extrude) {
|
|
23
|
+
return this.surfaceSelection;
|
|
24
|
+
}
|
|
25
|
+
return this.bfsSelection;
|
|
26
|
+
}
|
|
27
|
+
surfaceSelection = new VoxelSurfaceSelection();
|
|
28
|
+
bfsSelection = new VoxelBFSSelection();
|
|
29
|
+
voxelData;
|
|
30
|
+
usePlacingStrategy = true;
|
|
31
|
+
async update() {
|
|
32
|
+
this._lastPicked = await this.space.pickWithProvider(this.rayProviderIndex);
|
|
33
|
+
if (!this._lastPicked)
|
|
34
|
+
return;
|
|
35
|
+
if (this.mode == WandToolModes.Place ||
|
|
36
|
+
this.mode == WandToolModes.Extrude) {
|
|
37
|
+
if (!this.space.bounds.intersectsPoint(this._lastPicked.normalPosition)) {
|
|
38
|
+
this._lastPicked = null;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.surfaceSelection.fromJSON(await this.space.getSurfaceSelection(this._lastPicked.position, this._lastPicked.normal, this.extrusion, this.maxCount));
|
|
42
|
+
}
|
|
43
|
+
if (this.mode == WandToolModes.Remove) {
|
|
44
|
+
if (!this.space.bounds.intersectsPoint(this._lastPicked.position)) {
|
|
45
|
+
this._lastPicked = null;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.bfsSelection.fromJSON(await this.space.getBFSSelection(this._lastPicked.position, this.maxCount));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
cancel() {
|
|
52
|
+
this._lastPicked = null;
|
|
53
|
+
}
|
|
54
|
+
async use() {
|
|
55
|
+
const picked = this._lastPicked;
|
|
56
|
+
if (!picked)
|
|
57
|
+
return;
|
|
58
|
+
let voxelData = this.voxelData;
|
|
59
|
+
if (this.mode == WandToolModes.Place) {
|
|
60
|
+
if (!this.space.bounds.intersectsPoint(picked.normalPosition))
|
|
61
|
+
return;
|
|
62
|
+
if (this.usePlacingStrategy) {
|
|
63
|
+
const newData = this.space.getPlaceState(voxelData, picked);
|
|
64
|
+
if (newData)
|
|
65
|
+
voxelData = newData;
|
|
66
|
+
}
|
|
67
|
+
this.surfaceSelection.fromJSON(await this.space.getSurfaceSelection(picked.position, picked.normal, this.extrusion, this.maxCount));
|
|
68
|
+
await this.space.paintTemplate(this.surfaceSelection.origin, this.surfaceSelection.toTemplate(voxelData).toJSON());
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (this.mode == WandToolModes.Extrude) {
|
|
72
|
+
this.surfaceSelection.fromJSON(await this.space.getSurfaceSelection(picked.position, picked.normal, this.extrusion, this.maxCount));
|
|
73
|
+
const template = await this.space.getExtrudedSelectionTemplate(this.surfaceSelection.toJSON(), picked.normal);
|
|
74
|
+
await this.space.paintTemplate(this.surfaceSelection.origin, template.toJSON());
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (this.mode == WandToolModes.Remove) {
|
|
78
|
+
const selection = await this.space.getBFSSelection(picked.position, this.maxCount);
|
|
79
|
+
await this.space.eraseSelection(selection);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
getOptionValue(id) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
getCurrentOptions() {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
updateOption(property, value) { }
|
|
90
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PaintVoxelData } from "../../../Voxels";
|
|
2
|
+
import { VoxelPointSelection } from "../../../Templates/Selection/VoxelPointSelection";
|
|
3
|
+
import { BuilderToolBase, ToolOptionsData } from "../BuilderToolBase";
|
|
4
|
+
interface WrenchToolEvents {
|
|
5
|
+
picked: {};
|
|
6
|
+
}
|
|
7
|
+
export type WrenchToolVoxelScehmaNodes = {
|
|
8
|
+
type: "string";
|
|
9
|
+
values: string[];
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: "number";
|
|
15
|
+
min: number;
|
|
16
|
+
max: number;
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
value: number;
|
|
20
|
+
};
|
|
21
|
+
type WrenchToolSchemas = {
|
|
22
|
+
stateSchema: WrenchToolVoxelScehmaNodes[];
|
|
23
|
+
modSchema: WrenchToolVoxelScehmaNodes[];
|
|
24
|
+
};
|
|
25
|
+
export declare class WrenchTool extends BuilderToolBase<WrenchToolEvents> {
|
|
26
|
+
static ToolId: string;
|
|
27
|
+
private mode;
|
|
28
|
+
selection: VoxelPointSelection;
|
|
29
|
+
paintData: PaintVoxelData;
|
|
30
|
+
private _pickedResult;
|
|
31
|
+
isUpdating(): boolean;
|
|
32
|
+
stopUpdating(): void;
|
|
33
|
+
update(): Promise<void>;
|
|
34
|
+
private processSchema;
|
|
35
|
+
updatePickedSchema(schema: WrenchToolSchemas): PaintVoxelData | undefined;
|
|
36
|
+
getPickedSchema(): WrenchToolSchemas | null;
|
|
37
|
+
/**Get an array of all possible state varations for the current mod of the selected voxel. */
|
|
38
|
+
getStateValues(): PaintVoxelData[] | null;
|
|
39
|
+
/**Get an array of all possible mod varations for the current state of the selected voxel. */
|
|
40
|
+
getModValues(): PaintVoxelData[] | null;
|
|
41
|
+
cancel(): void;
|
|
42
|
+
use(): Promise<void>;
|
|
43
|
+
getOptionValue(id: string): null;
|
|
44
|
+
getCurrentOptions(): ToolOptionsData;
|
|
45
|
+
updateOption(property: string, value: any): void;
|
|
46
|
+
}
|
|
47
|
+
export {};
|