@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
package/Voxels/InitVoxelData.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, candlesModel, carpetGeometry, carpetModel, chainGeometry, chainModel, fence, fenceEastWest, fenceNorthsouth, fencePost, leverGeometry, leverModel, } from "./Models/Defaults/Examples";
|
|
2
2
|
import { cube, halfDownCube, eighthCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, halfSouthCube, halfWestCube, } from "./Models/Defaults/CubeVoxelGeometry";
|
|
3
3
|
import { orientedCube, pillarCube, simpleCube, simpleNoCulledCube, simpleHalfCube, simpleTransparentCube, } from "./Models/Defaults/CubeVoxelModels";
|
|
4
|
-
import { diagonalFlatPanelEastWest, diagonalFlatPanelWestEast,
|
|
4
|
+
import { diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, thinPanel, } from "./Models/Defaults/PanelVoxelGeometry";
|
|
5
5
|
import { stair } from "./Models/Defaults/StairVoxelModel";
|
|
6
6
|
import { liquidGeometry, liquidModel, } from "./Models/Defaults/LiquidVoxelModel";
|
|
7
7
|
import { VoxelModelRuleBuilderRegister } from "./Models/Rules/VoxelModelRuleBuilderRegister";
|
|
8
8
|
import { BuildStateData } from "./Functions/BuildStateData";
|
|
9
9
|
import { BuildFinalInputs } from "./Models/Rules/Functions/BuildFinalInputs";
|
|
10
10
|
import { SchemaRegister } from "../Voxels/State/SchemaRegister";
|
|
11
|
-
import { simpleCrossedPannel, simpleThinPannel, } from "./Models/Defaults/PanelVoxelModels";
|
|
11
|
+
import { simpleCrossedPannel, simpleThinPannel, simpleTransparentThinPannel, } from "./Models/Defaults/PanelVoxelModels";
|
|
12
12
|
import { VoxelIndex } from "../Voxels/Indexes/VoxelIndex";
|
|
13
13
|
import { CacheManager } from "../Cache/CacheManager";
|
|
14
14
|
import { VoxelLightData } from "./Cursor/VoxelLightData";
|
|
@@ -21,8 +21,8 @@ import { BuildRules } from "./Models/Rules/Functions/BuildRules";
|
|
|
21
21
|
import { VoxelTagsRegister } from "./Data/VoxelTagsRegister";
|
|
22
22
|
import { farmGeomtry, farmModels } from "./Models/Defaults/FarmVoxelModels";
|
|
23
23
|
function RegisterModels(data) {
|
|
24
|
-
VoxelModelRuleBuilderRegister.registerGeometry(cube, halfDownCube, halfSouthCube, halfWestCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, eighthCube,
|
|
25
|
-
VoxelModelRuleBuilderRegister.registerModels(simpleCube, simpleTransparentCube, simpleNoCulledCube, orientedCube, simpleHalfCube, pillarCube, simpleThinPannel, stair, simpleCrossedPannel, chainModel, carpetModel, candlesModel, leverModel, fence, liquidModel, ...farmModels, ...(data.models || []));
|
|
24
|
+
VoxelModelRuleBuilderRegister.registerGeometry(cube, halfDownCube, halfSouthCube, halfWestCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, eighthCube, thinPanel, diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, fencePost, fenceEastWest, fenceNorthsouth, chainGeometry, carpetGeometry, candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, liquidGeometry, ...leverGeometry, ...farmGeomtry, ...(data.geometry || []));
|
|
25
|
+
VoxelModelRuleBuilderRegister.registerModels(simpleCube, simpleTransparentCube, simpleNoCulledCube, orientedCube, simpleHalfCube, pillarCube, simpleThinPannel, simpleTransparentThinPannel, stair, simpleCrossedPannel, chainModel, carpetModel, candlesModel, leverModel, fence, liquidModel, ...farmModels, ...(data.models || []));
|
|
26
26
|
}
|
|
27
27
|
function GetModelData(data) {
|
|
28
28
|
if (CacheManager.cacheLoadEnabled && CacheManager.cachedData) {
|
|
@@ -149,16 +149,6 @@ export function InitVoxelData(data) {
|
|
|
149
149
|
dve_flow_rate: 0,
|
|
150
150
|
},
|
|
151
151
|
},
|
|
152
|
-
{
|
|
153
|
-
id: "dve_glow",
|
|
154
|
-
properties: {
|
|
155
|
-
dve_parent_substance: "dve_solid",
|
|
156
|
-
dve_is_solid: true,
|
|
157
|
-
dve_is_liquid: false,
|
|
158
|
-
dve_is_transparent: false,
|
|
159
|
-
dve_flow_rate: 0,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
152
|
{
|
|
163
153
|
id: "dve_translucent",
|
|
164
154
|
properties: {
|
|
@@ -237,6 +227,7 @@ export function InitVoxelData(data) {
|
|
|
237
227
|
substances,
|
|
238
228
|
materials,
|
|
239
229
|
});
|
|
230
|
+
console.warn("FINAL", structuredClone(voxelData), voxelData.data.tags.filter((_) => _["dve_substance"] == "dve_glow"));
|
|
240
231
|
let models = GetModelData(data);
|
|
241
232
|
BuildPaletteData({ models });
|
|
242
233
|
voxelData.data.palette = VoxelPalettesRegister.voxels;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { DataCursorInterface } from "../../Cursor/DataCursor.interface";
|
|
3
3
|
import { VoxelPickResult } from "../VoxelPickResult";
|
|
4
|
-
/**
|
|
5
|
-
* # PickVoxel
|
|
6
|
-
* Used to a pick a voxel from any data cursor interface.
|
|
7
|
-
* The function assumes the data that is loaded into the cursor is available
|
|
8
|
-
*/
|
|
9
4
|
export default function PickVoxel(cursor: DataCursorInterface, rayStart: Vec3Array, rayDirection: Vec3Array, rayLength: number): VoxelPickResult | null;
|
|
@@ -1,94 +1,73 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { VoxelPickResult } from "../VoxelPickResult";
|
|
3
3
|
import { closestUnitNormal, closestVoxelFace, } from "../../../Math/UtilFunctions";
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
let normal = [0, 0, 0];
|
|
8
|
-
if (Math.abs(intersectPoint[0] - voxelMin[0]) < epsilon)
|
|
9
|
-
normal = [1, 0, 0];
|
|
10
|
-
else if (Math.abs(intersectPoint[0] - voxelMax[0]) < epsilon)
|
|
11
|
-
normal = [-1, 0, 0];
|
|
12
|
-
else if (Math.abs(intersectPoint[1] - voxelMin[1]) < epsilon)
|
|
13
|
-
normal = [0, 1, 0];
|
|
14
|
-
else if (Math.abs(intersectPoint[1] - voxelMax[1]) < epsilon)
|
|
15
|
-
normal = [0, -1, 0];
|
|
16
|
-
else if (Math.abs(intersectPoint[2] - voxelMin[2]) < epsilon)
|
|
17
|
-
normal = [0, 0, 1];
|
|
18
|
-
else if (Math.abs(intersectPoint[2] - voxelMax[2]) < epsilon)
|
|
19
|
-
normal = [0, 0, -1];
|
|
20
|
-
return normal;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* # PickVoxel
|
|
24
|
-
* Used to a pick a voxel from any data cursor interface.
|
|
25
|
-
* The function assumes the data that is loaded into the cursor is available
|
|
26
|
-
*/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
5
|
+
const epsilon = 1e-5;
|
|
6
|
+
const bounds = new BoundingBox();
|
|
27
7
|
export default function PickVoxel(cursor, rayStart, rayDirection, rayLength) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
8
|
+
const rayDir = Vector3Like.Create(...rayDirection);
|
|
9
|
+
const rayOrigin = Vector3Like.Create(...rayStart);
|
|
10
|
+
const offset = cursor.volumePosition
|
|
11
|
+
? cursor.volumePosition
|
|
12
|
+
: Vector3Like.Create();
|
|
13
|
+
bounds.setMinMax(Vector3Like.Add(cursor.volumeBounds.min, offset), Vector3Like.Add(cursor.volumeBounds.max, offset));
|
|
14
|
+
const safeDirection = Vector3Like.Create(Math.abs(rayDir.x) < epsilon ? epsilon : rayDir.x, Math.abs(rayDir.y) < epsilon ? epsilon : rayDir.y, Math.abs(rayDir.z) < epsilon ? epsilon : rayDir.z);
|
|
15
|
+
const invDir = Vector3Like.Divide(Vector3Like.Create(1, 1, 1), safeDirection);
|
|
16
|
+
const tDelta = Vector3Like.Create(Math.abs(invDir.x), Math.abs(invDir.y), Math.abs(invDir.z));
|
|
17
|
+
const tEnter = bounds.rayIntersection(rayOrigin, safeDirection);
|
|
18
|
+
if (!isFinite(tEnter)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
let traveled = Math.max(tEnter - 0.5, 0.0);
|
|
22
|
+
const pos = Vector3Like.Add(rayOrigin, Vector3Like.MultiplyScalar(rayDir, traveled));
|
|
23
|
+
const voxel = Vector3Like.FloorInPlace(Vector3Like.Clone(pos));
|
|
24
|
+
const step = Vector3Like.Create(rayDir.x >= 0.0 ? 1 : -1, rayDir.y >= 0.0 ? 1 : -1, rayDir.z >= 0.0 ? 1 : -1);
|
|
25
|
+
const tMax = Vector3Like.Create((rayDir.x >= 0 ? voxel.x + 1 - pos.x : pos.x - voxel.x) * tDelta.x +
|
|
26
|
+
traveled, (rayDir.y >= 0 ? voxel.y + 1 - pos.y : pos.y - voxel.y) * tDelta.y +
|
|
27
|
+
traveled, (rayDir.z >= 0 ? voxel.z + 1 - pos.z : pos.z - voxel.z) * tDelta.z +
|
|
28
|
+
traveled);
|
|
29
|
+
const normal = Vector3Like.Create();
|
|
30
|
+
const maxDist = rayLength;
|
|
31
|
+
while (true) {
|
|
32
|
+
let cursorX = voxel.x;
|
|
33
|
+
let cursorY = voxel.y;
|
|
34
|
+
let cursorZ = voxel.z;
|
|
35
|
+
if (cursor.inBounds(cursorX, cursorY, cursorZ)) {
|
|
36
|
+
const voxel = cursor.getVoxel(cursorX, cursorY, cursorZ);
|
|
37
|
+
if (voxel && voxel.isRenderable()) {
|
|
38
|
+
const urd = Vector3Like.FromArray(closestUnitNormal(rayDir));
|
|
39
|
+
const n = Vector3Like.Clone(normal);
|
|
40
|
+
const pos = Vector3Like.Create(cursorX, cursorY, cursorZ);
|
|
41
|
+
const un = Vector3Like.FromArray(closestUnitNormal(n));
|
|
42
|
+
return new VoxelPickResult(rayOrigin, rayDir, rayLength, voxel.getRaw(), Vector3Like.Clone(pos), n, traveled, Vector3Like.Add(pos, normal), Vector3Like.FromArray(closestUnitNormal(rayDir)), closestVoxelFace(urd), Vector3Like.FromArray(closestUnitNormal(n)), closestVoxelFace(un), 0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (tMax.x < tMax.y && tMax.x < tMax.z) {
|
|
46
|
+
traveled = tMax.x;
|
|
47
|
+
tMax.x += tDelta.x;
|
|
48
|
+
voxel.x += step.x;
|
|
49
|
+
normal.x = -step.x;
|
|
50
|
+
normal.y = 0;
|
|
51
|
+
normal.z = 0;
|
|
52
|
+
}
|
|
53
|
+
else if (tMax.y < tMax.z) {
|
|
54
|
+
traveled = tMax.y;
|
|
55
|
+
tMax.y += tDelta.y;
|
|
56
|
+
voxel.y += step.y;
|
|
57
|
+
normal.x = 0;
|
|
58
|
+
normal.y = -step.y;
|
|
59
|
+
normal.z = 0;
|
|
65
60
|
}
|
|
66
61
|
else {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
traveled = tMax.z;
|
|
63
|
+
tMax.z += tDelta.z;
|
|
64
|
+
voxel.z += step.z;
|
|
65
|
+
normal.x = 0;
|
|
66
|
+
normal.y = 0;
|
|
67
|
+
normal.z = -step.z;
|
|
71
68
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!cursor.inBounds(...pos))
|
|
75
|
-
continue;
|
|
76
|
-
const voxel = cursor.getVoxel(...pos);
|
|
77
|
-
if (voxel && voxel.isRenderable()) {
|
|
78
|
-
const normal = calculateNormal([
|
|
79
|
-
rayStart[0] + rayDirection[0] * tMax[axis],
|
|
80
|
-
rayStart[1] + rayDirection[1] * tMax[axis],
|
|
81
|
-
rayStart[2] + rayDirection[2] * tMax[axis],
|
|
82
|
-
], [pos[0] * voxelSize, pos[1] * voxelSize, pos[2] * voxelSize], [
|
|
83
|
-
pos[0] * voxelSize + voxelSize,
|
|
84
|
-
pos[1] * voxelSize + voxelSize,
|
|
85
|
-
pos[2] * voxelSize + voxelSize,
|
|
86
|
-
]);
|
|
87
|
-
const rd = Vector3Like.Create(...rayDirection);
|
|
88
|
-
const urd = Vector3Like.FromArray(closestUnitNormal(rd));
|
|
89
|
-
const n = Vector3Like.Create(...normal);
|
|
90
|
-
const un = Vector3Like.FromArray(closestUnitNormal(n));
|
|
91
|
-
return new VoxelPickResult(Vector3Like.Create(...rayStart), rd, rayLength, voxel.getRaw(), Vector3Like.Create(...pos), n, tMax[axis], Vector3Like.Create(...Vec3ArrayLike.Add(pos, normal)), Vector3Like.FromArray(closestUnitNormal(rd)), closestVoxelFace(urd), Vector3Like.FromArray(closestUnitNormal(n)), closestVoxelFace(un), 0);
|
|
69
|
+
if (traveled - tEnter > maxDist) {
|
|
70
|
+
break;
|
|
92
71
|
}
|
|
93
72
|
}
|
|
94
73
|
return null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import PickVoxel from "./PickVoxel";
|
|
3
|
-
import { Axes } from "@amodx/math/Vectors/Axes";
|
|
4
3
|
import { WorldSpaces } from "../../../World/WorldSpaces";
|
|
5
4
|
import { WorldRegister } from "../../../World/WorldRegister";
|
|
6
5
|
import { SectorCursor } from "../../../World/Cursor/SectorCursor";
|
|
6
|
+
const epsilon = 1e-5;
|
|
7
7
|
/**# PickVoxelWorld
|
|
8
8
|
* Will pick the voxel world and make sure each sector is available before picking it.
|
|
9
9
|
*
|
|
@@ -12,55 +12,30 @@ import { SectorCursor } from "../../../World/Cursor/SectorCursor";
|
|
|
12
12
|
export default async function PickVoxelWorld(cursor, rayStart, rayDirection, rayLength) {
|
|
13
13
|
let t = 0;
|
|
14
14
|
const d = 8;
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const rayRight = Vector3Like.Cross(rd, Axes.UpReadOnly());
|
|
18
|
-
const rayUp = Vector3Like.Cross(rayRight, rd);
|
|
19
|
-
const cubeSize = 16.0;
|
|
20
|
-
const halfSize = cubeSize / 2.0;
|
|
21
|
-
const rayDirectionScaled = Vector3Like.MultiplyScalar(rd, halfSize);
|
|
22
|
-
const rayRightScaled = Vector3Like.MultiplyScalar(rayRight, halfSize);
|
|
23
|
-
const rayUpScaled = Vector3Like.MultiplyScalar(rayUp, halfSize);
|
|
24
|
-
const finalRayCubeDirection = Vector3Like.Subtract(Vector3Like.Subtract(rayDirectionScaled, rayRightScaled), rayUpScaled);
|
|
25
|
-
const finalMin = Vector3Like.Create();
|
|
26
|
-
const finalMax = Vector3Like.Create();
|
|
27
|
-
const { x: sectorSizeX, y: sectorSizeY, z: sectorSizeZ, } = WorldSpaces.sector.bounds;
|
|
15
|
+
const rayDir = Vector3Like.Create(...rayDirection);
|
|
16
|
+
const rayPosition = Vector3Like.Create();
|
|
28
17
|
const visited = new Set();
|
|
29
18
|
const sectorCursor = new SectorCursor();
|
|
19
|
+
const safeDirection = Vector3Like.Create(Math.abs(rayDir.x) < epsilon ? epsilon : rayDir.x, Math.abs(rayDir.y) < epsilon ? epsilon : rayDir.y, Math.abs(rayDir.z) < epsilon ? epsilon : rayDir.z);
|
|
30
20
|
while (t < rayLength) {
|
|
31
|
-
rayPosition.x = rayStart[0] + t *
|
|
32
|
-
rayPosition.y = rayStart[1] + t *
|
|
33
|
-
rayPosition.z = rayStart[2] + t *
|
|
21
|
+
rayPosition.x = rayStart[0] + t * safeDirection.x;
|
|
22
|
+
rayPosition.y = rayStart[1] + t * safeDirection.y;
|
|
23
|
+
rayPosition.z = rayStart[2] + t * safeDirection.z;
|
|
34
24
|
t += d;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
continue;
|
|
50
|
-
const sector = WorldRegister.sectors.get(cursor.dimension, x, y, z);
|
|
51
|
-
if (!sector)
|
|
52
|
-
continue;
|
|
53
|
-
if (visited.has(sector))
|
|
54
|
-
continue;
|
|
55
|
-
visited.add(sector);
|
|
56
|
-
await sector.waitTillCheckedIn();
|
|
57
|
-
sectorCursor.loadSector(cursor.dimension, x, y, z);
|
|
58
|
-
const result = PickVoxel(sectorCursor, rayStart, rayDirection, rayLength);
|
|
59
|
-
if (result !== null)
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
25
|
+
const { x, y, z } = WorldSpaces.sector.transformPosition(rayPosition);
|
|
26
|
+
if (!WorldSpaces.world.inBounds(x, y, z))
|
|
27
|
+
continue;
|
|
28
|
+
const sector = WorldRegister.sectors.get(cursor.dimension, x, y, z);
|
|
29
|
+
if (!sector)
|
|
30
|
+
continue;
|
|
31
|
+
if (visited.has(sector))
|
|
32
|
+
continue;
|
|
33
|
+
visited.add(sector);
|
|
34
|
+
await sector.waitTillCheckedIn();
|
|
35
|
+
sectorCursor.loadSector(cursor.dimension, x, y, z);
|
|
36
|
+
const result = PickVoxel(sectorCursor, rayStart, rayDirection, rayLength);
|
|
37
|
+
if (result !== null)
|
|
38
|
+
return result;
|
|
64
39
|
}
|
|
65
40
|
return null;
|
|
66
41
|
}
|
|
@@ -46,5 +46,6 @@ export declare class VoxelPickResult implements VoxelPickResultData {
|
|
|
46
46
|
voxel: VoxelCursor;
|
|
47
47
|
static FromJSON(data: VoxelPickResultData): VoxelPickResult;
|
|
48
48
|
constructor(rayOrigin: Vector3Like, rayDirection: Vector3Like, rayLength: number, voxelData: RawVoxelData, position: Vector3Like, normal: Vector3Like, distance: number, normalPosition: Vector3Like, unitRayDirection: Vector3Like, unitRayVoxelFace: VoxelFaces, unitNormal: Vector3Like, unitNormalFace: VoxelFaces, delta: number);
|
|
49
|
+
clone(): VoxelPickResult;
|
|
49
50
|
toJSON(): VoxelPickResultData;
|
|
50
51
|
}
|
|
@@ -3,7 +3,7 @@ import { CulledOcclusionFaceIndexData } from "../Models/Indexing/CulledOcclusion
|
|
|
3
3
|
import { VoxelStateSchemaData, StateLogicStatement } from "../State/State.types";
|
|
4
4
|
import { CullingProcedureData } from "../Models/VoxelModel.types";
|
|
5
5
|
import { VoxelEffectSyncData } from "../Effects/VoxelEffects.types";
|
|
6
|
-
import { CompiledGeomtryNodes } from "../../Mesher/Models/Nodes/Types/GeomtryNode.types";
|
|
6
|
+
import { CompiledGeomtryNodes } from "../../Mesher/Voxels/Models/Nodes/Types/GeomtryNode.types";
|
|
7
7
|
export type CompiledVoxelGeometrySyncData = {
|
|
8
8
|
id: string;
|
|
9
9
|
cullingProcedure: CullingProcedureData;
|
|
@@ -765,68 +765,13 @@ export const simpleHalfCube = {
|
|
|
765
765
|
};
|
|
766
766
|
export const pillarCube = {
|
|
767
767
|
id: "dve_pillar_cube",
|
|
768
|
-
relationsSchema: [
|
|
769
|
-
{
|
|
770
|
-
name: "same-down",
|
|
771
|
-
conditions: [
|
|
772
|
-
{
|
|
773
|
-
type: "same-voxel",
|
|
774
|
-
direction: [0, -1, 0],
|
|
775
|
-
},
|
|
776
|
-
],
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
name: "same-up",
|
|
780
|
-
conditions: [
|
|
781
|
-
{
|
|
782
|
-
type: "same-voxel",
|
|
783
|
-
direction: [0, 1, 0],
|
|
784
|
-
},
|
|
785
|
-
],
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
name: "same-east",
|
|
789
|
-
conditions: [
|
|
790
|
-
{
|
|
791
|
-
type: "same-voxel",
|
|
792
|
-
direction: [1, 0, 0],
|
|
793
|
-
},
|
|
794
|
-
],
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
name: "same-west",
|
|
798
|
-
conditions: [
|
|
799
|
-
{
|
|
800
|
-
type: "same-voxel",
|
|
801
|
-
direction: [-1, 0, 0],
|
|
802
|
-
},
|
|
803
|
-
],
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
name: "same-north",
|
|
807
|
-
conditions: [
|
|
808
|
-
{
|
|
809
|
-
type: "same-voxel",
|
|
810
|
-
direction: [0, 0, 1],
|
|
811
|
-
},
|
|
812
|
-
],
|
|
813
|
-
},
|
|
814
|
-
{
|
|
815
|
-
name: "same-south",
|
|
816
|
-
conditions: [
|
|
817
|
-
{
|
|
818
|
-
type: "same-voxel",
|
|
819
|
-
direction: [0, 0, -1],
|
|
820
|
-
},
|
|
821
|
-
],
|
|
822
|
-
},
|
|
823
|
-
],
|
|
768
|
+
relationsSchema: [],
|
|
824
769
|
stateSchema: [
|
|
825
770
|
{
|
|
826
771
|
name: "direction",
|
|
827
772
|
bitIndex: 0,
|
|
828
773
|
bitSize: 2,
|
|
829
|
-
values: ["down
|
|
774
|
+
values: ["up-down", "north-south", "east-west"],
|
|
830
775
|
},
|
|
831
776
|
],
|
|
832
777
|
arguments: {
|
|
@@ -854,65 +799,65 @@ export const pillarCube = {
|
|
|
854
799
|
dve_placing_strategy: "*",
|
|
855
800
|
},
|
|
856
801
|
stateNodes: {
|
|
857
|
-
"direction=
|
|
802
|
+
"direction=up-down": [
|
|
858
803
|
{
|
|
859
804
|
geometryId: "dve_cube",
|
|
860
805
|
inputs: {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
806
|
+
allTexs: {
|
|
807
|
+
type: "pillar",
|
|
808
|
+
texture: "@sideDisconnectedTex",
|
|
809
|
+
textureRecrod: {
|
|
810
|
+
sideConnectedTex: "@sideConnectedTex",
|
|
811
|
+
sideDisconnectedTex: "@sideDisconnectedTex",
|
|
812
|
+
sideUpTex: "@sideUpTex",
|
|
813
|
+
sideDownTex: "@sideDownTex",
|
|
814
|
+
upTex: "@upTex",
|
|
815
|
+
downTex: "@downTex",
|
|
816
|
+
},
|
|
817
|
+
direction: "up-down",
|
|
818
|
+
},
|
|
867
819
|
},
|
|
868
820
|
},
|
|
869
821
|
],
|
|
870
|
-
"direction=
|
|
822
|
+
"direction=east-west": [
|
|
871
823
|
{
|
|
872
824
|
geometryId: "dve_cube",
|
|
873
825
|
inputs: {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
826
|
+
allTexs: {
|
|
827
|
+
type: "pillar",
|
|
828
|
+
texture: "@sideDisconnectedTex",
|
|
829
|
+
textureRecrod: {
|
|
830
|
+
sideConnectedTex: "@sideConnectedTex",
|
|
831
|
+
sideDisconnectedTex: "@sideDisconnectedTex",
|
|
832
|
+
sideUpTex: "@sideUpTex",
|
|
833
|
+
sideDownTex: "@sideDownTex",
|
|
834
|
+
upTex: "@upTex",
|
|
835
|
+
downTex: "@downTex",
|
|
836
|
+
},
|
|
837
|
+
direction: "east-west",
|
|
838
|
+
},
|
|
880
839
|
},
|
|
881
840
|
},
|
|
882
841
|
],
|
|
883
|
-
"direction=
|
|
842
|
+
"direction=north-south": [
|
|
884
843
|
{
|
|
885
844
|
geometryId: "dve_cube",
|
|
886
845
|
inputs: {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
upTex: "@upTex",
|
|
901
|
-
downTex: "@downTex",
|
|
902
|
-
northTex: "@sideConnectedTex",
|
|
903
|
-
southTex: "@sideConnectedTex",
|
|
904
|
-
eastTex: "@sideConnectedTex",
|
|
905
|
-
westTex: "@sideConnectedTex",
|
|
846
|
+
allTexs: {
|
|
847
|
+
type: "pillar",
|
|
848
|
+
texture: "@sideDisconnectedTex",
|
|
849
|
+
textureRecrod: {
|
|
850
|
+
sideConnectedTex: "@sideConnectedTex",
|
|
851
|
+
sideDisconnectedTex: "@sideDisconnectedTex",
|
|
852
|
+
sideUpTex: "@sideUpTex",
|
|
853
|
+
sideDownTex: "@sideDownTex",
|
|
854
|
+
upTex: "@upTex",
|
|
855
|
+
downTex: "@downTex",
|
|
856
|
+
},
|
|
857
|
+
direction: "north-south",
|
|
858
|
+
},
|
|
906
859
|
},
|
|
907
860
|
},
|
|
908
861
|
],
|
|
909
|
-
"direction=south-north,same-south=false,same-north=false": [],
|
|
910
|
-
"direction=south-north,same-south=true,same-north=false": [],
|
|
911
|
-
"direction=south-north,same-south=false,same-north=true": [],
|
|
912
|
-
"direction=south-north,same-south=true,same-north=true": [],
|
|
913
|
-
"direction=west-east,same-west=false,same-east=false": [],
|
|
914
|
-
"direction=west-east,same-west=true,same-east=false": [],
|
|
915
|
-
"direction=west-east,same-west=false,same-east=true": [],
|
|
916
|
-
"direction=west-east,same-west=true,same-east=true": [],
|
|
917
862
|
},
|
|
918
863
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { VoxelGeometryData } from "../VoxelModel.types";
|
|
2
2
|
export declare const diagonalFlatPanelWestEast: VoxelGeometryData;
|
|
3
3
|
export declare const diagonalFlatPanelEastWest: VoxelGeometryData;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const thinPanelSouth: VoxelGeometryData;
|
|
6
|
-
export declare const thinPanelWest: VoxelGeometryData;
|
|
4
|
+
export declare const thinPanel: VoxelGeometryData;
|