@divinevoxel/vlox 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Builder/RayProvider.d.ts +6 -0
- package/Builder/Tools/Brush/BrushTool.d.ts +55 -0
- package/Builder/Tools/Brush/BrushTool.js +352 -0
- package/Builder/Tools/BuilderToolBase.d.ts +39 -0
- package/Builder/Tools/BuilderToolBase.js +42 -0
- package/Builder/Tools/Hand/HandTool.d.ts +24 -0
- package/Builder/Tools/Hand/HandTool.js +73 -0
- package/Builder/Tools/Path/PahtTool.d.ts +34 -0
- package/Builder/Tools/Path/PahtTool.js +128 -0
- package/Builder/Tools/Sculpt/SculptTool.d.ts +34 -0
- package/Builder/Tools/Sculpt/SculptTool.js +102 -0
- package/Builder/Tools/Shape/ShapeTool.d.ts +32 -0
- package/Builder/Tools/Shape/ShapeTool.js +78 -0
- package/Builder/Tools/Template/TemplateTool.d.ts +35 -0
- package/Builder/Tools/Template/TemplateTool.js +73 -0
- package/Builder/Tools/Wand/WandTool.d.ts +30 -0
- package/Builder/Tools/Wand/WandTool.js +90 -0
- package/Builder/Tools/Wrench/WrenchTool.d.ts +47 -0
- package/Builder/Tools/Wrench/WrenchTool.js +184 -0
- package/Builder/Util/FreeBoxSelection.d.ts +12 -0
- package/Builder/Util/FreeBoxSelection.js +21 -0
- package/Builder/Util/FreePointSelection.d.ts +14 -0
- package/Builder/Util/FreePointSelection.js +39 -0
- package/Builder/Util/SurfaceBoxSelection.d.ts +12 -0
- package/Builder/Util/SurfaceBoxSelection.js +25 -0
- package/Builder/VoxelBuildSpace.d.ts +73 -0
- package/Builder/VoxelBuildSpace.js +224 -0
- package/Builder/World/InitTasks.d.ts +1 -0
- package/Builder/World/InitTasks.js +129 -0
- package/Builder/World/VoxelBuildSpaceWorld.d.ts +4 -0
- package/Builder/World/VoxelBuildSpaceWorld.js +10 -0
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +5 -5
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +5 -5
- package/Mesher/Geomtry/Proto/ProtoMesh.d.ts +18 -0
- package/Mesher/Geomtry/Proto/ProtoMesh.js +73 -0
- package/Mesher/Geomtry/{VoxelMeshBuffers.d.ts → Proto/ProtoMeshBuffer.d.ts} +2 -2
- package/Mesher/Geomtry/{VoxelMeshBuffers.js → Proto/ProtoMeshBuffer.js} +2 -2
- package/Mesher/Geomtry/Shapes/Box.d.ts +2 -9
- package/Mesher/Geomtry/Shapes/Box.js +7 -12
- package/Mesher/Geomtry/Transform/TransformBox.js +5 -2
- package/Mesher/InitMesher.js +4 -4
- package/Mesher/InitTask.js +2 -2
- package/Mesher/Items/Base/CompactItemMesh.d.ts +3 -0
- package/Mesher/Items/Base/CompactItemMesh.js +20 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.d.ts +5 -0
- package/Mesher/Items/Geomtry/ItemGeometryBuilder.js +131 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.d.ts +48 -0
- package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.js +114 -0
- package/Mesher/Items/MeshTexture.d.ts +1 -0
- package/Mesher/Items/MeshTexture.js +214 -0
- package/Mesher/Items/MeshTextureO.js +277 -0
- package/Mesher/Items/Models/ItemModelBuilder.d.ts +27 -0
- package/Mesher/Items/Models/ItemModelBuilder.js +64 -0
- package/Mesher/Types/ItemMesh.types.d.ts +5 -0
- package/Mesher/Types/ItemMesh.types.js +12 -0
- package/Mesher/Types/Mesher.types.d.ts +15 -9
- package/Mesher/Types/Mesher.types.js +14 -0
- package/Mesher/Types/VoxelMesh.types.js +7 -6
- package/Mesher/Voxels/Base/CompactTemplateMesh.d.ts +3 -0
- package/Mesher/{Functions/CompactVoxelMesh.js → Voxels/Base/CompactTemplateMesh.js} +4 -40
- package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.d.ts +2 -2
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.js +11 -7
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.d.ts +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.js +1 -1
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.d.ts +3 -3
- package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.js +2 -2
- package/Mesher/Voxels/MeshTemplate.d.ts +3 -0
- package/Mesher/Voxels/MeshTemplate.js +81 -0
- package/Mesher/{Functions → Voxels}/MeshVoxel.d.ts +1 -1
- package/Mesher/{Functions → Voxels}/MeshVoxel.js +6 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.js +4 -4
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Common/GetTexture.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.js +14 -16
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.js +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.d.ts +2 -2
- package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +24 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/ConsistentRotationTextureProcedure.js +2 -2
- package/Mesher/{Models → Voxels/Models}/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -5
- package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +205 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +28 -0
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +109 -0
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.d.ts +3 -3
- package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.js +2 -0
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelConstructor.js +3 -3
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.d.ts +7 -7
- package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.js +6 -5
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.d.ts +4 -4
- package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.js +2 -2
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.d.ts +1 -1
- package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.js +1 -1
- package/Renderer/Classes/DVESectionMeshes.d.ts +1 -1
- package/Renderer/MeshManager.js +1 -1
- package/Settings/EngineSettings.types.d.ts +2 -1
- package/Settings/EngineSettings.types.js +3 -1
- package/Tasks/Paint/Common.js +14 -9
- package/Tasks/Paint/Erase/EraseVoxel.js +1 -1
- package/Tasks/Paint/Erase/EraseVoxelSelection.d.ts +4 -0
- package/Tasks/Paint/Erase/EraseVoxelSelection.js +33 -0
- package/Tasks/Paint/Erase/EraseVoxelTemplate.js +1 -2
- package/Tasks/Paint/Paint/PaintVoxelTemplate.js +1 -1
- package/Tasks/Propagation/Illumanation/RGBUpdate.js +1 -1
- package/Tasks/Tasks.types.d.ts +2 -0
- package/Tasks/TasksIds.d.ts +1 -0
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/WorldGeneration/InitTasks.js +3 -1
- package/Templates/Archive/ArchivedVoxelTemplate.d.ts +6 -5
- package/Templates/Archive/ArchivedVoxelTemplate.js +56 -49
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +4 -4
- package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +0 -1
- package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +0 -2
- package/Templates/Cursor/TemplateCursor.d.ts +6 -1
- package/Templates/Cursor/TemplateCursor.js +16 -3
- package/Templates/Cursor/TemplateProxy.d.ts +1 -0
- package/Templates/Cursor/TemplateProxy.js +9 -0
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
- package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
- package/Templates/Full/FullVoxelTemplate.d.ts +5 -4
- package/Templates/Full/FullVoxelTemplate.js +32 -17
- package/Templates/Functions/ExtrudeSelection.d.ts +5 -0
- package/Templates/Functions/ExtrudeSelection.js +44 -0
- package/Templates/Functions/FillSelection.d.ts +4 -0
- package/Templates/Functions/FillSelection.js +20 -0
- package/Templates/Functions/FlipTemplate.d.ts +2 -2
- package/Templates/Functions/FlipTemplate.js +8 -8
- package/Templates/Functions/RotateTemplate.d.ts +2 -2
- package/Templates/Path/VoxelPath.d.ts +4 -0
- package/Templates/Path/VoxelPath.js +18 -0
- package/Templates/Path/VoxelPath.types.d.ts +1 -0
- package/Templates/Selection/VoxelBFSSelection.d.ts +6 -6
- package/Templates/Selection/VoxelBFSSelection.js +29 -22
- package/Templates/Selection/VoxelBoundsSelection.d.ts +20 -0
- package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +38 -20
- package/Templates/Selection/VoxelPointSelection.d.ts +19 -0
- package/Templates/Selection/VoxelPointSelection.js +49 -0
- package/Templates/Selection/VoxelSelection.d.ts +18 -0
- package/Templates/Selection/VoxelSelection.js +1 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +8 -12
- package/Templates/Selection/VoxelSurfaceSelection.js +88 -84
- package/Templates/Selection/VoxelTemplateSelection.d.ts +13 -4
- package/Templates/Selection/VoxelTemplateSelection.js +27 -9
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +77 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +92 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +37 -0
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +137 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +20 -0
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +61 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +28 -0
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +76 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.d.ts +5 -0
- package/Templates/Shapes/Selections/VoxelShapeSelection.js +1 -0
- package/Templates/Shapes/VoxelShape.types.d.ts +2 -0
- package/Templates/Shapes/VoxelShape.types.js +8 -0
- package/Templates/Shapes/VoxelShapeTemplate.d.ts +37 -0
- package/Templates/Shapes/{BasicVoxelShapeTemplate.js → VoxelShapeTemplate.js} +43 -37
- package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +5 -12
- package/Templates/Shapes/VoxelShapeTemplate.types.js +5 -1
- package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
- package/Templates/VoxelTemplateRegister.js +60 -0
- package/Templates/VoxelTemplates.types.d.ts +3 -3
- package/Textures/Classes/CompiledTexture.d.ts +2 -0
- package/Textures/Classes/CompiledTexture.js +19 -1
- package/Textures/Classes/TextureAnimationTexture.d.ts +1 -1
- package/Textures/Functions/BuildTextureData.js +13 -0
- package/Textures/TextureManager.d.ts +1 -0
- package/Textures/TextureManager.js +11 -5
- package/Tools/Brush/Brush.d.ts +2 -0
- package/Tools/Brush/Brush.js +19 -0
- package/Tools/Tasks/TasksTool.d.ts +2 -1
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferConvert.d.ts +1 -1
- package/Util/BinaryBuffer/Functions/BinaryBufferToTypedArray.d.ts +1 -1
- package/Util/LocationData.d.ts +1 -1
- package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +2 -0
- package/Voxels/Cursor/VoxelCursor.interface.js +2 -0
- package/Voxels/Cursor/VoxelLightData.js +2 -2
- package/Voxels/Functions/BuildTagData.js +1 -1
- package/Voxels/Indexes/VoxelIndex.d.ts +1 -0
- package/Voxels/Indexes/VoxelIndex.js +11 -13
- package/Voxels/InitVoxelData.js +5 -14
- package/Voxels/Interaction/Functions/PickVoxel.d.ts +0 -5
- package/Voxels/Interaction/Functions/PickVoxel.js +64 -85
- package/Voxels/Interaction/Functions/PickVoxelWorld.js +21 -46
- package/Voxels/Interaction/VoxelPickResult.d.ts +1 -0
- package/Voxels/Interaction/VoxelPickResult.js +3 -0
- package/Voxels/Models/CompiledVoxelModel.types.d.ts +1 -1
- package/Voxels/Models/Defaults/CubeVoxelGeometry.js +11 -0
- package/Voxels/Models/Defaults/CubeVoxelModels.js +44 -99
- package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -3
- package/Voxels/Models/Defaults/PanelVoxelGeometry.js +2 -226
- package/Voxels/Models/Defaults/PanelVoxelModels.d.ts +1 -0
- package/Voxels/Models/Defaults/PanelVoxelModels.js +100 -258
- package/Voxels/Models/Defaults/StairVoxelModel.js +2 -2
- package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +4 -1
- package/Voxels/Models/Rules/Classes/GeomtryInput.js +26 -5
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +23 -8
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +1 -1
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +1 -1
- package/Voxels/Models/VoxelModel.types.d.ts +6 -1
- package/Voxels/State/Schema/BinarySchemaNode.d.ts +2 -1
- package/Voxels/State/Schema/BinarySchemaNode.js +5 -2
- package/Voxels/State/Schema/Conditions/SameVoxelConditions.js +2 -0
- package/Voxels/Types/PaintVoxelData.d.ts +13 -1
- package/Voxels/Types/PaintVoxelData.js +151 -14
- package/World/Archive/Functions/Shared/LightSegments.d.ts +1 -1
- package/World/Cursor/SectionCursor.d.ts +4 -0
- package/World/Cursor/SectionCursor.js +13 -16
- package/World/Cursor/SectorCursor.d.ts +4 -0
- package/World/Cursor/SectorCursor.js +13 -16
- package/World/Cursor/WorldCursor.d.ts +4 -0
- package/World/Cursor/WorldCursor.js +8 -0
- package/World/Sector/Sector.d.ts +1 -1
- package/World/Sector/SectorHeightMap.d.ts +6 -0
- package/World/Sector/SectorHeightMap.js +6 -0
- package/World/SnapShot/SectionSnapShotCursor.d.ts +3 -0
- package/World/SnapShot/SectionSnapShotCursor.js +6 -0
- package/World/WorldSpaces.js +3 -3
- package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +5 -1
- package/WorldSimulation/Dimensions/DimensionSimulation.js +12 -0
- package/WorldSimulation/Dimensions/Generator.d.ts +1 -0
- package/WorldSimulation/Dimensions/Generator.js +1 -0
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +4 -1
- package/WorldSimulation/Dimensions/SimulationSector.js +71 -41
- package/WorldSimulation/Internal/WorldSimulationTasks.js +5 -2
- package/WorldSimulation/Procedures/BuildOnly.d.ts +10 -0
- package/WorldSimulation/Procedures/BuildOnly.js +55 -0
- package/WorldSimulation/Procedures/InitalLoad.js +3 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +2 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.js +11 -3
- package/WorldSimulation/Tasks/TaskSegment.d.ts +2 -1
- package/WorldSimulation/Tasks/TaskSegment.js +3 -1
- package/WorldSimulation/Tick/TickQueue.d.ts +2 -0
- package/WorldSimulation/Tick/TickQueue.js +26 -0
- package/WorldSimulation/Tools/SimulationBrush.d.ts +3 -0
- package/WorldSimulation/Tools/SimulationBrush.js +52 -0
- package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +3 -0
- package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -1
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +2 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +6 -0
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +39 -14
- package/WorldSimulation/WorldSimulation.d.ts +10 -0
- package/WorldSimulation/WorldSimulation.js +41 -1
- package/package.json +1 -30
- package/Mesher/Functions/CompactVoxelMesh.d.ts +0 -3
- package/Mesher/Functions/MeshTexture.js +0 -278
- package/Mesher/Geomtry/VoxelMesh.d.ts +0 -12
- package/Mesher/Geomtry/VoxelMesh.js +0 -25
- package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +0 -25
- package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +0 -162
- package/Templates/Selection/VoxelBoxSelection.d.ts +0 -14
- package/Templates/Selection/VoxelSelecton.d.ts +0 -6
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -35
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/BoxVoxelTemplate.js +0 -75
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/ConeVoxelTemplate.js +0 -69
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/CylinderVoxelTemplate.js +0 -69
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -69
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -30
- package/Templates/Shapes/PyramidVoxelTemplate.js +0 -140
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -24
- package/Templates/Shapes/SphereVoxelTemplate.js +0 -97
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -22
- package/Templates/Shapes/TorusVoxelTemplate.js +0 -69
- package/Templates/VoxelTempateRegister.js +0 -30
- /package/{Mesher/Models/Nodes/Types/GeomtryNode.types.js → Builder/RayProvider.js} +0 -0
- /package/Mesher/{Functions/MeshTexture.d.ts → Items/MeshTextureO.d.ts} +0 -0
- /package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.d.ts +0 -0
- /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSection.js +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.d.ts +0 -0
- /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Common/GetTexture.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.d.ts +0 -0
- /package/{Templates/Selection/VoxelSelecton.js → Mesher/Voxels/Models/Nodes/Types/GeomtryNode.types.js} +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.js +0 -0
- /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.d.ts +0 -0
- /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.js +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ProtoMesh } from "../../Geomtry/Proto/ProtoMesh";
|
|
2
|
+
import { Vector3Like } from "@amodx/math";
|
|
3
|
+
import { ItemMeshVertexStructCursor } from "../Geomtry/ItemMeshVertexStructCursor";
|
|
4
|
+
class ItemVars {
|
|
5
|
+
textureIndex = 0;
|
|
6
|
+
reset() {
|
|
7
|
+
this.textureIndex = 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class ItemModelBuilder {
|
|
11
|
+
id;
|
|
12
|
+
/**The current world position */
|
|
13
|
+
position = Vector3Like.Create();
|
|
14
|
+
/**The current local origin */
|
|
15
|
+
origin = Vector3Like.Create();
|
|
16
|
+
mesh = new ProtoMesh(ItemMeshVertexStructCursor.VertexFloatSize);
|
|
17
|
+
vars = new ItemVars();
|
|
18
|
+
bounds = {
|
|
19
|
+
min: [0, 0, 0],
|
|
20
|
+
max: [0, 0, 0],
|
|
21
|
+
};
|
|
22
|
+
_indexStart = 0;
|
|
23
|
+
constructor(id) {
|
|
24
|
+
this.id = id;
|
|
25
|
+
}
|
|
26
|
+
startConstruction() {
|
|
27
|
+
this._indexStart = this.mesh.indicieCount;
|
|
28
|
+
this.bounds.min[0] = Infinity;
|
|
29
|
+
this.bounds.min[1] = Infinity;
|
|
30
|
+
this.bounds.min[2] = Infinity;
|
|
31
|
+
this.bounds.max[0] = -Infinity;
|
|
32
|
+
this.bounds.max[1] = -Infinity;
|
|
33
|
+
this.bounds.max[2] = -Infinity;
|
|
34
|
+
this._boundsUpdate = false;
|
|
35
|
+
}
|
|
36
|
+
endConstruction() {
|
|
37
|
+
this.vars.reset();
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
_boundsUpdate = false;
|
|
41
|
+
updateBounds(bounds) {
|
|
42
|
+
const origin = this.origin;
|
|
43
|
+
//min
|
|
44
|
+
if (origin.x + bounds[0][0] < this.bounds.min[0])
|
|
45
|
+
this.bounds.min[0] = origin.x + bounds[0][0];
|
|
46
|
+
if (origin.y + bounds[0][1] < this.bounds.min[1])
|
|
47
|
+
this.bounds.min[1] = origin.y + bounds[0][1];
|
|
48
|
+
if (origin.z + bounds[0][2] < this.bounds.min[2])
|
|
49
|
+
this.bounds.min[2] = origin.z + bounds[0][2];
|
|
50
|
+
//max
|
|
51
|
+
if (origin.x + bounds[1][0] > this.bounds.max[0])
|
|
52
|
+
this.bounds.max[0] = origin.x + bounds[1][0];
|
|
53
|
+
if (origin.y + bounds[1][1] > this.bounds.max[1])
|
|
54
|
+
this.bounds.max[1] = origin.y + bounds[1][1];
|
|
55
|
+
if (origin.z + bounds[1][2] > this.bounds.max[2])
|
|
56
|
+
this.bounds.max[2] = origin.z + bounds[1][2];
|
|
57
|
+
this._boundsUpdate = true;
|
|
58
|
+
}
|
|
59
|
+
clear() {
|
|
60
|
+
this.vars.reset();
|
|
61
|
+
this.mesh.clear();
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -7,12 +7,18 @@ export type CompactSubMesh = [
|
|
|
7
7
|
minBounds: Vec3Array,
|
|
8
8
|
maxBounds: Vec3Array
|
|
9
9
|
];
|
|
10
|
-
export type CompactMeshData =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export type CompactMeshData = CompactSubMesh[];
|
|
11
|
+
/**
|
|
12
|
+
* old web gpu data
|
|
13
|
+
[
|
|
14
|
+
type: 1,
|
|
15
|
+
vertexBuffer: ArrayBuffer,
|
|
16
|
+
indexBuffer: Uint32Array,
|
|
17
|
+
bvhTreeBuffer: Float32Array,
|
|
18
|
+
bvhIndexBuffer: Uint32Array,
|
|
19
|
+
minBounds: Vec3Array,
|
|
20
|
+
maxBounds: Vec3Array,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
@@ -3,12 +3,13 @@ export class VoxelMeshTypes {
|
|
|
3
3
|
static vertexStrideFloats = 24;
|
|
4
4
|
static VoxelMeshStructWGSL = /* wgsl */ `
|
|
5
5
|
struct VoxelMeshVertex {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
position: vec3f,
|
|
7
|
+
normal: vec3f,
|
|
8
|
+
textureIndex: vec3f,
|
|
9
|
+
uv: vec2f,
|
|
10
|
+
colors: vec3f,
|
|
11
|
+
voxelData: f32,
|
|
12
|
+
_padding: vec4f
|
|
12
13
|
};
|
|
13
14
|
`;
|
|
14
15
|
}
|
|
@@ -60,52 +60,16 @@ function MakeWebGPUMesh(tool: VoxelMesherDataTool): CompactMeshData {
|
|
|
60
60
|
Vector3Like.ToArray(mesh.maxBounds),
|
|
61
61
|
];
|
|
62
62
|
} */
|
|
63
|
-
export function
|
|
64
|
-
const data = [
|
|
63
|
+
export function CompactTemplateMesh(tools, transfers = []) {
|
|
64
|
+
const data = [];
|
|
65
65
|
for (let i = 0; i < tools.length; i++) {
|
|
66
66
|
const tool = tools[i];
|
|
67
67
|
if (!tool.mesh.vertexCount)
|
|
68
68
|
continue;
|
|
69
|
-
const
|
|
70
|
-
const vertexArray = new Float32Array(totalVerticies);
|
|
71
|
-
const vertexBuffers = tool.mesh.buffer._buffers;
|
|
72
|
-
let start = 0;
|
|
73
|
-
let done = false;
|
|
74
|
-
for (let i = 0; i < vertexBuffers.length; i++) {
|
|
75
|
-
const buffer = vertexBuffers[i];
|
|
76
|
-
for (let j = 0; j < buffer.length; j++) {
|
|
77
|
-
vertexArray[start] = buffer[j];
|
|
78
|
-
start++;
|
|
79
|
-
if (start > totalVerticies) {
|
|
80
|
-
done = true;
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (done)
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
const indiciesArray = tool.mesh.indicieCount > 65535
|
|
88
|
-
? new Uint32Array(tool.mesh.indicieCount)
|
|
89
|
-
: new Uint16Array(tool.mesh.indicieCount);
|
|
90
|
-
const indiceBuffers = tool.mesh.indices._buffers;
|
|
91
|
-
start = 0;
|
|
92
|
-
done = false;
|
|
93
|
-
for (let i = 0; i < indiceBuffers.length; i++) {
|
|
94
|
-
const buffer = indiceBuffers[i];
|
|
95
|
-
for (let j = 0; j < buffer.length; j++) {
|
|
96
|
-
indiciesArray[start] = buffer[j];
|
|
97
|
-
start++;
|
|
98
|
-
if (start > tool.mesh.indicieCount) {
|
|
99
|
-
done = true;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (done)
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
69
|
+
const { vertexArray, indiciesArray } = tool.mesh.create();
|
|
106
70
|
const minBounds = tool.mesh.minBounds;
|
|
107
71
|
const maxBounds = tool.mesh.maxBounds;
|
|
108
|
-
data
|
|
72
|
+
data.push([
|
|
109
73
|
tool.id,
|
|
110
74
|
vertexArray,
|
|
111
75
|
indiciesArray,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetSectionMeshTask } from "
|
|
1
|
+
import { SetSectionMeshTask } from "../../Types/Mesher.types";
|
|
2
2
|
import { VoxelModelBuilder } from "../Models/VoxelModelBuilder";
|
|
3
|
-
import { LocationData } from "
|
|
3
|
+
import { LocationData } from "../../../Math";
|
|
4
4
|
export declare function CompactVoxelSectionMesh(location: LocationData, tools: VoxelModelBuilder[], transfers?: any[]): SetSectionMeshTask;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LocationData } from "../../../Math";
|
|
2
2
|
import type { SetSectionMeshTask } from "../../Types/Mesher.types";
|
|
3
3
|
import { SectionCursor } from "../../../World/Cursor/SectionCursor.js";
|
|
4
|
-
import { DataCursorInterface } from "Voxels/Cursor/DataCursor.interface";
|
|
4
|
+
import { DataCursorInterface } from "../../../Voxels/Cursor/DataCursor.interface";
|
|
5
5
|
export declare function MeshSectionBase(worldCursor: DataCursorInterface, sectionCursor: SectionCursor, location: LocationData, transfers?: any[]): SetSectionMeshTask | null;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
//data
|
|
2
2
|
import { WorldSpaces } from "../../../World/WorldSpaces.js";
|
|
3
3
|
//tools
|
|
4
|
-
import { VoxelGeometryBuilderCacheSpace } from "
|
|
5
|
-
import { VoxelModelConstructorRegister } from "
|
|
6
|
-
import { VoxelMeshBVHBuilder } from "
|
|
4
|
+
import { VoxelGeometryBuilderCacheSpace } from "../Models/VoxelGeometryBuilderCacheSpace.js";
|
|
5
|
+
import { VoxelModelConstructorRegister } from "../Models/VoxelModelConstructorRegister.js";
|
|
6
|
+
import { VoxelMeshBVHBuilder } from "../Geomtry/VoxelMeshBVHBuilder";
|
|
7
7
|
import { Vector3Like } from "@amodx/math";
|
|
8
|
-
import { RenderedMaterials } from "
|
|
9
|
-
import { CompactVoxelSectionMesh } from "
|
|
8
|
+
import { RenderedMaterials } from "../Models/RenderedMaterials";
|
|
9
|
+
import { CompactVoxelSectionMesh } from "./CompactVoxelSectionMesh";
|
|
10
10
|
let space;
|
|
11
11
|
const bvhTool = new VoxelMeshBVHBuilder();
|
|
12
12
|
function meshVoxel(x, y, z, voxel, worldCursor, sectionCursor) {
|
|
13
13
|
let added = false;
|
|
14
14
|
const constructor = VoxelModelConstructorRegister.constructorsPaltte[voxel.getVoxelId()];
|
|
15
|
+
constructor.schema.dataCursor = worldCursor;
|
|
16
|
+
constructor.schema.voxel = voxel;
|
|
15
17
|
const builder = constructor.builder;
|
|
16
18
|
builder.origin.x = sectionCursor._voxelPosition.x;
|
|
17
19
|
builder.origin.y = sectionCursor._voxelPosition.y;
|
|
@@ -68,12 +70,14 @@ export function MeshSectionBase(worldCursor, sectionCursor, location, transfers
|
|
|
68
70
|
const y = cy + sectionCursor._voxelPosition.y;
|
|
69
71
|
const z = cz + sectionCursor._voxelPosition.z;
|
|
70
72
|
let addedVoxel = false;
|
|
71
|
-
if (meshVoxel(x, y, z, voxel, worldCursor, sectionCursor))
|
|
73
|
+
if (meshVoxel(x, y, z, voxel, worldCursor, sectionCursor)) {
|
|
72
74
|
addedVoxel = true;
|
|
75
|
+
}
|
|
73
76
|
if (voxel.hasSecondaryVoxel()) {
|
|
74
77
|
voxel.setSecondary(true);
|
|
75
|
-
if (meshVoxel(x, y, z, voxel, worldCursor, sectionCursor))
|
|
78
|
+
if (meshVoxel(x, y, z, voxel, worldCursor, sectionCursor)) {
|
|
76
79
|
addedVoxel = true;
|
|
80
|
+
}
|
|
77
81
|
voxel.setSecondary(false);
|
|
78
82
|
}
|
|
79
83
|
section.setBuried(i, !addedVoxel);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelPalettesRegister } from "
|
|
1
|
+
import { VoxelPalettesRegister } from "../../../Voxels/Data/VoxelPalettesRegister";
|
|
2
2
|
import { VoxelMeshVertexStructCursor } from "./VoxelMeshVertexStructCursor";
|
|
3
3
|
export class CompactedMeshData {
|
|
4
4
|
material;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoxelModelBuilder } from "../Models/VoxelModelBuilder";
|
|
2
|
-
import { Quad } from "
|
|
3
|
-
import { Triangle } from "
|
|
2
|
+
import { Quad } from "../../Geomtry/Primitives/Quad";
|
|
3
|
+
import { Triangle } from "../../Geomtry/Primitives";
|
|
4
4
|
export declare function addVoxelTriangle(builder: VoxelModelBuilder, tri: Triangle): void;
|
|
5
5
|
export declare function addVoxelQuad(builder: VoxelModelBuilder, quad: Quad): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vector4Like } from "@amodx/math";
|
|
2
2
|
import { VoxelShaderData } from "./VoxelShaderData";
|
|
3
|
-
import { QuadVerticies } from "
|
|
3
|
+
import { QuadVerticies } from "../../Geomtry/Geometry.types";
|
|
4
4
|
import { VoxelMeshVertexConstants } from "./VoxelMeshVertexStructCursor";
|
|
5
5
|
const vector1ShaderData = Vector4Like.Create();
|
|
6
6
|
const vector2ShaderData = Vector4Like.Create();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { VoxelMeshBVHStructCursor } from "./VoxelMeshBVHStructCursor";
|
|
3
|
-
import { FlatBinaryTreeIndex } from "
|
|
3
|
+
import { FlatBinaryTreeIndex } from "../../../Util/FlatBinaryTreeIndex";
|
|
4
4
|
export declare class VoxelMeshBVHBuilder {
|
|
5
5
|
static AABBStructByteSize: number;
|
|
6
6
|
treeIndex: FlatBinaryTreeIndex;
|
|
7
|
-
tree: Float32Array
|
|
7
|
+
tree: Float32Array<ArrayBuffer>;
|
|
8
8
|
structCursor: VoxelMeshBVHStructCursor;
|
|
9
|
-
indices: Uint32Array
|
|
9
|
+
indices: Uint32Array<ArrayBuffer>;
|
|
10
10
|
reset(): void;
|
|
11
11
|
getMeshBounds(): {
|
|
12
12
|
min: Vec3Array;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WorldSpaces } from "
|
|
1
|
+
import { WorldSpaces } from "../../../World/WorldSpaces";
|
|
2
2
|
import { VoxelMeshBVHStructCursor } from "./VoxelMeshBVHStructCursor";
|
|
3
|
-
import { FlatBinaryTreeIndex } from "
|
|
3
|
+
import { FlatBinaryTreeIndex } from "../../../Util/FlatBinaryTreeIndex";
|
|
4
4
|
const MAX_FLOAT32 = new Float32Array([Infinity])[0];
|
|
5
5
|
export class VoxelMeshBVHBuilder {
|
|
6
6
|
static AABBStructByteSize = (4 + 4) * 4;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CompactMeshData } from "../Types/index.js";
|
|
2
|
+
import { FullVoxelTemplateData } from "../../Templates/Full/FullVoxelTemplate.types.js";
|
|
3
|
+
export declare function MeshTemplate(fullVoxelData: FullVoxelTemplateData, baseLightValue?: number): [mesh: CompactMeshData, tranfers: any[]] | false;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { VoxelGeometryBuilderCacheSpace } from "./Models/VoxelGeometryBuilderCacheSpace.js";
|
|
2
|
+
import { TemplateCursor } from "../../Templates/Cursor/TemplateCursor.js";
|
|
3
|
+
import { FullVoxelTemplate } from "../../Templates/Full/FullVoxelTemplate.js";
|
|
4
|
+
import { CompactTemplateMesh } from "./Base/CompactTemplateMesh.js";
|
|
5
|
+
import { VoxelModelConstructorRegister } from "./Models/VoxelModelConstructorRegister.js";
|
|
6
|
+
import { Vector3Like } from "@amodx/math";
|
|
7
|
+
import { RenderedMaterials } from "./Models/RenderedMaterials.js";
|
|
8
|
+
import { VoxelLightData } from "../../Voxels/Cursor/VoxelLightData.js";
|
|
9
|
+
const templateCursor = new TemplateCursor();
|
|
10
|
+
const padding = Vector3Like.Create(5, 5, 5);
|
|
11
|
+
const lightData = new VoxelLightData();
|
|
12
|
+
function meshVoxel(x, y, z, voxel, templateCursor) {
|
|
13
|
+
if (voxel.isAir() || !voxel.isRenderable())
|
|
14
|
+
return false;
|
|
15
|
+
let added = false;
|
|
16
|
+
const constructor = VoxelModelConstructorRegister.constructorsPaltte[voxel.getVoxelId()];
|
|
17
|
+
constructor.schema.dataCursor = templateCursor;
|
|
18
|
+
constructor.schema.dataCursor = templateCursor;
|
|
19
|
+
constructor.schema.voxel = voxel;
|
|
20
|
+
const builder = constructor.builder;
|
|
21
|
+
builder.origin.x = x;
|
|
22
|
+
builder.origin.y = y;
|
|
23
|
+
builder.origin.z = z;
|
|
24
|
+
builder.position.x = x;
|
|
25
|
+
builder.position.y = y;
|
|
26
|
+
builder.position.z = z;
|
|
27
|
+
builder.voxel = voxel;
|
|
28
|
+
builder.nVoxel = templateCursor;
|
|
29
|
+
builder.startConstruction();
|
|
30
|
+
added = constructor.process();
|
|
31
|
+
builder.endConstruction();
|
|
32
|
+
return added;
|
|
33
|
+
}
|
|
34
|
+
export function MeshTemplate(fullVoxelData, baseLightValue = lightData.setS(0xf, 0)) {
|
|
35
|
+
const template = new FullVoxelTemplate(fullVoxelData);
|
|
36
|
+
templateCursor.setTemplate(template);
|
|
37
|
+
const space = new VoxelGeometryBuilderCacheSpace({
|
|
38
|
+
x: template.bounds.size.x + padding.x,
|
|
39
|
+
y: template.bounds.size.y + padding.y,
|
|
40
|
+
z: template.bounds.size.z + padding.z,
|
|
41
|
+
});
|
|
42
|
+
space.start(-2, -2, -2);
|
|
43
|
+
const effects = {};
|
|
44
|
+
for (let i = 0; i < RenderedMaterials.meshers.length; i++) {
|
|
45
|
+
const mesher = RenderedMaterials.meshers[i];
|
|
46
|
+
mesher.space = space;
|
|
47
|
+
mesher.effects = effects;
|
|
48
|
+
}
|
|
49
|
+
const oldLight = template.light.slice();
|
|
50
|
+
template.light.fill(baseLightValue);
|
|
51
|
+
const size = template.bounds.size;
|
|
52
|
+
for (let x = 0; x < size.x; x++) {
|
|
53
|
+
for (let y = 0; y < size.y; y++) {
|
|
54
|
+
for (let z = 0; z < size.z; z++) {
|
|
55
|
+
const voxel = templateCursor.getVoxel(x, y, z);
|
|
56
|
+
meshVoxel(x, y, z, voxel, templateCursor);
|
|
57
|
+
if (voxel.hasSecondaryVoxel()) {
|
|
58
|
+
voxel.setSecondary(true);
|
|
59
|
+
meshVoxel(x, y, z, voxel, templateCursor);
|
|
60
|
+
voxel.setSecondary(false);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const meshed = [];
|
|
66
|
+
for (let i = 0; i < RenderedMaterials.meshers.length; i++) {
|
|
67
|
+
const mesher = RenderedMaterials.meshers[i];
|
|
68
|
+
if (!mesher.mesh.vertexCount) {
|
|
69
|
+
mesher.clear();
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
meshed.push(mesher);
|
|
73
|
+
}
|
|
74
|
+
const transfers = [];
|
|
75
|
+
const compacted = CompactTemplateMesh(meshed, transfers);
|
|
76
|
+
for (let i = 0; i < meshed.length; i++) {
|
|
77
|
+
meshed[i].clear();
|
|
78
|
+
}
|
|
79
|
+
template.light.set(oldLight);
|
|
80
|
+
return [compacted, transfers];
|
|
81
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RawVoxelData } from "../../Voxels/Types/Voxel.types.js";
|
|
2
|
-
import { CompactMeshData } from "
|
|
2
|
+
import { CompactMeshData } from "../Types/index.js";
|
|
3
3
|
export declare function MeshVoxel(rawVoxelData: RawVoxelData): [mesh: CompactMeshData, tranfers: any[]] | false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VoxelGeometryBuilderCacheSpace } from "
|
|
1
|
+
import { VoxelGeometryBuilderCacheSpace } from "./Models/VoxelGeometryBuilderCacheSpace.js";
|
|
2
2
|
import { TemplateCursor } from "../../Templates/Cursor/TemplateCursor.js";
|
|
3
3
|
import { FullVoxelTemplate } from "../../Templates/Full/FullVoxelTemplate.js";
|
|
4
|
-
import {
|
|
5
|
-
import { VoxelModelConstructorRegister } from "
|
|
4
|
+
import { CompactTemplateMesh } from "./Base/CompactTemplateMesh.js";
|
|
5
|
+
import { VoxelModelConstructorRegister } from "./Models/VoxelModelConstructorRegister.js";
|
|
6
6
|
const template = new FullVoxelTemplate(FullVoxelTemplate.CreateNew([3, 3, 3], 0xf));
|
|
7
7
|
const templateCursor = new TemplateCursor();
|
|
8
8
|
templateCursor.setTemplate(template);
|
|
@@ -19,6 +19,8 @@ export function MeshVoxel(rawVoxelData) {
|
|
|
19
19
|
if (!constructor) {
|
|
20
20
|
throw new Error(`Could not find constructor for voxel [id:${voxel.getStringId()} name:${voxel.getName()}] `);
|
|
21
21
|
}
|
|
22
|
+
constructor.schema.dataCursor = templateCursor;
|
|
23
|
+
constructor.schema.voxel = voxel;
|
|
22
24
|
const builder = constructor.builder;
|
|
23
25
|
if (!builder) {
|
|
24
26
|
console.error(builder, constructor.id, constructor);
|
|
@@ -38,7 +40,7 @@ export function MeshVoxel(rawVoxelData) {
|
|
|
38
40
|
builder.nVoxel = templateCursor;
|
|
39
41
|
constructor.process();
|
|
40
42
|
const transfers = [];
|
|
41
|
-
const compacted =
|
|
43
|
+
const compacted = CompactTemplateMesh([builder], transfers);
|
|
42
44
|
builder.clear();
|
|
43
45
|
return [compacted, transfers];
|
|
44
46
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { QuadVerticies } from "
|
|
2
|
-
import { VoxelFaces } from "
|
|
1
|
+
import { QuadVerticies } from "../../../../Geomtry/Geometry.types";
|
|
2
|
+
import { VoxelFaces } from "../../../../../Math";
|
|
3
3
|
import { Vec4Array } from "@amodx/math";
|
|
4
4
|
export declare const GradientCheckSets: Record<VoxelFaces, Record<QuadVerticies, number[]>>;
|
|
5
|
-
export declare const GradientCheckSetsArray: Int8Array
|
|
5
|
+
export declare const GradientCheckSetsArray: Int8Array<ArrayBuffer>;
|
|
6
6
|
export declare const GeometryCheckSetIndexes: Record<VoxelFaces, Record<QuadVerticies, [number, number, number]>>;
|
|
7
7
|
export declare const CenterDirectionIndex: number;
|
|
8
8
|
export declare const DirectionIndexes: Record<VoxelFaces, number>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QuadVerticies
|
|
2
|
-
import { VoxelFaces, VoxelFacesArray } from "
|
|
3
|
-
import { VoxelRelativeCubeIndex } from "
|
|
4
|
-
import { VoxelLightData } from "
|
|
1
|
+
import { QuadVerticies } from "../../../../Geomtry/Geometry.types";
|
|
2
|
+
import { VoxelFaces, VoxelFacesArray } from "../../../../../Math";
|
|
3
|
+
import { VoxelRelativeCubeIndex } from "../../../../../Voxels/Models/Indexing/VoxelRelativeCubeIndex";
|
|
4
|
+
import { VoxelLightData } from "../../../../../Voxels/Cursor/VoxelLightData";
|
|
5
5
|
export const GradientCheckSets = [];
|
|
6
6
|
GradientCheckSets[VoxelFaces.Up] = [];
|
|
7
7
|
GradientCheckSets[VoxelFaces.Up][QuadVerticies.TopRight] = [
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { VoxelModelBuilder } from "../../VoxelModelBuilder.js";
|
|
2
|
-
import { VoxelFaces } from "
|
|
2
|
+
import { VoxelFaces } from "../../../../../Math/index.js";
|
|
3
3
|
export default function calculateFaceData(face: VoxelFaces, builder: VoxelModelBuilder): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VoxelFaceDirections } from "
|
|
1
|
+
import { VoxelFaceDirections } from "../../../../../Math/index.js";
|
|
2
2
|
import { GradientCheckSets } from "./CalcConstants.js";
|
|
3
|
-
import { VoxelLightData } from "
|
|
3
|
+
import { VoxelLightData } from "../../../../../Voxels/Cursor/VoxelLightData.js";
|
|
4
4
|
const lightData = new VoxelLightData();
|
|
5
5
|
export default function calculateFaceData(face, builder) {
|
|
6
6
|
const x = builder.position.x;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelRelativeCubeIndexPositionMap } from "
|
|
1
|
+
import { VoxelRelativeCubeIndexPositionMap } from "../../../../../Voxels/Models/Indexing/VoxelRelativeCubeIndex";
|
|
2
2
|
import { VoxelModelConstructorRegister } from "../../VoxelModelConstructorRegister";
|
|
3
3
|
export function CullRulledFace(builder, trueFaceIndex) {
|
|
4
4
|
const faceIndexes = VoxelModelConstructorRegister.faceCullMap[trueFaceIndex];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuadVerticies } from "
|
|
1
|
+
import { QuadVerticies } from "../../../../Geomtry/Geometry.types";
|
|
2
2
|
import { VoxelModelBuilder } from "../../../Models/VoxelModelBuilder";
|
|
3
3
|
import { Vec4Array } from "@amodx/math";
|
|
4
4
|
export declare function ShadeRulelessFace(builder: VoxelModelBuilder, lightData: Record<QuadVerticies, number>, vertexWeights: Vec4Array[], verticesStride: number): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VoxelModelBuilder } from "../../VoxelModelBuilder";
|
|
2
2
|
import { Vec4Array } from "@amodx/math";
|
|
3
|
-
import { QuadVerticies } from "
|
|
3
|
+
import { QuadVerticies } from "../../../../Geomtry/Geometry.types";
|
|
4
4
|
export declare function ShadeRulledFace(builder: VoxelModelBuilder, trueFaceIndex: number, lightData: Record<QuadVerticies, number>, vertexWeights: Vec4Array[], vertexStride: number): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelRelativeCubeIndexPositionMap } from "
|
|
1
|
+
import { VoxelRelativeCubeIndexPositionMap } from "../../../../../Voxels/Models/Indexing/VoxelRelativeCubeIndex";
|
|
2
2
|
import { VoxelModelConstructorRegister } from "../../VoxelModelConstructorRegister";
|
|
3
3
|
import { getInterpolationValue } from "../Calc/CalcConstants";
|
|
4
4
|
export function ShadeRulledFace(builder, trueFaceIndex, lightData, vertexWeights, vertexStride) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseVoxelGeomtryTextureProcedureData } from "../Procedures/TextureProcedure";
|
|
2
2
|
import { VoxelModelBuilder } from "../VoxelModelBuilder";
|
|
3
|
-
import { Quad } from "
|
|
4
|
-
import { VoxelFaces } from "
|
|
5
|
-
import { Triangle } from "
|
|
3
|
+
import { Quad } from "../../../Geomtry";
|
|
4
|
+
import { VoxelFaces } from "../../../../Math";
|
|
5
|
+
import { Triangle } from "../../../Geomtry";
|
|
6
6
|
export declare function GetTexture(builder: VoxelModelBuilder, data: number | BaseVoxelGeomtryTextureProcedureData, closestFace: VoxelFaces, primitive: Quad | Triangle): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VoxelModelBuilder } from "../../../VoxelModelBuilder";
|
|
2
|
-
import { QuadScalarVertexData } from "
|
|
2
|
+
import { QuadScalarVertexData } from "../../../../../Geomtry/Primitives/QuadVertexData";
|
|
3
3
|
import { CompassAngles } from "@amodx/math";
|
|
4
4
|
export declare enum FlowVerticies {
|
|
5
5
|
NorthEast = 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GeoemtryNode } from "../../GeometryNode";
|
|
2
|
-
import { VoxelCustomGeomtryNode } from "
|
|
3
|
-
import { VoxelFaces } from "
|
|
4
|
-
import type { LiquidVoxelModelArgs } from "
|
|
2
|
+
import { VoxelCustomGeomtryNode } from "../../../../../../Voxels/Models/VoxelModel.types";
|
|
3
|
+
import { VoxelFaces } from "../../../../../../Math";
|
|
4
|
+
import type { LiquidVoxelModelArgs } from "../../../../../../Voxels/Models/Defaults/LiquidVoxelModel";
|
|
5
5
|
export declare class LiquidGeometryNode extends GeoemtryNode<VoxelCustomGeomtryNode, LiquidVoxelModelArgs> {
|
|
6
6
|
init(): void;
|
|
7
7
|
isExposed(face: VoxelFaces): boolean;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { GeoemtryNode } from "../../GeometryNode";
|
|
2
2
|
import { CompassAngles } from "@amodx/math";
|
|
3
|
-
import { Quad } from "
|
|
4
|
-
import { QuadVerticies } from "
|
|
5
|
-
import { QuadScalarVertexData } from "
|
|
6
|
-
import { VoxelFaceDirections, VoxelFaces } from "
|
|
3
|
+
import { Quad } from "../../../../../Geomtry/Primitives/Quad";
|
|
4
|
+
import { QuadVerticies, } from "../../../../../Geomtry/Geometry.types";
|
|
5
|
+
import { QuadScalarVertexData } from "../../../../../Geomtry/Primitives/QuadVertexData";
|
|
6
|
+
import { VoxelFaceDirections, VoxelFaces } from "../../../../../../Math";
|
|
7
7
|
import { getFlowAngle, getFlowGradient, FlowVerticies } from "./FlowGradient";
|
|
8
|
-
import { VoxelLightData } from "
|
|
8
|
+
import { VoxelLightData } from "../../../../../../Voxels/Cursor/VoxelLightData";
|
|
9
9
|
import { addVoxelQuad } from "../../../../Geomtry/VoxelGeometryBuilder";
|
|
10
10
|
import { GetTexture } from "../../../Common/GetTexture";
|
|
11
|
-
import { Box } from "
|
|
11
|
+
import { Box } from "../../../../../Geomtry/Shapes/Box";
|
|
12
12
|
const vertexValue = new QuadScalarVertexData();
|
|
13
13
|
const vertexLevel = new QuadScalarVertexData();
|
|
14
14
|
const lightData = new VoxelLightData();
|
|
@@ -33,25 +33,23 @@ const { quads: Quads } = Box.Create([
|
|
|
33
33
|
[0, 0, 0],
|
|
34
34
|
[1, waterHeight, 1],
|
|
35
35
|
]);
|
|
36
|
-
const { quads: Quads2 } = Box.Create([
|
|
37
|
-
[0, 0, 0],
|
|
38
|
-
[1, waterHeight, 1],
|
|
39
|
-
]);
|
|
40
36
|
Quads[VoxelFaces.Up].setUVs(uvs);
|
|
41
37
|
Quads[VoxelFaces.Down].setUVs(uvs);
|
|
42
38
|
export class LiquidGeometryNode extends GeoemtryNode {
|
|
43
39
|
init() { }
|
|
44
40
|
isExposed(face) {
|
|
45
41
|
/* if (this.builder.voxel.getLevel() <= 0 || this.builder.voxel.getLevelState() && face !== VoxelFaces.Up) {
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
return true;
|
|
43
|
+
} */
|
|
48
44
|
const nv = this.builder.nVoxel.getVoxel(VoxelFaceDirections[face][0] + this.builder.position.x, VoxelFaceDirections[face][1] + this.builder.position.y, VoxelFaceDirections[face][2] + this.builder.position.z);
|
|
49
|
-
if (!nv
|
|
45
|
+
if (!nv)
|
|
50
46
|
return true;
|
|
51
47
|
if (this.builder.voxel.isSameVoxel(nv))
|
|
52
48
|
return false;
|
|
53
49
|
if (nv.isAir() || nv.tags["dve_is_transparent"])
|
|
54
50
|
return true;
|
|
51
|
+
if (face == VoxelFaces.Up)
|
|
52
|
+
return true;
|
|
55
53
|
return false;
|
|
56
54
|
}
|
|
57
55
|
determineShading(face) {
|
|
@@ -76,9 +74,9 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
76
74
|
currentHeight = 1 - builder.voxel.getLevel() / 7;
|
|
77
75
|
}
|
|
78
76
|
/* if (builder.voxel.getLevelState() == 1 || builder.voxel.getLevel() == 0) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
flowTexture = 0;
|
|
78
|
+
stillTexture = 0;
|
|
79
|
+
} */
|
|
82
80
|
let added = false;
|
|
83
81
|
let upFaceExposed = false;
|
|
84
82
|
if (this.isExposed(VoxelFaces.Up)) {
|