@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Quad } from "../../../../../../Mesher/Geomtry/Primitives/Quad";
|
|
2
2
|
import { getQuadWeights, mapQuadUvs } from "./CalcFunctions";
|
|
3
3
|
import { TransformQuad } from "../../../../../../Mesher/Geomtry/Transform/TransformQuad";
|
|
4
|
-
import { QuadVoxelGometryInputs, } from "../../../../../../Mesher/Models/Nodes/Types/QuadVoxelGometryNodeTypes";
|
|
4
|
+
import { QuadVoxelGometryInputs, } from "../../../../../../Mesher/Voxels/Models/Nodes/Types/QuadVoxelGometryNodeTypes";
|
|
5
5
|
import { OcclusionFaceRegister } from "../../../Classes/OcclusionFaceRegister";
|
|
6
6
|
import { closestVoxelFace } from "../../../../../../Math/UtilFunctions";
|
|
7
7
|
export function CompileQuadGeometryNode(buildRules, input, points, node, transform = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { VoxelGeometryTransform } from "../../../../../../Mesher/Geomtry/Geometry.types";
|
|
3
|
-
import { CompiledTriangleVoxelGeomtryNode } from "../../../../../../Mesher/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
3
|
+
import { CompiledTriangleVoxelGeomtryNode } from "../../../../../../Mesher/Voxels/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
4
4
|
import { GeomtryInput } from "../../../Classes/GeomtryInput";
|
|
5
5
|
import { BaseVoxelTriangleData } from "../../../../VoxelModel.types";
|
|
6
6
|
export declare function CompileTriangleGeometryNode(buildRules: boolean, input: GeomtryInput, points: [Vec3Array, Vec3Array, Vec3Array], node: BaseVoxelTriangleData, transform?: VoxelGeometryTransform): CompiledTriangleVoxelGeomtryNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Triangle } from "../../../../../../Mesher/Geomtry/Primitives/Triangle";
|
|
2
2
|
import { getVertexWeights } from "./CalcFunctions";
|
|
3
3
|
import { TransformTriangle } from "../../../../../../Mesher/Geomtry/Transform/TransformTriangle";
|
|
4
|
-
import { TriangleVoxelGometryInputs, } from "../../../../../../Mesher/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
4
|
+
import { TriangleVoxelGometryInputs, } from "../../../../../../Mesher/Voxels/Models/Nodes/Types/TriangleVoxelGometryNodeTypes";
|
|
5
5
|
import { OcclusionFaceRegister } from "../../../Classes/OcclusionFaceRegister";
|
|
6
6
|
import { closestVoxelFace } from "../../../../../../Math/UtilFunctions";
|
|
7
7
|
export function CompileTriangleGeometryNode(buildRules, input, points, node, transform) {
|
|
@@ -51,6 +51,11 @@ export interface VoxelTriangleGeometryNode extends BaseVoxelTriangleData {
|
|
|
51
51
|
export interface VoxelGeometryTextureArgument {
|
|
52
52
|
type: "texture";
|
|
53
53
|
}
|
|
54
|
+
/**Creates a way to set multiple arguments to the same thing. What ever value is passed in will be passed to the arguments. */
|
|
55
|
+
export interface VoxelGeometryArgumentAliasList {
|
|
56
|
+
type: "arg-list";
|
|
57
|
+
arguments: string[];
|
|
58
|
+
}
|
|
54
59
|
export interface VoxelGeometryBooleanArgument {
|
|
55
60
|
type: "boolean";
|
|
56
61
|
default: boolean;
|
|
@@ -103,7 +108,7 @@ export interface VoxelGeometryData {
|
|
|
103
108
|
* Define the culling procedure for faces
|
|
104
109
|
*/
|
|
105
110
|
cullingProcedure?: CullingProcedureData;
|
|
106
|
-
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument>;
|
|
111
|
+
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument | VoxelGeometryArgumentAliasList>;
|
|
107
112
|
}
|
|
108
113
|
export interface VoxelGeometryLinkData {
|
|
109
114
|
geometryId: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StringPalette } from "../../../Util/StringPalette";
|
|
2
2
|
import { VoxelBinaryStateSchemaNode } from "../State.types";
|
|
3
3
|
export declare class BinarySchemaNode {
|
|
4
|
-
|
|
4
|
+
readonly data: VoxelBinaryStateSchemaNode;
|
|
5
|
+
get name(): string;
|
|
5
6
|
valuePalette?: StringPalette;
|
|
6
7
|
bitIndex: number;
|
|
7
8
|
bitMask: number;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { StringPalette } from "../../../Util/StringPalette";
|
|
2
2
|
export class BinarySchemaNode {
|
|
3
|
-
|
|
3
|
+
data;
|
|
4
|
+
get name() {
|
|
5
|
+
return this.data.name;
|
|
6
|
+
}
|
|
4
7
|
valuePalette;
|
|
5
8
|
bitIndex = 0;
|
|
6
9
|
bitMask = 0;
|
|
7
10
|
constructor(data) {
|
|
8
|
-
this.
|
|
11
|
+
this.data = data;
|
|
9
12
|
this.bitIndex = data.bitIndex;
|
|
10
13
|
this.bitMask = (1 << data.bitSize) - 1;
|
|
11
14
|
if (data.values)
|
|
@@ -9,6 +9,8 @@ export class SameVoxelCondition extends ShapeStateSchemaRelationsCondition {
|
|
|
9
9
|
const nx = this.schema.position.x + this.data.direction[0];
|
|
10
10
|
const ny = this.schema.position.y + this.data.direction[1];
|
|
11
11
|
const nz = this.schema.position.z + this.data.direction[2];
|
|
12
|
+
if (!this.schema.dataCursor.inBounds(nx, ny, nz))
|
|
13
|
+
return false;
|
|
12
14
|
const nVoxel = this.schema.dataCursor.getVoxel(nx, ny, nz);
|
|
13
15
|
if (!nVoxel)
|
|
14
16
|
return false;
|
|
@@ -2,16 +2,28 @@ import { RawVoxelData } from "./Voxel.types";
|
|
|
2
2
|
export declare class PaintVoxelData {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
|
-
mod: number;
|
|
6
5
|
state: number;
|
|
6
|
+
stateString: string;
|
|
7
|
+
mod: number;
|
|
8
|
+
modString: string;
|
|
7
9
|
level: number;
|
|
8
10
|
levelState: number;
|
|
9
11
|
secondaryVoxelId: string;
|
|
10
12
|
secondaryName: string;
|
|
11
13
|
secondaryMod: number;
|
|
14
|
+
secondaryModString: string;
|
|
12
15
|
secondaryState: number;
|
|
16
|
+
secondaryStateString: string;
|
|
13
17
|
static Create(data?: Partial<PaintVoxelData>): PaintVoxelData;
|
|
18
|
+
/**Transforms numeric voxel data into a PaintVoxelData object */
|
|
14
19
|
static FromRaw(data: RawVoxelData, paintData?: PaintVoxelData): PaintVoxelData;
|
|
20
|
+
/**Transforms the voxel data into numeric voxel data */
|
|
15
21
|
static ToRaw(data: Partial<PaintVoxelData>, light?: number): RawVoxelData;
|
|
22
|
+
/**Restores the data to the default state of being dve_air */
|
|
23
|
+
static Clear(data: PaintVoxelData): PaintVoxelData;
|
|
24
|
+
/**Clears the target data and then copies properties from source to target. */
|
|
25
|
+
static Set(target: PaintVoxelData, source: Partial<PaintVoxelData>): PaintVoxelData;
|
|
26
|
+
/**Takes PaintVoxelData and convert mod and state strings to numbers and then */
|
|
27
|
+
static Populate(data: Partial<PaintVoxelData>): Partial<PaintVoxelData>;
|
|
16
28
|
private constructor();
|
|
17
29
|
}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { VoxelPalettesRegister } from "../Data/VoxelPalettesRegister";
|
|
2
2
|
import { VoxelLevelReader } from "../Cursor/VoxelLevelReader";
|
|
3
|
+
import { SchemaRegister } from "../../Voxels/State/SchemaRegister";
|
|
3
4
|
export class PaintVoxelData {
|
|
4
5
|
id;
|
|
5
6
|
name;
|
|
6
|
-
mod;
|
|
7
7
|
state;
|
|
8
|
+
stateString;
|
|
9
|
+
mod;
|
|
10
|
+
modString;
|
|
8
11
|
level;
|
|
9
12
|
levelState;
|
|
10
13
|
secondaryVoxelId;
|
|
11
14
|
secondaryName;
|
|
12
15
|
secondaryMod;
|
|
16
|
+
secondaryModString;
|
|
13
17
|
secondaryState;
|
|
18
|
+
secondaryStateString;
|
|
14
19
|
static Create(data = {}) {
|
|
15
|
-
return new PaintVoxelData(data.id, data.name, data.mod, data.
|
|
20
|
+
return new PaintVoxelData(data.id, data.name, data.state, data.stateString, data.mod, data.modString, data.level, data.levelState, data.secondaryVoxelId, data.secondaryName, data.secondaryMod, data.secondaryModString, data.secondaryState, data.secondaryModString);
|
|
16
21
|
}
|
|
22
|
+
/**Transforms numeric voxel data into a PaintVoxelData object */
|
|
17
23
|
static FromRaw(data, paintData = PaintVoxelData.Create()) {
|
|
18
24
|
const [trueVoxelId, state, mod] = VoxelPalettesRegister.voxels[data[0]];
|
|
19
25
|
paintData.id = VoxelPalettesRegister.voxelIds.getStringId(trueVoxelId);
|
|
@@ -34,23 +40,48 @@ export class PaintVoxelData {
|
|
|
34
40
|
paintData.levelState = VoxelLevelReader.getLevel(data[2]);
|
|
35
41
|
return paintData;
|
|
36
42
|
}
|
|
43
|
+
/**Transforms the voxel data into numeric voxel data */
|
|
37
44
|
static ToRaw(data, light = 0) {
|
|
38
45
|
let stringId = data.id
|
|
39
46
|
? data.id
|
|
40
47
|
: data.name
|
|
41
48
|
? VoxelPalettesRegister.voxelNametoIdMap.get(data.name)
|
|
42
49
|
: "dve_air";
|
|
43
|
-
let secondaryStringId = data.
|
|
44
|
-
? data.
|
|
45
|
-
: data.
|
|
46
|
-
? VoxelPalettesRegister.voxelNametoIdMap.get(data.
|
|
50
|
+
let secondaryStringId = data.secondaryName
|
|
51
|
+
? data.secondaryVoxelId
|
|
52
|
+
: data.secondaryName
|
|
53
|
+
? VoxelPalettesRegister.voxelNametoIdMap.get(data.secondaryName)
|
|
47
54
|
: "dve_air";
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
let state = data.state || 0;
|
|
56
|
+
let mod = data.mod || 0;
|
|
57
|
+
let secondaryState = data.secondaryState || 0;
|
|
58
|
+
let secondaryMod = data.secondaryMod || 0;
|
|
59
|
+
if (SchemaRegister.hasVoxelSchema(stringId)) {
|
|
60
|
+
const schema = SchemaRegister.getVoxelSchemas(stringId);
|
|
61
|
+
if (data.stateString && data.stateString !== "") {
|
|
62
|
+
state = schema.state.readString(data.stateString);
|
|
63
|
+
}
|
|
64
|
+
if (data.modString && data.modString !== "") {
|
|
65
|
+
mod = schema.mod.readString(data.modString);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (secondaryStringId && SchemaRegister.hasVoxelSchema(secondaryStringId)) {
|
|
69
|
+
const schema = SchemaRegister.getVoxelSchemas(secondaryStringId);
|
|
70
|
+
if (data.secondaryStateString && data.secondaryStateString !== "") {
|
|
71
|
+
secondaryState = schema.state.readString(data.secondaryStateString);
|
|
72
|
+
}
|
|
73
|
+
if (data.secondaryModString && data.secondaryModString !== "") {
|
|
74
|
+
secondaryMod = schema.mod.readString(data.secondaryModString);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const id = stringId !== "dve_air"
|
|
78
|
+
? VoxelPalettesRegister.getVoxelIdFromString(stringId, state || 0, mod || 0)
|
|
79
|
+
: 0;
|
|
80
|
+
const secondaryId = secondaryStringId !== "dve_air"
|
|
81
|
+
? secondaryStringId
|
|
82
|
+
? VoxelPalettesRegister.getVoxelIdFromString(secondaryStringId, secondaryState || 0, secondaryMod || 0)
|
|
83
|
+
: 0
|
|
84
|
+
: 0;
|
|
54
85
|
let levleData = 0;
|
|
55
86
|
if (data.level !== undefined)
|
|
56
87
|
levleData = VoxelLevelReader.setLevel(levleData, data.level);
|
|
@@ -58,16 +89,122 @@ export class PaintVoxelData {
|
|
|
58
89
|
levleData = VoxelLevelReader.setLevelState(levleData, data.levelState);
|
|
59
90
|
return [id, light, levleData, secondaryId];
|
|
60
91
|
}
|
|
61
|
-
|
|
92
|
+
/**Restores the data to the default state of being dve_air */
|
|
93
|
+
static Clear(data) {
|
|
94
|
+
data.id = "dve_air";
|
|
95
|
+
data.name = "";
|
|
96
|
+
data.state = 0;
|
|
97
|
+
data.stateString = "";
|
|
98
|
+
data.mod = 0;
|
|
99
|
+
data.modString = "";
|
|
100
|
+
data.level = 0;
|
|
101
|
+
data.levelState = 0;
|
|
102
|
+
data.secondaryVoxelId = "dve_air";
|
|
103
|
+
data.secondaryName = "";
|
|
104
|
+
data.secondaryMod = 0;
|
|
105
|
+
data.secondaryModString = "";
|
|
106
|
+
data.secondaryState = 0;
|
|
107
|
+
data.secondaryStateString = "";
|
|
108
|
+
return data;
|
|
109
|
+
}
|
|
110
|
+
/**Clears the target data and then copies properties from source to target. */
|
|
111
|
+
static Set(target, source) {
|
|
112
|
+
PaintVoxelData.Clear(target);
|
|
113
|
+
if (source.id !== undefined)
|
|
114
|
+
target.id = source.id;
|
|
115
|
+
if (source.name !== undefined)
|
|
116
|
+
target.name = source.name;
|
|
117
|
+
if (source.state !== undefined)
|
|
118
|
+
target.state = source.state;
|
|
119
|
+
if (source.stateString !== undefined)
|
|
120
|
+
target.stateString = source.stateString;
|
|
121
|
+
if (source.mod !== undefined)
|
|
122
|
+
target.mod = source.mod;
|
|
123
|
+
if (source.modString !== undefined)
|
|
124
|
+
target.modString = source.modString;
|
|
125
|
+
if (source.level !== undefined)
|
|
126
|
+
target.level = source.level;
|
|
127
|
+
if (source.levelState !== undefined)
|
|
128
|
+
target.levelState = source.levelState;
|
|
129
|
+
if (source.secondaryVoxelId !== undefined)
|
|
130
|
+
target.secondaryVoxelId = source.secondaryVoxelId;
|
|
131
|
+
if (source.secondaryName !== undefined)
|
|
132
|
+
target.secondaryName = source.secondaryName;
|
|
133
|
+
if (source.secondaryMod !== undefined)
|
|
134
|
+
target.secondaryMod = source.secondaryMod;
|
|
135
|
+
if (source.secondaryModString !== undefined)
|
|
136
|
+
target.secondaryModString = source.secondaryModString;
|
|
137
|
+
if (source.secondaryState !== undefined)
|
|
138
|
+
target.secondaryState = source.secondaryState;
|
|
139
|
+
if (source.secondaryStateString !== undefined)
|
|
140
|
+
target.secondaryStateString = source.secondaryStateString;
|
|
141
|
+
return target;
|
|
142
|
+
}
|
|
143
|
+
/**Takes PaintVoxelData and convert mod and state strings to numbers and then */
|
|
144
|
+
static Populate(data) {
|
|
145
|
+
let stringId = data.id
|
|
146
|
+
? data.id
|
|
147
|
+
: data.name
|
|
148
|
+
? VoxelPalettesRegister.voxelNametoIdMap.get(data.name)
|
|
149
|
+
: "dve_air";
|
|
150
|
+
let secondaryStringId = data.secondaryName
|
|
151
|
+
? data.secondaryVoxelId
|
|
152
|
+
: data.secondaryName
|
|
153
|
+
? VoxelPalettesRegister.voxelNametoIdMap.get(data.secondaryName)
|
|
154
|
+
: "dve_air";
|
|
155
|
+
if (data.name && !data.id) {
|
|
156
|
+
data.id = VoxelPalettesRegister.voxelNametoIdMap.get(data.name);
|
|
157
|
+
}
|
|
158
|
+
if (!data.name && !data.id) {
|
|
159
|
+
data.id = "dve_air";
|
|
160
|
+
}
|
|
161
|
+
delete data.name;
|
|
162
|
+
let state = data.state || 0;
|
|
163
|
+
let mod = data.mod || 0;
|
|
164
|
+
if (SchemaRegister.hasVoxelSchema(stringId)) {
|
|
165
|
+
const schema = SchemaRegister.getVoxelSchemas(stringId);
|
|
166
|
+
if (data.stateString && data.stateString !== "") {
|
|
167
|
+
state = schema.state.readString(data.stateString);
|
|
168
|
+
}
|
|
169
|
+
if (data.modString && data.modString !== "") {
|
|
170
|
+
mod = schema.mod.readString(data.modString);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
data.state = state;
|
|
174
|
+
data.mod = mod;
|
|
175
|
+
delete data.stateString;
|
|
176
|
+
delete data.modString;
|
|
177
|
+
let secondaryState = data.secondaryState || 0;
|
|
178
|
+
let secondaryMod = data.secondaryMod || 0;
|
|
179
|
+
if (secondaryStringId && SchemaRegister.hasVoxelSchema(secondaryStringId)) {
|
|
180
|
+
const schema = SchemaRegister.getVoxelSchemas(secondaryStringId);
|
|
181
|
+
if (data.secondaryStateString && data.secondaryStateString !== "") {
|
|
182
|
+
secondaryState = schema.state.readString(data.secondaryStateString);
|
|
183
|
+
}
|
|
184
|
+
if (data.secondaryModString && data.secondaryModString !== "") {
|
|
185
|
+
secondaryMod = schema.mod.readString(data.secondaryModString);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
data.secondaryState = secondaryState;
|
|
189
|
+
data.secondaryMod = secondaryMod;
|
|
190
|
+
delete data.secondaryModString;
|
|
191
|
+
delete data.secondaryStateString;
|
|
192
|
+
return data;
|
|
193
|
+
}
|
|
194
|
+
constructor(id = "dve_air", name = "", state = 0, stateString = "", mod = 0, modString = "", level = 0, levelState = 0, secondaryVoxelId = "dve_air", secondaryName = "", secondaryMod = 0, secondaryModString = "", secondaryState = 0, secondaryStateString = "") {
|
|
62
195
|
this.id = id;
|
|
63
196
|
this.name = name;
|
|
64
|
-
this.mod = mod;
|
|
65
197
|
this.state = state;
|
|
198
|
+
this.stateString = stateString;
|
|
199
|
+
this.mod = mod;
|
|
200
|
+
this.modString = modString;
|
|
66
201
|
this.level = level;
|
|
67
202
|
this.levelState = levelState;
|
|
68
203
|
this.secondaryVoxelId = secondaryVoxelId;
|
|
69
204
|
this.secondaryName = secondaryName;
|
|
70
205
|
this.secondaryMod = secondaryMod;
|
|
206
|
+
this.secondaryModString = secondaryModString;
|
|
71
207
|
this.secondaryState = secondaryState;
|
|
208
|
+
this.secondaryStateString = secondaryStateString;
|
|
72
209
|
}
|
|
73
210
|
}
|
|
@@ -2,4 +2,4 @@ import { ArchivedLightSegments } from "../../Types/Archive.types";
|
|
|
2
2
|
export declare const lightSegments: ArchivedLightSegments[];
|
|
3
3
|
export declare const lightSemgnetGet: Record<ArchivedLightSegments, (value: number) => number>;
|
|
4
4
|
export declare const lightSemgnetSet: Record<ArchivedLightSegments, (value: number, source: number) => number>;
|
|
5
|
-
export declare function getLightBuffer(light: ArchivedLightSegments, buffer: Uint16Array): Uint8Array
|
|
5
|
+
export declare function getLightBuffer(light: ArchivedLightSegments, buffer: Uint16Array): Uint8Array<ArrayBuffer>;
|
|
@@ -3,12 +3,16 @@ import { Vector3Like } from "@amodx/math";
|
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
4
|
import { WorldSectionCursorInterface } from "./WorldSectionCursor.interface";
|
|
5
5
|
import type { Section } from "../Section/index";
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
7
|
export declare class SectionCursor implements WorldSectionCursorInterface, DataCursorInterface {
|
|
7
8
|
_section: Section | null;
|
|
8
9
|
private voxel;
|
|
9
10
|
_voxelIndex: number;
|
|
10
11
|
_voxelPosition: Vector3Like;
|
|
11
12
|
_sectionPosition: Vector3Like;
|
|
13
|
+
volumeBounds: BoundingBox;
|
|
14
|
+
get volumePosition(): Vector3Like;
|
|
15
|
+
constructor();
|
|
12
16
|
inBounds(x: number, y: number, z: number): boolean;
|
|
13
17
|
setSection(section: Section): void;
|
|
14
18
|
loadSection(dimension: number, x: number, y: number, z: number): boolean;
|
|
@@ -2,29 +2,26 @@ import { WorldRegister } from "../WorldRegister";
|
|
|
2
2
|
import { WorldVoxelCursor } from "./WorldVoxelCursor";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
4
|
import { Vector3Like } from "@amodx/math";
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
|
+
const point = Vector3Like.Create();
|
|
5
7
|
export class SectionCursor {
|
|
6
8
|
_section;
|
|
7
9
|
voxel = new WorldVoxelCursor(this);
|
|
8
10
|
_voxelIndex = 0;
|
|
9
11
|
_voxelPosition = Vector3Like.Create();
|
|
10
12
|
_sectionPosition = Vector3Like.Create();
|
|
13
|
+
volumeBounds = new BoundingBox();
|
|
14
|
+
get volumePosition() {
|
|
15
|
+
return this._sectionPosition;
|
|
16
|
+
}
|
|
17
|
+
constructor() {
|
|
18
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(0, 0, 0), Vector3Like.Create(WorldSpaces.section.bounds.x, WorldSpaces.section.bounds.y, WorldSpaces.section.bounds.z));
|
|
19
|
+
}
|
|
11
20
|
inBounds(x, y, z) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return false;
|
|
17
|
-
if (y < this._sectionPosition.y)
|
|
18
|
-
return false;
|
|
19
|
-
if (z < this._sectionPosition.z)
|
|
20
|
-
return false;
|
|
21
|
-
if (x > maxX)
|
|
22
|
-
return false;
|
|
23
|
-
if (y > maxY)
|
|
24
|
-
return false;
|
|
25
|
-
if (z > maxZ)
|
|
26
|
-
return false;
|
|
27
|
-
return true;
|
|
21
|
+
point.x = x - this._sectionPosition.x + 0.5;
|
|
22
|
+
point.y = y - this._sectionPosition.y + 0.5;
|
|
23
|
+
point.z = z - this._sectionPosition.z + 0.5;
|
|
24
|
+
return this.volumeBounds.intersectsPoint(point);
|
|
28
25
|
}
|
|
29
26
|
setSection(section) {
|
|
30
27
|
this._section = section;
|
|
@@ -4,6 +4,7 @@ import { WorldVoxelCursor } from "./WorldVoxelCursor";
|
|
|
4
4
|
import { Vector3Like } from "@amodx/math";
|
|
5
5
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
6
6
|
import { WorldSectionCursorInterface } from "./WorldSectionCursor.interface";
|
|
7
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
8
|
export declare class SectorCursor implements DataCursorInterface, WorldSectionCursorInterface {
|
|
8
9
|
_current: Sector | null;
|
|
9
10
|
_section: Section | null;
|
|
@@ -11,6 +12,9 @@ export declare class SectorCursor implements DataCursorInterface, WorldSectionCu
|
|
|
11
12
|
_voxelIndex: number;
|
|
12
13
|
_voxelPosition: Vector3Like;
|
|
13
14
|
_sectorPosition: Vector3Like;
|
|
15
|
+
volumeBounds: BoundingBox;
|
|
16
|
+
get volumePosition(): Vector3Like;
|
|
17
|
+
constructor();
|
|
14
18
|
inBounds(x: number, y: number, z: number): boolean;
|
|
15
19
|
setSector(sector: Sector): boolean;
|
|
16
20
|
loadSector(dimension: number, x: number, y: number, z: number): boolean;
|
|
@@ -2,6 +2,8 @@ import { WorldRegister } from "../WorldRegister";
|
|
|
2
2
|
import { WorldVoxelCursor } from "./WorldVoxelCursor";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
4
|
import { Vector3Like } from "@amodx/math";
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
|
+
const point = Vector3Like.Create();
|
|
5
7
|
export class SectorCursor {
|
|
6
8
|
_current = null;
|
|
7
9
|
_section;
|
|
@@ -9,23 +11,18 @@ export class SectorCursor {
|
|
|
9
11
|
_voxelIndex = 0;
|
|
10
12
|
_voxelPosition = Vector3Like.Create();
|
|
11
13
|
_sectorPosition = Vector3Like.Create();
|
|
14
|
+
volumeBounds = new BoundingBox();
|
|
15
|
+
get volumePosition() {
|
|
16
|
+
return this._sectorPosition;
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(0, 0, 0), Vector3Like.Create(WorldSpaces.sector.bounds.x, WorldSpaces.sector.bounds.y, WorldSpaces.sector.bounds.z));
|
|
20
|
+
}
|
|
12
21
|
inBounds(x, y, z) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return false;
|
|
18
|
-
if (y < this._sectorPosition.y)
|
|
19
|
-
return false;
|
|
20
|
-
if (z < this._sectorPosition.z)
|
|
21
|
-
return false;
|
|
22
|
-
if (x > maxX)
|
|
23
|
-
return false;
|
|
24
|
-
if (y > maxY)
|
|
25
|
-
return false;
|
|
26
|
-
if (z > maxZ)
|
|
27
|
-
return false;
|
|
28
|
-
return true;
|
|
22
|
+
point.x = x - this._sectorPosition.x + 0.5;
|
|
23
|
+
point.y = y - this._sectorPosition.y + 0.5;
|
|
24
|
+
point.z = z - this._sectorPosition.z + 0.5;
|
|
25
|
+
return this.volumeBounds.intersectsPoint(point);
|
|
29
26
|
}
|
|
30
27
|
setSector(sector) {
|
|
31
28
|
this._current = sector;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { SectorCursor } from "./SectorCursor";
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
4
5
|
export declare class WorldCursor implements DataCursorInterface {
|
|
6
|
+
volumeBounds: BoundingBox;
|
|
5
7
|
sectorCursors: Record<number, Record<number, SectorCursor | null>>;
|
|
6
8
|
origin: Vector3Like;
|
|
7
9
|
dimension: number;
|
|
8
10
|
_lastPosition: Vector3Like;
|
|
11
|
+
constructor();
|
|
12
|
+
private updateBounds;
|
|
9
13
|
setFocalPoint(dimension: number, x: number, y: number, z: number): void;
|
|
10
14
|
inBounds(x: number, y: number, z: number): boolean;
|
|
11
15
|
getSector(x: number, y: number, z: number): SectorCursor | null;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { SectorCursor } from "./SectorCursor";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
4
5
|
let cursorCache = [];
|
|
5
6
|
const tempPosition = Vector3Like.Create();
|
|
6
7
|
export class WorldCursor {
|
|
8
|
+
volumeBounds = new BoundingBox();
|
|
7
9
|
sectorCursors = {};
|
|
8
10
|
origin = Vector3Like.Create();
|
|
9
11
|
dimension = 0;
|
|
10
12
|
_lastPosition = Vector3Like.Create();
|
|
13
|
+
constructor() {
|
|
14
|
+
this.updateBounds();
|
|
15
|
+
}
|
|
16
|
+
updateBounds() {
|
|
17
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(WorldSpaces.world.bounds.MinX, WorldSpaces.world.bounds.MinY, WorldSpaces.world.bounds.MinZ), Vector3Like.Create(WorldSpaces.world.bounds.MaxX, WorldSpaces.world.bounds.MaxY, WorldSpaces.world.bounds.MaxZ));
|
|
18
|
+
}
|
|
11
19
|
setFocalPoint(dimension, x, y, z) {
|
|
12
20
|
const sectorPos = WorldSpaces.sector.getPosition(x, y, z, tempPosition);
|
|
13
21
|
for (const row in this.sectorCursors) {
|
package/World/Sector/Sector.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class Sector {
|
|
|
16
16
|
static TimeStampIds: typeof import("./SectorState.js").SectorStateDefaultTimeStamps;
|
|
17
17
|
static GetHeaderSize(): number;
|
|
18
18
|
static GetBufferSize(): number;
|
|
19
|
-
static CreateNewBuffer(): ArrayBuffer;
|
|
19
|
+
static CreateNewBuffer(): ArrayBuffer | SharedArrayBuffer;
|
|
20
20
|
sections: Section[];
|
|
21
21
|
bufferView: Uint8Array;
|
|
22
22
|
position: Vec3Array;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { LocationData } from "../../Math";
|
|
2
2
|
export declare class SectorHeightMap {
|
|
3
|
+
/**
|
|
4
|
+
* Gets the relative height of the sector. Meaning will get the tallest sector in a square around it.
|
|
5
|
+
*/
|
|
3
6
|
static getRelative(location: LocationData): number;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the exact heigh of the single sector.
|
|
9
|
+
*/
|
|
4
10
|
static getAbsolute(dimension: number, x: number, sy: number, z: number): number;
|
|
5
11
|
}
|
|
@@ -2,6 +2,9 @@ import { MooreNeighborhood2D } from "../../Math/CardinalNeighbors";
|
|
|
2
2
|
import { WorldRegister } from "../WorldRegister";
|
|
3
3
|
import { WorldSpaces } from "../WorldSpaces";
|
|
4
4
|
export class SectorHeightMap {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the relative height of the sector. Meaning will get the tallest sector in a square around it.
|
|
7
|
+
*/
|
|
5
8
|
static getRelative(location) {
|
|
6
9
|
location = [...location];
|
|
7
10
|
const sectionWidth = WorldSpaces.section.bounds.x;
|
|
@@ -18,6 +21,9 @@ export class SectorHeightMap {
|
|
|
18
21
|
}
|
|
19
22
|
return maxHeight;
|
|
20
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the exact heigh of the single sector.
|
|
26
|
+
*/
|
|
21
27
|
static getAbsolute(dimension, x, sy, z) {
|
|
22
28
|
const sector = WorldRegister.sectors.get(dimension, x, sy, z);
|
|
23
29
|
if (!sector)
|
|
@@ -4,14 +4,17 @@ import { SectionSnapShot } from "./SectionSnapShot";
|
|
|
4
4
|
import { Sector } from "../Sector";
|
|
5
5
|
import { SectorCursor } from "../Cursor/SectorCursor";
|
|
6
6
|
import { SectionCursor } from "../Cursor/SectionCursor";
|
|
7
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
7
8
|
export declare class SectionSnapshotCursor implements DataCursorInterface {
|
|
8
9
|
origin: Vector3Like;
|
|
9
10
|
sectorOrigin: Vector3Like;
|
|
10
11
|
dimension: number;
|
|
12
|
+
volumeBounds: BoundingBox;
|
|
11
13
|
sectors: Sector[];
|
|
12
14
|
cursors: SectorCursor[];
|
|
13
15
|
index: Flat3DIndex;
|
|
14
16
|
constructor();
|
|
17
|
+
private updateBounds;
|
|
15
18
|
private _snapShot;
|
|
16
19
|
private _centeralCursor;
|
|
17
20
|
getCenteralCursor(): SectionCursor | null;
|
|
@@ -3,11 +3,13 @@ import { WorldSpaces } from "../WorldSpaces";
|
|
|
3
3
|
import { Sector } from "../Sector";
|
|
4
4
|
import { SectorCursor } from "../Cursor/SectorCursor";
|
|
5
5
|
import { SectionCursor } from "../Cursor/SectionCursor";
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
|
|
6
7
|
const tempPosition = Vector3Like.Create();
|
|
7
8
|
export class SectionSnapshotCursor {
|
|
8
9
|
origin = Vector3Like.Create();
|
|
9
10
|
sectorOrigin = Vector3Like.Create();
|
|
10
11
|
dimension = 0;
|
|
12
|
+
volumeBounds = new BoundingBox();
|
|
11
13
|
sectors = [];
|
|
12
14
|
cursors = [];
|
|
13
15
|
index = Flat3DIndex.GetXYZOrder();
|
|
@@ -29,6 +31,10 @@ export class SectionSnapshotCursor {
|
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
this.updateBounds();
|
|
35
|
+
}
|
|
36
|
+
updateBounds() {
|
|
37
|
+
this.volumeBounds.setMinMax(Vector3Like.Create(WorldSpaces.world.bounds.MinX, WorldSpaces.world.bounds.MinY, WorldSpaces.world.bounds.MinZ), Vector3Like.Create(WorldSpaces.world.bounds.MaxX, WorldSpaces.world.bounds.MaxY, WorldSpaces.world.bounds.MaxZ));
|
|
32
38
|
}
|
|
33
39
|
_snapShot;
|
|
34
40
|
_centeralCursor = new SectionCursor();
|
package/World/WorldSpaces.js
CHANGED
|
@@ -137,13 +137,13 @@ class VoxelSpace {
|
|
|
137
137
|
}
|
|
138
138
|
class Hash {
|
|
139
139
|
static hashVec3(vector3) {
|
|
140
|
-
return `${vector3.x}
|
|
140
|
+
return `${vector3.x}_${vector3.y}_${vector3.z}`;
|
|
141
141
|
}
|
|
142
142
|
static hashVec3Array(vector3) {
|
|
143
|
-
return `${vector3[0]}
|
|
143
|
+
return `${vector3[0]}_${vector3[1]}_${vector3[2]}`;
|
|
144
144
|
}
|
|
145
145
|
static hashXYZ(x, y, z) {
|
|
146
|
-
return `${x}
|
|
146
|
+
return `${x}_${y}_${z}`;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
export class WorldSpaces {
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
import { VoxelFaces } from "../../Math";
|
|
1
2
|
import { WorldCursor } from "../../World/Cursor/WorldCursor";
|
|
2
3
|
import { DimensionSegment } from "./DimensionSegment";
|
|
3
4
|
import { Vector3Like } from "@amodx/math";
|
|
4
5
|
import { PriorityQueue } from "../../Util/PriorityQueue";
|
|
5
6
|
import { VoxelUpdate } from "../Voxels/Behaviors";
|
|
7
|
+
import { SimulationBrush } from "../Tools/SimulationBrush";
|
|
6
8
|
declare class UpdatedBounds {
|
|
7
9
|
displayMin: Vector3Like;
|
|
8
10
|
displayMax: Vector3Like;
|
|
9
11
|
dimension: number;
|
|
10
12
|
start(dimension?: number): void;
|
|
11
13
|
updateDisplay(x: number, y: number, z: number): void;
|
|
12
|
-
markDisplayDirty():
|
|
14
|
+
markDisplayDirty(): boolean;
|
|
13
15
|
}
|
|
14
16
|
export declare class DimensionSimulation {
|
|
15
17
|
dimension: DimensionSegment;
|
|
16
18
|
private cursor;
|
|
17
19
|
nDataCursor: WorldCursor;
|
|
18
20
|
sDataCursor: WorldCursor;
|
|
21
|
+
tickCursor: Record<VoxelFaces, WorldCursor>;
|
|
19
22
|
bounds: UpdatedBounds;
|
|
23
|
+
brush: SimulationBrush;
|
|
20
24
|
updateQueue: PriorityQueue<VoxelUpdate>;
|
|
21
25
|
constructor(dimension: DimensionSegment);
|
|
22
26
|
setOrigin(x: number, y: number, z: number): void;
|