@divinevoxel/vlox 0.0.76 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Builder/Tools/Brush/BrushTool.d.ts +16 -9
- package/Builder/Tools/Brush/BrushTool.js +258 -52
- package/Builder/Tools/BuilderToolBase.d.ts +36 -0
- package/Builder/Tools/BuilderToolBase.js +39 -0
- package/Builder/Tools/Hand/HandTool.d.ts +9 -7
- package/Builder/Tools/Hand/HandTool.js +40 -23
- package/Builder/Tools/Path/PahtTool.d.ts +12 -7
- package/Builder/Tools/Path/PahtTool.js +32 -21
- package/Builder/Tools/Sculpt/SculptTool.d.ts +34 -0
- package/Builder/Tools/Sculpt/SculptTool.js +102 -0
- package/Builder/Tools/Shape/ShapeTool.d.ts +32 -0
- package/Builder/Tools/Shape/ShapeTool.js +78 -0
- package/Builder/Tools/Template/TemplateTool.d.ts +35 -0
- package/Builder/Tools/Template/TemplateTool.js +73 -0
- package/Builder/Tools/Wand/WandTool.d.ts +9 -7
- package/Builder/Tools/Wand/WandTool.js +43 -20
- package/Builder/Tools/Wrench/WrenchTool.d.ts +7 -7
- package/Builder/Tools/Wrench/WrenchTool.js +22 -13
- package/Builder/Util/FreeBoxSelection.d.ts +12 -0
- package/Builder/Util/FreeBoxSelection.js +21 -0
- package/Builder/Util/FreePointSelection.d.ts +14 -0
- package/Builder/Util/FreePointSelection.js +39 -0
- package/Builder/Util/SurfaceBoxSelection.d.ts +12 -0
- package/Builder/{Tools/Box/BoxSelection.js → Util/SurfaceBoxSelection.js} +1 -3
- package/Builder/VoxelBuildSpace.d.ts +37 -25
- package/Builder/VoxelBuildSpace.js +99 -40
- package/Builder/World/InitTasks.js +17 -22
- package/Mesher/Geomtry/Proto/ProtoMesh.d.ts +18 -0
- package/Mesher/Geomtry/Proto/ProtoMesh.js +73 -0
- package/Mesher/Geomtry/{VoxelMeshBuffers.d.ts → Proto/ProtoMeshBuffer.d.ts} +2 -2
- package/Mesher/Geomtry/{VoxelMeshBuffers.js → Proto/ProtoMeshBuffer.js} +2 -2
- package/Mesher/Geomtry/Shapes/Box.d.ts +2 -9
- package/Mesher/Geomtry/Shapes/Box.js +7 -12
- package/Mesher/Geomtry/Transform/TransformBox.js +5 -2
- package/Mesher/InitMesher.js +4 -4
- package/Mesher/InitTask.js +2 -2
- package/Mesher/Items/Base/CompactItemMesh.d.ts +3 -0
- package/Mesher/Items/Base/CompactItemMesh.js +20 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.d.ts +5 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.js +131 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.d.ts +48 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.js +114 -0
- package/Mesher/Items/MeshTexture.d.ts +1 -0
- package/Mesher/Items/MeshTexture.js +214 -0
- package/Mesher/Items/MeshTextureO.js +277 -0
- package/Mesher/Items/Models/ItemModelBuilder.d.ts +27 -0
- package/Mesher/Items/Models/ItemModelBuilder.js +64 -0
- package/Mesher/Types/ItemMesh.types.d.ts +5 -0
- package/Mesher/Types/ItemMesh.types.js +12 -0
- package/Mesher/Types/Mesher.types.d.ts +15 -9
- package/Mesher/Types/Mesher.types.js +14 -0
- package/Mesher/Types/VoxelMesh.types.js +7 -6
- package/Mesher/Voxels/Base/CompactTemplateMesh.d.ts +3 -0
- package/Mesher/{Functions/CompactVoxelMesh.js → Voxels/Base/CompactTemplateMesh.js} +4 -40
- package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.d.ts +2 -2
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.js +9 -8
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.d.ts +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.d.ts +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.js +2 -2
- package/Mesher/Voxels/MeshTemplate.d.ts +3 -0
- package/Mesher/Voxels/MeshTemplate.js +81 -0
- package/Mesher/{Functions → Voxels}/MeshVoxel.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/MeshVoxel.js +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.js +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/GetTexture.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.js +14 -16
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.d.ts +2 -2
- package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +24 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/ConsistentRotationTextureProcedure.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -5
- package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +205 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +28 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +109 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.js +2 -0
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.js +3 -3
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.d.ts +7 -7
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.js +6 -5
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.js +1 -1
- package/Renderer/Classes/DVESectionMeshes.d.ts +1 -1
- package/Renderer/MeshManager.js +1 -1
- package/Settings/EngineSettings.types.d.ts +2 -1
- package/Settings/EngineSettings.types.js +3 -1
- package/Tasks/Paint/Common.js +14 -9
- package/Tasks/Paint/Erase/EraseVoxelSelection.d.ts +4 -0
- package/Tasks/Paint/Erase/EraseVoxelSelection.js +33 -0
- package/Tasks/Paint/Erase/EraseVoxelTemplate.js +1 -2
- package/Tasks/Paint/Paint/PaintVoxel.js +1 -1
- package/Tasks/Paint/Paint/PaintVoxelTemplate.js +1 -1
- package/Tasks/Propagation/Illumanation/RGBUpdate.js +1 -1
- package/Tasks/Tasks.types.d.ts +2 -0
- package/Tasks/TasksIds.d.ts +1 -0
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/WorldGeneration/InitTasks.js +3 -1
- package/Templates/Archive/ArchivedVoxelTemplate.d.ts +5 -5
- package/Templates/Archive/ArchivedVoxelTemplate.js +52 -49
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +0 -2
- package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +0 -1
- package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +0 -2
- package/Templates/Cursor/TemplateCursor.d.ts +6 -1
- package/Templates/Cursor/TemplateCursor.js +13 -2
- package/Templates/Cursor/TemplateProxy.js +1 -6
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
- package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
- package/Templates/Full/FullVoxelTemplate.d.ts +4 -4
- package/Templates/Full/FullVoxelTemplate.js +29 -18
- package/Templates/Functions/ExtrudeSelection.d.ts +5 -0
- package/Templates/Functions/ExtrudeSelection.js +44 -0
- package/Templates/Functions/FillSelection.d.ts +4 -0
- package/Templates/Functions/FillSelection.js +20 -0
- package/Templates/Functions/FlipTemplate.d.ts +2 -2
- package/Templates/Functions/FlipTemplate.js +8 -8
- package/Templates/Functions/RotateTemplate.d.ts +2 -2
- package/Templates/Path/VoxelPath.js +2 -1
- package/Templates/Selection/VoxelBFSSelection.d.ts +3 -6
- package/Templates/Selection/VoxelBFSSelection.js +20 -24
- package/Templates/Selection/{VoxelBoxSelection.d.ts → VoxelBoundsSelection.d.ts} +9 -6
- package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +29 -22
- package/Templates/Selection/VoxelPointSelection.d.ts +8 -6
- package/Templates/Selection/VoxelPointSelection.js +25 -24
- package/Templates/Selection/VoxelSelection.d.ts +18 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +5 -12
- package/Templates/Selection/VoxelSurfaceSelection.js +76 -90
- package/Templates/Selection/VoxelTemplateSelection.d.ts +10 -4
- package/Templates/Selection/VoxelTemplateSelection.js +18 -10
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +92 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +37 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +137 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +20 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +61 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.d.ts +5 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.js +1 -0
- package/Templates/Shapes/VoxelShape.types.d.ts +2 -0
- package/Templates/Shapes/VoxelShape.types.js +8 -0
- package/Templates/Shapes/VoxelShapeTemplate.d.ts +37 -0
- package/Templates/Shapes/{BasicVoxelShapeTemplate.js → VoxelShapeTemplate.js} +43 -37
- package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +4 -13
- package/Templates/Shapes/VoxelShapeTemplate.types.js +0 -1
- package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
- package/Templates/VoxelTemplateRegister.js +60 -0
- package/Templates/VoxelTemplates.types.d.ts +2 -3
- package/Textures/Classes/CompiledTexture.d.ts +2 -0
- package/Textures/Classes/CompiledTexture.js +19 -1
- package/Textures/Functions/BuildTextureData.js +13 -0
- package/Textures/TextureManager.d.ts +1 -0
- package/Textures/TextureManager.js +11 -5
- package/Tools/Brush/Brush.d.ts +2 -0
- package/Tools/Brush/Brush.js +19 -0
- package/Tools/Tasks/TasksTool.d.ts +2 -1
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
- package/Voxels/Cursor/VoxelLightData.js +2 -2
- package/Voxels/Functions/BuildTagData.js +1 -1
- package/Voxels/Indexes/VoxelIndex.d.ts +1 -0
- package/Voxels/Indexes/VoxelIndex.js +11 -13
- package/Voxels/InitVoxelData.js +5 -14
- package/Voxels/Interaction/Functions/PickVoxel.d.ts +0 -5
- package/Voxels/Interaction/Functions/PickVoxel.js +64 -85
- package/Voxels/Interaction/Functions/PickVoxelWorld.js +6 -3
- package/Voxels/Models/CompiledVoxelModel.types.d.ts +1 -1
- package/Voxels/Models/Defaults/CubeVoxelGeometry.js +11 -0
- package/Voxels/Models/Defaults/CubeVoxelModels.js +44 -99
- package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -3
- package/Voxels/Models/Defaults/PanelVoxelGeometry.js +2 -226
- package/Voxels/Models/Defaults/PanelVoxelModels.d.ts +1 -0
- package/Voxels/Models/Defaults/PanelVoxelModels.js +100 -258
- package/Voxels/Models/Defaults/StairVoxelModel.js +2 -2
- package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +4 -1
- package/Voxels/Models/Rules/Classes/GeomtryInput.js +26 -5
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +23 -8
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +1 -1
- package/Voxels/Models/VoxelModel.types.d.ts +6 -1
- package/Voxels/Types/PaintVoxelData.d.ts +2 -0
- package/Voxels/Types/PaintVoxelData.js +51 -0
- package/World/Cursor/SectionCursor.d.ts +4 -0
- package/World/Cursor/SectionCursor.js +13 -16
- package/World/Cursor/SectorCursor.d.ts +4 -0
- package/World/Cursor/SectorCursor.js +13 -16
- package/World/Cursor/WorldCursor.d.ts +4 -0
- package/World/Cursor/WorldCursor.js +8 -0
- package/World/Sector/SectorHeightMap.d.ts +6 -0
- package/World/Sector/SectorHeightMap.js +6 -0
- package/World/SnapShot/SectionSnapShotCursor.d.ts +3 -0
- package/World/SnapShot/SectionSnapShotCursor.js +6 -0
- package/World/WorldSpaces.js +3 -3
- package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +5 -1
- package/WorldSimulation/Dimensions/DimensionSimulation.js +12 -0
- package/WorldSimulation/Dimensions/Generator.d.ts +1 -0
- package/WorldSimulation/Dimensions/Generator.js +1 -0
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +3 -0
- package/WorldSimulation/Dimensions/SimulationSector.js +71 -41
- package/WorldSimulation/Internal/WorldSimulationTasks.js +5 -2
- package/WorldSimulation/Procedures/BuildOnly.d.ts +10 -0
- package/WorldSimulation/Procedures/BuildOnly.js +55 -0
- package/WorldSimulation/Procedures/InitalLoad.js +3 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +2 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.js +11 -3
- package/WorldSimulation/Tasks/TaskSegment.d.ts +2 -1
- package/WorldSimulation/Tasks/TaskSegment.js +3 -1
- package/WorldSimulation/Tick/TickQueue.d.ts +2 -0
- package/WorldSimulation/Tick/TickQueue.js +26 -0
- package/WorldSimulation/Tools/SimulationBrush.d.ts +3 -0
- package/WorldSimulation/Tools/SimulationBrush.js +52 -0
- package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +3 -0
- package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -1
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +2 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +6 -0
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +39 -14
- package/WorldSimulation/WorldSimulation.d.ts +10 -0
- package/WorldSimulation/WorldSimulation.js +41 -1
- package/package.json +1 -30
- package/Builder/Tools/Box/BoxSelection.d.ts +0 -12
- package/Builder/Tools/Box/BoxTool.d.ts +0 -31
- package/Builder/Tools/Box/BoxTool.js +0 -91
- package/Builder/Tools/Box/BoxToolTemplate.d.ts +0 -13
- package/Builder/Tools/Box/BoxToolTemplate.js +0 -23
- package/Builder/VoxelBuilder.types.d.ts +0 -0
- package/Builder/VoxelBuilder.types.js +0 -1
- package/Mesher/Functions/CompactVoxelMesh.d.ts +0 -3
- package/Mesher/Functions/MeshTexture.js +0 -278
- package/Mesher/Geomtry/VoxelMesh.d.ts +0 -12
- package/Mesher/Geomtry/VoxelMesh.js +0 -25
- package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +0 -25
- package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +0 -162
- package/Templates/Selection/VoxelSelecton.d.ts +0 -9
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -36
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/BoxVoxelTemplate.js +0 -83
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/ConeVoxelTemplate.js +0 -73
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/CylinderVoxelTemplate.js +0 -73
- package/Templates/Shapes/EllipsoidVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/EllipsoidVoxelTemplate.js +0 -89
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -73
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -31
- package/Templates/Shapes/PyramidVoxelTemplate.js +0 -148
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -15
- package/Templates/Shapes/SphereVoxelTemplate.js +0 -59
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -23
- package/Templates/Shapes/TorusVoxelTemplate.js +0 -73
- package/Templates/VoxelTempateRegister.js +0 -30
- /package/Mesher/{Functions/MeshTexture.d.ts → Items/MeshTextureO.d.ts} +0 -0
- /package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/GetTexture.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.js +0 -0
- /package/Templates/Selection/{VoxelSelecton.js → VoxelSelection.js} +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { TextureProcedure, } from "../TextureProcedure";
|
|
2
|
+
import { VoxelFaceDirections, VoxelFaces } from "../../../../../Math/index.js";
|
|
3
|
+
const textureMap = [
|
|
4
|
+
"top",
|
|
5
|
+
"corner-top-right",
|
|
6
|
+
"corner-top-left",
|
|
7
|
+
"corner-top-left-top-right",
|
|
8
|
+
"bottom",
|
|
9
|
+
"corner-bottom-right",
|
|
10
|
+
"corner-bottom-left",
|
|
11
|
+
"corner-bottom-left-bottom-right",
|
|
12
|
+
"right",
|
|
13
|
+
"left",
|
|
14
|
+
];
|
|
15
|
+
/*
|
|
16
|
+
0 -> normal direction
|
|
17
|
+
1 -> top right
|
|
18
|
+
2 -> top left
|
|
19
|
+
*/
|
|
20
|
+
const uvsSets = {
|
|
21
|
+
//top bottom faces
|
|
22
|
+
north: {
|
|
23
|
+
0b0: 0,
|
|
24
|
+
0b101: 1,
|
|
25
|
+
0b011: 2,
|
|
26
|
+
0b001: 3,
|
|
27
|
+
},
|
|
28
|
+
south: {
|
|
29
|
+
0b0: 4,
|
|
30
|
+
0b101: 5,
|
|
31
|
+
0b011: 6,
|
|
32
|
+
0b001: 7,
|
|
33
|
+
},
|
|
34
|
+
east: {
|
|
35
|
+
0b0: 8,
|
|
36
|
+
},
|
|
37
|
+
west: {
|
|
38
|
+
0b0: 9,
|
|
39
|
+
},
|
|
40
|
+
//side faces
|
|
41
|
+
top: {
|
|
42
|
+
0b0: 0,
|
|
43
|
+
0b101: 1,
|
|
44
|
+
0b011: 2,
|
|
45
|
+
0b001: 3,
|
|
46
|
+
},
|
|
47
|
+
bottom: {
|
|
48
|
+
0b0: 4,
|
|
49
|
+
0b101: 5,
|
|
50
|
+
0b011: 6,
|
|
51
|
+
0b001: 7,
|
|
52
|
+
},
|
|
53
|
+
right: {
|
|
54
|
+
0b0: 8,
|
|
55
|
+
},
|
|
56
|
+
left: {
|
|
57
|
+
0b0: 9,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
const CheckSets = {
|
|
61
|
+
[VoxelFaces.Up]: {
|
|
62
|
+
north: [
|
|
63
|
+
[0, 0, 1],
|
|
64
|
+
[1, 0, 1],
|
|
65
|
+
[-1, 0, 1],
|
|
66
|
+
],
|
|
67
|
+
south: [
|
|
68
|
+
[0, 0, -1],
|
|
69
|
+
[1, 0, -1],
|
|
70
|
+
[-1, 0, -1],
|
|
71
|
+
],
|
|
72
|
+
east: [[1, 0, 0]],
|
|
73
|
+
west: [[-1, 0, 0]],
|
|
74
|
+
},
|
|
75
|
+
[VoxelFaces.Down]: {
|
|
76
|
+
north: [
|
|
77
|
+
[0, 0, 1],
|
|
78
|
+
[1, 0, 1],
|
|
79
|
+
[-1, 0, 1],
|
|
80
|
+
],
|
|
81
|
+
south: [
|
|
82
|
+
[0, 0, -1],
|
|
83
|
+
[1, 0, -1],
|
|
84
|
+
[-1, 0, -1],
|
|
85
|
+
],
|
|
86
|
+
east: [[-1, 0, 0]],
|
|
87
|
+
west: [[1, 0, 0]],
|
|
88
|
+
},
|
|
89
|
+
[VoxelFaces.North]: {
|
|
90
|
+
north: [
|
|
91
|
+
[0, 1, 0],
|
|
92
|
+
[1, 1, 0],
|
|
93
|
+
[-1, 1, 0],
|
|
94
|
+
],
|
|
95
|
+
south: [
|
|
96
|
+
[0, -1, 0],
|
|
97
|
+
[1, -1, 0],
|
|
98
|
+
[-1, -1, 0],
|
|
99
|
+
],
|
|
100
|
+
east: [[-1, 0, 0]],
|
|
101
|
+
west: [[1, 0, 0]],
|
|
102
|
+
},
|
|
103
|
+
[VoxelFaces.South]: {
|
|
104
|
+
north: [
|
|
105
|
+
[0, 1, 0],
|
|
106
|
+
[1, 1, 0],
|
|
107
|
+
[-1, 1, 0],
|
|
108
|
+
],
|
|
109
|
+
south: [
|
|
110
|
+
[0, -1, 0],
|
|
111
|
+
[1, -1, 0],
|
|
112
|
+
[-1, -1, 0],
|
|
113
|
+
],
|
|
114
|
+
east: [[1, 0, 0]],
|
|
115
|
+
west: [[-1, 0, 0]],
|
|
116
|
+
},
|
|
117
|
+
[VoxelFaces.East]: {
|
|
118
|
+
north: [
|
|
119
|
+
[0, 1, 0],
|
|
120
|
+
[0, 1, 1],
|
|
121
|
+
[0, 1, -1],
|
|
122
|
+
],
|
|
123
|
+
south: [
|
|
124
|
+
[0, -1, 0],
|
|
125
|
+
[0, -1, 1],
|
|
126
|
+
[0, -1, -1],
|
|
127
|
+
],
|
|
128
|
+
east: [[0, 0, 1]],
|
|
129
|
+
west: [[0, 0, -1]],
|
|
130
|
+
},
|
|
131
|
+
[VoxelFaces.West]: {
|
|
132
|
+
north: [
|
|
133
|
+
[0, 1, 0],
|
|
134
|
+
[0, 1, 1],
|
|
135
|
+
[0, 1, -1],
|
|
136
|
+
],
|
|
137
|
+
south: [
|
|
138
|
+
[0, -1, 0],
|
|
139
|
+
[0, -1, 1],
|
|
140
|
+
[0, -1, -1],
|
|
141
|
+
],
|
|
142
|
+
east: [[0, 0, -1]],
|
|
143
|
+
west: [[0, 0, 1]],
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
const generateCheck = (direction, tool, normal, sets) => {
|
|
147
|
+
const { x, y, z } = tool.position;
|
|
148
|
+
let key = 0b0;
|
|
149
|
+
for (let i = 0; i < sets.length; i++) {
|
|
150
|
+
const set = sets[i];
|
|
151
|
+
const cx = x + set[0];
|
|
152
|
+
const cy = y + set[1];
|
|
153
|
+
const cz = z + set[2];
|
|
154
|
+
const sameLevelCheck = tool.nVoxel
|
|
155
|
+
.getVoxel(cx, cy, cz)
|
|
156
|
+
?.isSameVoxel(tool.voxel);
|
|
157
|
+
let normalCheck = true;
|
|
158
|
+
const nVoxel = tool.nVoxel.getVoxel(cx + normal[0], cy + normal[1], cz + normal[2]);
|
|
159
|
+
if (nVoxel && nVoxel.isRenderable() && nVoxel.isOpaque()) {
|
|
160
|
+
normalCheck = false;
|
|
161
|
+
}
|
|
162
|
+
if (sameLevelCheck && normalCheck) {
|
|
163
|
+
key |= 0b1 << i;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
key |= 0b0 << i;
|
|
167
|
+
if (i == 0)
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (uvsSets[direction][key] == undefined)
|
|
172
|
+
return 0;
|
|
173
|
+
const index = uvsSets[direction][key];
|
|
174
|
+
return textureMap[index];
|
|
175
|
+
};
|
|
176
|
+
export class OutlinedTextureProcedure extends TextureProcedure {
|
|
177
|
+
getTexture(builder, data, closestFace, primitive) {
|
|
178
|
+
return data.texture;
|
|
179
|
+
}
|
|
180
|
+
getOverlayTexture(builder, data, closestFace, primitive, ref) {
|
|
181
|
+
const set = CheckSets[closestFace];
|
|
182
|
+
const normal = VoxelFaceDirections[closestFace];
|
|
183
|
+
const isTopOrBottom = closestFace === VoxelFaces.Up || closestFace === VoxelFaces.Down;
|
|
184
|
+
// For top/bottom faces, use north/south/east/west sets.
|
|
185
|
+
// For side faces (north/south/east/west), use top/bottom/right/left sets.
|
|
186
|
+
const dirNorth = isTopOrBottom ? "north" : "top";
|
|
187
|
+
const dirSouth = isTopOrBottom ? "south" : "bottom";
|
|
188
|
+
const dirEast = isTopOrBottom ? "east" : "right";
|
|
189
|
+
const dirWest = isTopOrBottom ? "west" : "left";
|
|
190
|
+
const x = generateCheck(dirNorth, builder, normal, set.north);
|
|
191
|
+
if (x)
|
|
192
|
+
ref.x = data.textureRecrod[x];
|
|
193
|
+
const y = generateCheck(dirSouth, builder, normal, set.south);
|
|
194
|
+
if (y)
|
|
195
|
+
ref.y = data.textureRecrod[y];
|
|
196
|
+
const z = generateCheck(dirEast, builder, normal, set.east);
|
|
197
|
+
if (z)
|
|
198
|
+
ref.z = data.textureRecrod[z];
|
|
199
|
+
const w = generateCheck(dirWest, builder, normal, set.west);
|
|
200
|
+
if (w)
|
|
201
|
+
ref.w = data.textureRecrod[w];
|
|
202
|
+
return ref;
|
|
203
|
+
}
|
|
204
|
+
transformUVs(builder, data, closestFace, primitive) { }
|
|
205
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Vector4Like } from "@amodx/math";
|
|
2
|
+
import type { Quad } from "../../../../Geomtry";
|
|
3
|
+
import { VoxelModelBuilder } from "Mesher/Voxels/Models/VoxelModelBuilder";
|
|
4
|
+
import { TextureProcedure, BaseVoxelGeomtryTextureProcedureData } from "../TextureProcedure";
|
|
5
|
+
import { TextureId } from "../../../../../Textures";
|
|
6
|
+
import { VoxelFaces } from "../../../../../Math";
|
|
7
|
+
/**
|
|
8
|
+
* Extend your data type so we can add a seed if we want, and define
|
|
9
|
+
* the rotations we can choose from.
|
|
10
|
+
*/
|
|
11
|
+
export interface PillarTextureProcedureData extends BaseVoxelGeomtryTextureProcedureData {
|
|
12
|
+
type: "pillar";
|
|
13
|
+
texture: TextureId | number;
|
|
14
|
+
textureRecrod: {
|
|
15
|
+
sideConnectedTex: TextureId | number;
|
|
16
|
+
sideDisconnectedTex: TextureId | number;
|
|
17
|
+
sideUpTex: TextureId | number;
|
|
18
|
+
sideDownTex: TextureId | number;
|
|
19
|
+
upTex: TextureId | number;
|
|
20
|
+
downTex: TextureId | number;
|
|
21
|
+
};
|
|
22
|
+
direction: "up-down" | "north-south" | "east-west";
|
|
23
|
+
}
|
|
24
|
+
export declare class PillarTextureProcedure extends TextureProcedure<PillarTextureProcedureData> {
|
|
25
|
+
getTexture(builder: VoxelModelBuilder, data: PillarTextureProcedureData, closestFace: VoxelFaces, primitive: Quad): number;
|
|
26
|
+
getOverlayTexture(builder: VoxelModelBuilder, data: PillarTextureProcedureData, closestFace: VoxelFaces, primitive: Quad, ref: Vector4Like): Vector4Like;
|
|
27
|
+
transformUVs(builder: VoxelModelBuilder, data: PillarTextureProcedureData, closestFace: VoxelFaces, primitive: Quad): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { TextureProcedure, } from "../TextureProcedure";
|
|
2
|
+
import { VoxelFaces } from "../../../../../Math";
|
|
3
|
+
export class PillarTextureProcedure extends TextureProcedure {
|
|
4
|
+
getTexture(builder, data, closestFace, primitive) {
|
|
5
|
+
if (data.direction == "up-down") {
|
|
6
|
+
if (closestFace == VoxelFaces.Up)
|
|
7
|
+
return data.textureRecrod.upTex;
|
|
8
|
+
if (closestFace == VoxelFaces.Down)
|
|
9
|
+
return data.textureRecrod.downTex;
|
|
10
|
+
let sideTexture = data.textureRecrod.sideDisconnectedTex;
|
|
11
|
+
const topVoxel = builder.nVoxel.getVoxel(builder.position.x, builder.position.y + 1, builder.position.z);
|
|
12
|
+
const topSame = topVoxel ? builder.voxel.isSameVoxel(topVoxel) : false;
|
|
13
|
+
const bottomVoxel = builder.nVoxel.getVoxel(builder.position.x, builder.position.y - 1, builder.position.z);
|
|
14
|
+
const bottomSame = bottomVoxel
|
|
15
|
+
? builder.voxel.isSameVoxel(bottomVoxel)
|
|
16
|
+
: false;
|
|
17
|
+
if (topSame && !bottomSame) {
|
|
18
|
+
sideTexture = data.textureRecrod.sideDownTex;
|
|
19
|
+
}
|
|
20
|
+
if (!topSame && bottomSame) {
|
|
21
|
+
sideTexture = data.textureRecrod.sideUpTex;
|
|
22
|
+
}
|
|
23
|
+
if (topSame && bottomSame) {
|
|
24
|
+
sideTexture = data.textureRecrod.sideConnectedTex;
|
|
25
|
+
}
|
|
26
|
+
if (closestFace == VoxelFaces.North ||
|
|
27
|
+
closestFace == VoxelFaces.South ||
|
|
28
|
+
closestFace == VoxelFaces.East ||
|
|
29
|
+
closestFace == VoxelFaces.West)
|
|
30
|
+
return sideTexture;
|
|
31
|
+
}
|
|
32
|
+
if (data.direction == "north-south") {
|
|
33
|
+
if (closestFace == VoxelFaces.North)
|
|
34
|
+
return data.textureRecrod.upTex;
|
|
35
|
+
if (closestFace == VoxelFaces.South)
|
|
36
|
+
return data.textureRecrod.downTex;
|
|
37
|
+
let sideTexture = data.textureRecrod.sideDisconnectedTex;
|
|
38
|
+
const northVoxel = builder.nVoxel.getVoxel(builder.position.x, builder.position.y, builder.position.z + 1);
|
|
39
|
+
const northSame = northVoxel
|
|
40
|
+
? builder.voxel.isSameVoxel(northVoxel)
|
|
41
|
+
: false;
|
|
42
|
+
const southVoxel = builder.nVoxel.getVoxel(builder.position.x, builder.position.y, builder.position.z - 1);
|
|
43
|
+
const southSame = southVoxel
|
|
44
|
+
? builder.voxel.isSameVoxel(southVoxel)
|
|
45
|
+
: false;
|
|
46
|
+
if (northSame && !southSame) {
|
|
47
|
+
sideTexture = data.textureRecrod.sideDownTex;
|
|
48
|
+
}
|
|
49
|
+
if (!northSame && southSame) {
|
|
50
|
+
sideTexture = data.textureRecrod.sideUpTex;
|
|
51
|
+
}
|
|
52
|
+
if (northSame && southSame) {
|
|
53
|
+
sideTexture = data.textureRecrod.sideConnectedTex;
|
|
54
|
+
}
|
|
55
|
+
if (closestFace == VoxelFaces.Up ||
|
|
56
|
+
closestFace == VoxelFaces.Down ||
|
|
57
|
+
closestFace == VoxelFaces.East ||
|
|
58
|
+
closestFace == VoxelFaces.West)
|
|
59
|
+
return sideTexture;
|
|
60
|
+
}
|
|
61
|
+
if (data.direction == "east-west") {
|
|
62
|
+
if (closestFace == VoxelFaces.East)
|
|
63
|
+
return data.textureRecrod.upTex;
|
|
64
|
+
if (closestFace == VoxelFaces.West)
|
|
65
|
+
return data.textureRecrod.downTex;
|
|
66
|
+
let sideTexture = data.textureRecrod.sideDisconnectedTex;
|
|
67
|
+
const eastVoxel = builder.nVoxel.getVoxel(builder.position.x + 1, builder.position.y, builder.position.z);
|
|
68
|
+
const northSame = eastVoxel
|
|
69
|
+
? builder.voxel.isSameVoxel(eastVoxel)
|
|
70
|
+
: false;
|
|
71
|
+
const westVoxel = builder.nVoxel.getVoxel(builder.position.x - 1, builder.position.y, builder.position.z);
|
|
72
|
+
const westSame = westVoxel ? builder.voxel.isSameVoxel(westVoxel) : false;
|
|
73
|
+
if (northSame && !westSame) {
|
|
74
|
+
sideTexture = data.textureRecrod.sideDownTex;
|
|
75
|
+
}
|
|
76
|
+
if (!northSame && westSame) {
|
|
77
|
+
sideTexture = data.textureRecrod.sideUpTex;
|
|
78
|
+
}
|
|
79
|
+
if (northSame && westSame) {
|
|
80
|
+
sideTexture = data.textureRecrod.sideConnectedTex;
|
|
81
|
+
}
|
|
82
|
+
if (closestFace == VoxelFaces.Up ||
|
|
83
|
+
closestFace == VoxelFaces.Down ||
|
|
84
|
+
closestFace == VoxelFaces.North ||
|
|
85
|
+
closestFace == VoxelFaces.South)
|
|
86
|
+
return sideTexture;
|
|
87
|
+
}
|
|
88
|
+
throw new Error(`Invalid direction for pillar box texture procedure | ${data.direction}`);
|
|
89
|
+
}
|
|
90
|
+
getOverlayTexture(builder, data, closestFace, primitive, ref) {
|
|
91
|
+
return ref;
|
|
92
|
+
}
|
|
93
|
+
transformUVs(builder, data, closestFace, primitive) {
|
|
94
|
+
if ((data.direction == "north-south" &&
|
|
95
|
+
(closestFace == VoxelFaces.East || closestFace == VoxelFaces.West)) ||
|
|
96
|
+
(data.direction == "east-west" &&
|
|
97
|
+
(closestFace == VoxelFaces.North ||
|
|
98
|
+
closestFace == VoxelFaces.South ||
|
|
99
|
+
closestFace == VoxelFaces.Up ||
|
|
100
|
+
closestFace == VoxelFaces.Down))) {
|
|
101
|
+
for (const v of primitive.uvs.vertices) {
|
|
102
|
+
const oldX = v.x;
|
|
103
|
+
const oldY = v.y;
|
|
104
|
+
v.x = 1 - oldY;
|
|
105
|
+
v.y = oldX;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Vector4Like } from "@amodx/math";
|
|
2
|
-
import { Quad, Triangle } from "
|
|
2
|
+
import { Quad, Triangle } from "../../../Geomtry";
|
|
3
3
|
import { VoxelModelBuilder } from "../VoxelModelBuilder";
|
|
4
|
-
import { VoxelFaces } from "
|
|
5
|
-
import { TextureId } from "
|
|
4
|
+
import { VoxelFaces } from "../../../../Math";
|
|
5
|
+
import { TextureId } from "../../../../Textures";
|
|
6
6
|
export interface BaseVoxelGeomtryTextureProcedureData {
|
|
7
7
|
type: string;
|
|
8
8
|
texture?: TextureId | number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConsistentRotationTextureProcedure } from "./Default/ConsistentRotationTextureProcedure";
|
|
2
2
|
import { OutlinedTextureProcedure } from "./Default/OutlinedTextureProcedure";
|
|
3
|
+
import { PillarTextureProcedure } from "./Default/PillarTextureProcedure";
|
|
3
4
|
export class TextureProcedureRegister {
|
|
4
5
|
static procedures = new Map();
|
|
5
6
|
static register(id, procedure) {
|
|
@@ -14,3 +15,4 @@ export class TextureProcedureRegister {
|
|
|
14
15
|
}
|
|
15
16
|
TextureProcedureRegister.register("consistent-rotation", new ConsistentRotationTextureProcedure());
|
|
16
17
|
TextureProcedureRegister.register("outlined", new OutlinedTextureProcedure());
|
|
18
|
+
TextureProcedureRegister.register("pillar", new PillarTextureProcedure());
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VoxelModelBuilder } from "./VoxelModelBuilder";
|
|
2
|
-
import { CompiledVoxelModelInputData, CompiledVoxelModelData } from "
|
|
3
|
-
import { StateSchema } from "
|
|
4
|
-
import { StateTreeReader } from "
|
|
2
|
+
import { CompiledVoxelModelInputData, CompiledVoxelModelData } from "../../../Voxels/Models/CompiledVoxelModel.types";
|
|
3
|
+
import { StateSchema } from "../../../Voxels/State/Schema/StateSchema";
|
|
4
|
+
import { StateTreeReader } from "../../../Voxels/State/StateTreeReader";
|
|
5
5
|
import { VoxelModelEffect } from "./VoxelModelEffect";
|
|
6
|
-
import { CondtionalTreeReader } from "
|
|
6
|
+
import { CondtionalTreeReader } from "../../../Voxels/State/CondiotnalTreeReader";
|
|
7
7
|
export declare class VoxelConstructor {
|
|
8
8
|
id: string;
|
|
9
9
|
builder: VoxelModelBuilder;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VoxelModelConstructorRegister } from "./VoxelModelConstructorRegister";
|
|
2
|
-
import { StateSchema } from "
|
|
3
|
-
import { StateTreeReader } from "
|
|
2
|
+
import { StateSchema } from "../../../Voxels/State/Schema/StateSchema";
|
|
3
|
+
import { StateTreeReader } from "../../../Voxels/State/StateTreeReader";
|
|
4
4
|
import { VoxelModelEffect } from "./VoxelModelEffect";
|
|
5
|
-
import { CondtionalTreeReader } from "
|
|
5
|
+
import { CondtionalTreeReader } from "../../../Voxels/State/CondiotnalTreeReader";
|
|
6
6
|
export class VoxelConstructor {
|
|
7
7
|
id;
|
|
8
8
|
builder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataCursorInterface } from "
|
|
1
|
+
import { DataCursorInterface } from "../../../Voxels/Cursor/DataCursor.interface";
|
|
2
2
|
import { Vec3Array, Vector3Like } from "@amodx/math";
|
|
3
|
-
import { VoxelCursor } from "
|
|
3
|
+
import { VoxelCursor } from "../../../Voxels/Cursor/VoxelCursor";
|
|
4
4
|
export declare class VoxelGeometryBuilderCacheSpace {
|
|
5
5
|
bounds: Vector3Like;
|
|
6
6
|
foundHash: Uint8Array;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VoxelModelConstructorRegister } from "./VoxelModelConstructorRegister";
|
|
2
|
-
import { VoxelCursor } from "
|
|
3
|
-
import { GetYXZOrderArrayIndex } from "
|
|
2
|
+
import { VoxelCursor } from "../../../Voxels/Cursor/VoxelCursor";
|
|
3
|
+
import { GetYXZOrderArrayIndex } from "../../../Math/Indexing";
|
|
4
4
|
export class VoxelGeometryBuilderCacheSpace {
|
|
5
5
|
bounds;
|
|
6
6
|
foundHash;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { QuadScalarVertexData } from "
|
|
2
|
-
import { VoxelFaces } from "
|
|
3
|
-
import { QuadVerticies } from "
|
|
4
|
-
import {
|
|
1
|
+
import { QuadScalarVertexData } from "../../Geomtry/Primitives/QuadVertexData";
|
|
2
|
+
import { VoxelFaces } from "../../../Math";
|
|
3
|
+
import { QuadVerticies } from "../../Geomtry/Geometry.types";
|
|
4
|
+
import { ProtoMesh } from "../../Geomtry/Proto/ProtoMesh";
|
|
5
5
|
import { VoxelMeshBVHBuilder } from "../Geomtry/VoxelMeshBVHBuilder";
|
|
6
6
|
import { Vec3Array, Vector3Like, Vector4Like } from "@amodx/math";
|
|
7
|
-
import { VoxelCursorInterface } from "
|
|
8
|
-
import { DataCursorInterface } from "
|
|
7
|
+
import { VoxelCursorInterface } from "../../../Voxels/Cursor/VoxelCursor.interface.js";
|
|
8
|
+
import { DataCursorInterface } from "../../../Voxels/Cursor/DataCursor.interface.js";
|
|
9
9
|
import { VoxelGeometryBuilderCacheSpace } from "./VoxelGeometryBuilderCacheSpace";
|
|
10
10
|
declare class VoxelVars {
|
|
11
11
|
textureIndex: number;
|
|
@@ -26,7 +26,7 @@ export declare class VoxelModelBuilder {
|
|
|
26
26
|
position: Vector3Like;
|
|
27
27
|
/**The current local origin */
|
|
28
28
|
origin: Vector3Like;
|
|
29
|
-
mesh:
|
|
29
|
+
mesh: ProtoMesh;
|
|
30
30
|
bvhTool: VoxelMeshBVHBuilder | null;
|
|
31
31
|
vars: VoxelVars;
|
|
32
32
|
dataCalculated: Record<VoxelFaces, boolean>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
//tools
|
|
2
2
|
//data
|
|
3
|
-
import { QuadScalarVertexData } from "
|
|
4
|
-
import { VoxelFaces, VoxelFacesArray } from "
|
|
5
|
-
import { QuadVerticies } from "
|
|
3
|
+
import { QuadScalarVertexData } from "../../Geomtry/Primitives/QuadVertexData";
|
|
4
|
+
import { VoxelFaces, VoxelFacesArray } from "../../../Math";
|
|
5
|
+
import { QuadVerticies } from "../../Geomtry/Geometry.types";
|
|
6
6
|
import calculateFaceData from "./Common/Calc/FaceDataCalc.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ProtoMesh } from "../../Geomtry/Proto/ProtoMesh";
|
|
8
8
|
import { Vector3Like, Vector4Like } from "@amodx/math";
|
|
9
|
+
import { VoxelMeshVertexStructCursor } from "../Geomtry/VoxelMeshVertexStructCursor";
|
|
9
10
|
class VoxelVars {
|
|
10
11
|
textureIndex = 0;
|
|
11
12
|
overlayTextures = Vector4Like.Create();
|
|
@@ -31,7 +32,7 @@ export class VoxelModelBuilder {
|
|
|
31
32
|
position = Vector3Like.Create();
|
|
32
33
|
/**The current local origin */
|
|
33
34
|
origin = Vector3Like.Create();
|
|
34
|
-
mesh = new
|
|
35
|
+
mesh = new ProtoMesh(VoxelMeshVertexStructCursor.VertexFloatSize);
|
|
35
36
|
bvhTool = null;
|
|
36
37
|
vars = new VoxelVars();
|
|
37
38
|
dataCalculated;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StringPalette } from "
|
|
2
|
-
import { CompiledVoxelGeometrySyncData, CompiledVoxelModelData } from "
|
|
1
|
+
import { StringPalette } from "../../../Util/StringPalette";
|
|
2
|
+
import { CompiledVoxelGeometrySyncData, CompiledVoxelModelData } from "../../../Voxels/Models/CompiledVoxelModel.types";
|
|
3
3
|
import { GeoemtryNodeConstructor } from "./Nodes/GeometryNode";
|
|
4
4
|
import { VoxelConstructor } from "./VoxelConstructor";
|
|
5
5
|
import { VoxelGeometryConstructor } from "./Nodes/VoxelGeometryConstructor";
|
|
6
|
-
import { AOOcclusionFaceIndex } from "
|
|
7
|
-
import { CulledOcclusionFaceIndex } from "
|
|
6
|
+
import { AOOcclusionFaceIndex } from "../../../Voxels/Models/Indexing/AOOcclusionFaceIndex";
|
|
7
|
+
import { CulledOcclusionFaceIndex } from "../../../Voxels/Models/Indexing/CulledOcclusionFaceIndex";
|
|
8
8
|
export declare class VoxelModelConstructorRegister {
|
|
9
9
|
static geometryPalette: StringPalette;
|
|
10
10
|
static geometry: VoxelGeometryConstructor[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StringPalette } from "
|
|
1
|
+
import { StringPalette } from "../../../Util/StringPalette";
|
|
2
2
|
import { VoxelGeometryConstructor } from "./Nodes/VoxelGeometryConstructor";
|
|
3
|
-
import { VoxelPalettesRegister } from "
|
|
3
|
+
import { VoxelPalettesRegister } from "../../../Voxels/Data/VoxelPalettesRegister";
|
|
4
4
|
export class VoxelModelConstructorRegister {
|
|
5
5
|
static geometryPalette;
|
|
6
6
|
static geometry = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoxelConstructor } from "./VoxelConstructor";
|
|
2
|
-
import { StateTreeReader } from "
|
|
2
|
+
import { StateTreeReader } from "../../../Voxels/State/StateTreeReader";
|
|
3
3
|
import { Vec3Array, Vector3Like } from "@amodx/math";
|
|
4
4
|
export declare class VoxelModelEffect {
|
|
5
5
|
model: VoxelConstructor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SectionMesh } from "./SectionMesh";
|
|
2
|
-
import { CompactedSectionVoxelMesh } from "../../Mesher/Geomtry/CompactedSectionVoxelMesh";
|
|
2
|
+
import { CompactedSectionVoxelMesh } from "../../Mesher/Voxels/Geomtry/CompactedSectionVoxelMesh";
|
|
3
3
|
export declare abstract class DVESectionMeshes {
|
|
4
4
|
abstract updateVertexData(section: SectionMesh, data: CompactedSectionVoxelMesh): SectionMesh;
|
|
5
5
|
abstract returnMesh(mesh: any): void;
|
package/Renderer/MeshManager.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MeshRegister } from "./MeshRegister.js";
|
|
2
|
-
import { CompactedSectionVoxelMesh } from "../Mesher/Geomtry/CompactedSectionVoxelMesh";
|
|
2
|
+
import { CompactedSectionVoxelMesh } from "../Mesher/Voxels/Geomtry/CompactedSectionVoxelMesh";
|
|
3
3
|
const added = new Set();
|
|
4
4
|
const compacted = new CompactedSectionVoxelMesh();
|
|
5
5
|
const location = [0, 0, 0, 0];
|
|
@@ -13,8 +13,9 @@ export interface RenderSettingsData {
|
|
|
13
13
|
export declare class RenderSettingsData {
|
|
14
14
|
/**Set the mode to change how mesh data is generated based on the underlying rendering API. */
|
|
15
15
|
mode: "webgl" | "webgpu";
|
|
16
|
-
/**
|
|
16
|
+
/**Renderer will not dispose of buffers to keep them renderering. */
|
|
17
17
|
cpuBound: boolean;
|
|
18
|
+
bufferMode: "single" | "multi";
|
|
18
19
|
}
|
|
19
20
|
export interface UpdatingSettings {
|
|
20
21
|
}
|
|
@@ -9,8 +9,10 @@ export class MesherSettingsData {
|
|
|
9
9
|
export class RenderSettingsData {
|
|
10
10
|
/**Set the mode to change how mesh data is generated based on the underlying rendering API. */
|
|
11
11
|
mode = "webgl";
|
|
12
|
-
/**
|
|
12
|
+
/**Renderer will not dispose of buffers to keep them renderering. */
|
|
13
13
|
cpuBound = false;
|
|
14
|
+
/* Single buffer mode will store vertex and indicies in single big buffer. While multi will store a buffer for each section mesh.*/
|
|
15
|
+
bufferMode = "multi";
|
|
14
16
|
}
|
|
15
17
|
export class UpdatingSettings {
|
|
16
18
|
/**Sector sections are marked as dirty so they can be processed later. */
|
package/Tasks/Paint/Common.js
CHANGED
|
@@ -61,7 +61,7 @@ export const checkLightUpdate = (x, y, z, tasks) => {
|
|
|
61
61
|
let needSunUpdate = false;
|
|
62
62
|
let needRGBRemove = false;
|
|
63
63
|
let needRGBUpdate = false;
|
|
64
|
-
|
|
64
|
+
let voxel = tasks.nDataCursor.getVoxel(x, y, z);
|
|
65
65
|
const lightValue = voxel.getLight();
|
|
66
66
|
const sunValue = lightData.getS(lightValue);
|
|
67
67
|
if (sunValue == 15) {
|
|
@@ -109,7 +109,7 @@ export const checkLightUpdate = (x, y, z, tasks) => {
|
|
|
109
109
|
}
|
|
110
110
|
if (hasRGBLight) {
|
|
111
111
|
const nRedValue = lightData.getR(nLight);
|
|
112
|
-
if (nRedValue
|
|
112
|
+
if (nRedValue < lowestRedValue) {
|
|
113
113
|
lowestRedValue = nRedValue;
|
|
114
114
|
}
|
|
115
115
|
if (nRedValue > redValue) {
|
|
@@ -123,16 +123,16 @@ export const checkLightUpdate = (x, y, z, tasks) => {
|
|
|
123
123
|
foundHigherGreen = true;
|
|
124
124
|
}
|
|
125
125
|
const nBlueValue = lightData.getB(nLight);
|
|
126
|
-
if (nBlueValue
|
|
126
|
+
if (nBlueValue < lowestBlueValue) {
|
|
127
127
|
lowestBlueValue = nBlueValue;
|
|
128
128
|
}
|
|
129
|
-
if (nBlueValue
|
|
129
|
+
if (nBlueValue > blueValue) {
|
|
130
130
|
foundHigherBlue = true;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
if (hasSunLight) {
|
|
135
|
-
//sun
|
|
135
|
+
// sun
|
|
136
136
|
if (sunValue != 15 && sunValue != 0 && !foundHigherSun) {
|
|
137
137
|
needSunRemove = true;
|
|
138
138
|
}
|
|
@@ -141,15 +141,16 @@ export const checkLightUpdate = (x, y, z, tasks) => {
|
|
|
141
141
|
needSunUpdate = true;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
voxel = tasks.nDataCursor.getVoxel(x, y, z);
|
|
145
|
+
if (hasRGBLight && !voxel.isLightSource()) {
|
|
146
|
+
// red
|
|
146
147
|
if (redValue != 15 && !foundHigherRed) {
|
|
147
148
|
needRGBRemove = true;
|
|
148
149
|
}
|
|
149
150
|
if ((foundHigherRed || redValue == 15) && lowestRedValue < redValue - 1) {
|
|
150
151
|
needRGBUpdate = true;
|
|
151
152
|
}
|
|
152
|
-
//green
|
|
153
|
+
// green
|
|
153
154
|
if (greenValue != 15 && !foundHigherGreen) {
|
|
154
155
|
needRGBRemove = true;
|
|
155
156
|
}
|
|
@@ -157,7 +158,7 @@ export const checkLightUpdate = (x, y, z, tasks) => {
|
|
|
157
158
|
lowestGreenValue < greenValue - 1) {
|
|
158
159
|
needRGBUpdate = true;
|
|
159
160
|
}
|
|
160
|
-
//blue
|
|
161
|
+
// blue
|
|
161
162
|
if (blueValue != 15 && !foundHigherBlue) {
|
|
162
163
|
needRGBRemove = true;
|
|
163
164
|
}
|
|
@@ -166,6 +167,10 @@ export const checkLightUpdate = (x, y, z, tasks) => {
|
|
|
166
167
|
needRGBUpdate = true;
|
|
167
168
|
}
|
|
168
169
|
}
|
|
170
|
+
else if (voxel.isLightSource()) {
|
|
171
|
+
needRGBUpdate = true;
|
|
172
|
+
needRGBRemove = false;
|
|
173
|
+
}
|
|
169
174
|
if (needSunRemove) {
|
|
170
175
|
tasks.sun.remove.push(x, y, z);
|
|
171
176
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { VoxelUpdateData } from "../../Tasks.types";
|
|
2
|
+
import { Vec3Array } from "@amodx/math";
|
|
3
|
+
import { IVoxelSelectionData } from "../../../Templates/Selection/VoxelSelection";
|
|
4
|
+
export default function EraseVoxelSelection(dimension: number, [ox, oy, oz]: Vec3Array, selectionData: IVoxelSelectionData<any>, updateData: VoxelUpdateData): void;
|