@divinevoxel/vlox 0.0.78 → 0.0.79
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/Wrench/WrenchTool.js +26 -21
- package/Builder/VoxelBuildSpace.d.ts +2 -2
- package/Builder/VoxelBuildSpace.js +4 -4
- package/Builder/World/InitTasks.js +1 -1
- package/Cache/Cache.types.d.ts +0 -4
- package/Cache/CacheManager.d.ts +1 -2
- package/Cache/CacheManager.js +0 -2
- package/Contexts/Base/Main/InitDataGenerator.js +10 -2
- package/Contexts/Base/Remote/DataSync.types.d.ts +10 -4
- package/Contexts/Base/Remote/InitDataSync.js +10 -20
- package/Init/StartMesher.js +2 -1
- package/Init/StartRenderer.js +2 -1
- package/Mesher/{Geomtry → Geometry}/Geometry.types.d.ts +1 -0
- package/Mesher/InitMesher.d.ts +1 -2
- package/Mesher/InitMesher.js +7 -14
- package/Mesher/Items/{Geomtry → Geometry}/ItemGeometryBuilder.d.ts +2 -2
- package/Mesher/Items/{Geomtry → Geometry}/ItemGeometryBuilder.js +1 -1
- package/Mesher/Items/MeshTexture.d.ts +2 -1
- package/Mesher/Items/MeshTexture.js +7 -6
- package/Mesher/Items/MeshTextureO.js +1 -1
- package/Mesher/Items/Models/ItemModelBuilder.d.ts +1 -1
- package/Mesher/Items/Models/ItemModelBuilder.js +2 -2
- package/Mesher/Voxels/Base/CompactTemplateMesh.js +1 -1
- package/Mesher/Voxels/Base/CompactVoxelSectionMesh.js +2 -2
- package/Mesher/Voxels/Base/MeshSectionBase.js +1 -3
- package/Mesher/Voxels/{Geomtry → Geometry}/CompactedSectionVoxelMesh.js +3 -3
- package/Mesher/Voxels/{Geomtry → Geometry}/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/Voxels/{Geomtry → Geometry}/VoxelGeometryBuilder.js +1 -1
- package/Mesher/Voxels/{Geomtry → Geometry}/VoxelMeshBVHBuilder.js +1 -1
- package/Mesher/Voxels/{Geomtry → Geometry}/VoxelMeshBVHStructCursor.d.ts +1 -1
- package/Mesher/Voxels/{Geomtry → Geometry}/VoxelMeshBVHStructCursor.js +1 -1
- package/Mesher/Voxels/MeshTemplate.js +0 -3
- package/Mesher/Voxels/MeshVoxel.js +0 -2
- package/Mesher/Voxels/Models/Common/Calc/CalcConstants.d.ts +1 -1
- package/Mesher/Voxels/Models/Common/Calc/CalcConstants.js +2 -2
- package/Mesher/Voxels/Models/Common/Calc/FaceDataCalc.js +4 -1
- package/Mesher/Voxels/Models/Common/Faces/CullRulledFace.js +29 -18
- package/Mesher/Voxels/Models/Common/Faces/ShadeRulelessFace.d.ts +1 -1
- package/Mesher/Voxels/Models/Common/Faces/ShadeRulledFace.d.ts +1 -1
- package/Mesher/Voxels/Models/Common/Faces/ShadeRulledFace.js +31 -21
- package/Mesher/Voxels/Models/Common/GetTexture.d.ts +4 -4
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/{LiquidGeomtryNode.d.ts → LiquidGeometryNode.d.ts} +2 -2
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/{LiquidGeomtryNode.js → LiquidGeometryNode.js} +5 -5
- package/Mesher/Voxels/Models/Nodes/Default/QuadVoxelGeometryNode.d.ts +3 -3
- package/Mesher/Voxels/Models/Nodes/Default/QuadVoxelGeometryNode.js +2 -2
- package/Mesher/Voxels/Models/Nodes/Default/TriangleVoxelGeometryNode.d.ts +3 -3
- package/Mesher/Voxels/Models/Nodes/Default/TriangleVoxelGeometryNode.js +2 -2
- package/Mesher/Voxels/Models/Nodes/GeometryNode.d.ts +3 -3
- package/Mesher/Voxels/Models/Nodes/GeometryNode.js +3 -3
- package/Mesher/Voxels/Models/Nodes/Types/GeometryNode.types.d.ts +7 -0
- package/Mesher/Voxels/Models/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +3 -3
- package/Mesher/Voxels/Models/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +2 -2
- package/Mesher/Voxels/Models/Nodes/VoxelGeometryConstructor.d.ts +2 -3
- package/Mesher/Voxels/Models/Nodes/VoxelGeometryConstructor.js +6 -5
- package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +4 -4
- package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -4
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +4 -4
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +20 -6
- package/Mesher/Voxels/Models/Procedures/TextureProcedure.d.ts +2 -2
- package/Mesher/Voxels/Models/VoxelConstructor.d.ts +1 -16
- package/Mesher/Voxels/Models/VoxelConstructor.js +50 -56
- package/Mesher/Voxels/Models/VoxelGeometryBuilderCacheSpace.d.ts +3 -6
- package/Mesher/Voxels/Models/VoxelGeometryBuilderCacheSpace.js +40 -44
- package/Mesher/Voxels/Models/VoxelModelBuilder.d.ts +4 -4
- package/Mesher/Voxels/Models/VoxelModelBuilder.js +4 -4
- package/Mesher/Voxels/Models/VoxelModelConstructorRegister.d.ts +1 -14
- package/Mesher/Voxels/Models/VoxelModelConstructorRegister.js +7 -21
- package/Mesher/Voxels/Models/VoxelModelEffect.d.ts +1 -7
- package/Mesher/Voxels/Models/VoxelModelEffect.js +23 -26
- 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 +1 -0
- package/Stats/EngineStats.d.ts +5 -3
- package/Stats/EngineStats.js +8 -6
- package/Templates/Archive/ArchivedVoxelTemplate.d.ts +1 -1
- package/Templates/Archive/ArchivedVoxelTemplate.js +5 -5
- package/Templates/Archive/Functions/CreateArchivedTemplate.d.ts +1 -1
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +2 -2
- package/Templates/Cursor/TemplateCursor.d.ts +1 -1
- package/Templates/Cursor/TemplateCursor.js +1 -1
- package/Templates/Full/FullVoxelTemplate.d.ts +1 -1
- package/Templates/Full/FullVoxelTemplate.js +1 -1
- package/Templates/Full/Functions/CreateFullTemplate.d.ts +1 -1
- package/Templates/Selection/VoxelBFSSelection.d.ts +1 -1
- package/Templates/Selection/VoxelBFSSelection.js +1 -1
- package/Templates/Selection/VoxelBoundsSelection.d.ts +1 -1
- package/Templates/Selection/VoxelBoundsSelection.js +1 -1
- package/Templates/Selection/VoxelPointSelection.d.ts +1 -1
- package/Templates/Selection/VoxelPointSelection.js +1 -1
- package/Templates/Selection/VoxelSelection.d.ts +1 -1
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +1 -1
- package/Templates/Selection/VoxelSurfaceSelection.js +1 -1
- package/Templates/Selection/VoxelTemplateSelection.d.ts +1 -1
- package/Templates/Selection/VoxelTemplateSelection.js +1 -1
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +1 -1
- package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +1 -1
- package/Templates/Shapes/VoxelShapeTemplate.d.ts +1 -1
- package/Templates/Shapes/VoxelShapeTemplate.js +1 -1
- package/Templates/VoxelTemplates.types.d.ts +1 -1
- package/Textures/Functions/BuildTextureData.js +4 -52
- package/Tools/Brush/Brush.js +5 -5
- package/Util/StringPalette.js +2 -0
- package/Voxels/Archive/VoxelPaletteArchiveReader.js +7 -6
- package/Voxels/Archive/VoxelPaletteArechive.js +8 -8
- package/Voxels/Cursor/DataCursor.interface.d.ts +1 -1
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +0 -2
- package/Voxels/Cursor/VoxelCursor.interface.js +14 -16
- package/Voxels/Cursor/VoxelCursor.js +5 -5
- package/Voxels/Data/GeometryLUT.d.ts +32 -0
- package/Voxels/Data/GeometryLUT.js +50 -0
- package/Voxels/Data/VoxelLUT.d.ts +83 -0
- package/Voxels/Data/VoxelLUT.js +119 -0
- package/Voxels/Data/VoxelTagsRegister.d.ts +2 -2
- package/Voxels/Data/VoxelTagsRegister.js +2 -2
- package/Voxels/Functions/BuildLUTs.d.ts +6 -0
- package/Voxels/Functions/BuildLUTs.js +361 -0
- package/Voxels/Functions/BuildTagData.d.ts +4 -2
- package/Voxels/Functions/BuildTagData.js +15 -32
- package/Voxels/Functions/Geometry/BuildGeometryLUT.d.ts +11 -0
- package/Voxels/Functions/Geometry/BuildGeometryLUT.js +395 -0
- package/Voxels/{Models/Rules/Functions/Compile/Nodes → Functions/Geometry}/CalcFunctions.d.ts +3 -3
- package/Voxels/{Models/Rules/Functions/Compile/Nodes → Functions/Geometry}/CalcFunctions.js +2 -2
- package/Voxels/Functions/Geometry/Compile/BuildCompiled.d.ts +4 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiled.js +25 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiledBox.d.ts +4 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiledBox.js +13 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiledQuad.d.ts +4 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiledQuad.js +41 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiledTri.d.ts +4 -0
- package/Voxels/Functions/Geometry/Compile/BuildCompiledTri.js +44 -0
- package/Voxels/Functions/Geometry/GeometryLUT.types.d.ts +7 -0
- package/Voxels/Functions/Geometry/Inputs/BaseFunctions.d.ts +4 -0
- package/Voxels/Functions/Geometry/Inputs/BaseFunctions.js +28 -0
- package/Voxels/Functions/Geometry/Inputs/BuildBoxInputs.d.ts +5 -0
- package/Voxels/Functions/Geometry/Inputs/BuildBoxInputs.js +8 -0
- package/Voxels/Functions/Geometry/Inputs/BuildCustomInputs.d.ts +5 -0
- package/Voxels/Functions/Geometry/Inputs/BuildCustomInputs.js +41 -0
- package/Voxels/Functions/Geometry/Inputs/BuildQuadInputs.d.ts +5 -0
- package/Voxels/Functions/Geometry/Inputs/BuildQuadInputs.js +103 -0
- package/Voxels/Functions/Geometry/Inputs/BuildTriangleInputs.d.ts +5 -0
- package/Voxels/Functions/Geometry/Inputs/BuildTriangleInputs.js +101 -0
- package/Voxels/Functions/Geometry/Inputs/BuldInputs.d.ts +4 -0
- package/Voxels/Functions/Geometry/Inputs/BuldInputs.js +22 -0
- package/Voxels/Functions/Geometry/Rules/BuildRules.d.ts +1 -0
- package/Voxels/{Models/Rules/Functions → Functions/Geometry/Rules}/BuildRules.js +23 -23
- package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionFaceRegister.d.ts +2 -2
- package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionQuadFace.js +1 -1
- package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionTriangleFace.js +1 -1
- package/Voxels/{Models/Indexing → Geometry}/AOOcclusionFaceIndex.d.ts +2 -2
- package/Voxels/Geometry/AOOcclusionFaceIndex.js +28 -0
- package/Voxels/{Models/Indexing → Geometry}/CulledOcclusionFaceIndex.d.ts +2 -2
- package/Voxels/Geometry/CulledOcclusionFaceIndex.js +27 -0
- package/Voxels/Geometry/VoxelGeometry.types.d.ts +105 -0
- package/Voxels/Geometry/VoxelGeometry.types.js +1 -0
- package/Voxels/Indexes/VoxelIndex.js +15 -21
- package/Voxels/InitVoxelData.d.ts +4 -3
- package/Voxels/InitVoxelData.js +53 -110
- package/Voxels/Interaction/Functions/PickVoxel.js +1 -1
- package/Voxels/Logic/Classes/Types/VoxelLogicStateType.js +2 -2
- package/Voxels/Logic/Classes/VoxelLogic.d.ts +2 -2
- package/Voxels/Logic/Classes/VoxelLogic.js +2 -2
- package/Voxels/Logic/VoxelLogicRegister.js +2 -2
- package/Voxels/Models/Defaults/CubeVoxelGeometry.d.ts +1 -1
- package/Voxels/Models/Defaults/CubeVoxelModels.d.ts +1 -0
- package/Voxels/Models/Defaults/CubeVoxelModels.js +45 -0
- package/Voxels/Models/Defaults/Examples.d.ts +2 -1
- package/Voxels/Models/Defaults/Examples.js +28 -28
- package/Voxels/Models/Defaults/FarmVoxelModels.d.ts +3 -2
- package/Voxels/Models/Defaults/FarmVoxelModels.js +3 -3
- package/Voxels/Models/Defaults/LiquidVoxelModel.d.ts +2 -1
- package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -1
- package/Voxels/Models/VoxelModel.types.d.ts +2 -109
- package/Voxels/State/{Schema → Reltional}/Conditions/SameVoxelConditions.d.ts +2 -2
- package/Voxels/State/Reltional/Conditions/SameVoxelConditions.js +19 -0
- package/Voxels/State/Reltional/Conditions/ShapeStateSchemaRelationsCondition.d.ts +6 -0
- package/Voxels/State/Reltional/Conditions/ShapeStateSchemaRelationsCondition.js +6 -0
- package/Voxels/State/Reltional/ReltionalStateBuilder.d.ts +18 -0
- package/Voxels/State/Reltional/ReltionalStateBuilder.js +42 -0
- package/Voxels/State/Schema/BinarySchema.d.ts +1 -0
- package/Voxels/State/Schema/BinarySchema.js +3 -0
- package/Voxels/State/State.types.d.ts +0 -25
- package/Voxels/State/State.types.js +1 -22
- package/Voxels/State/VoxelSchemas.d.ts +22 -0
- package/Voxels/State/VoxelSchemas.js +60 -0
- package/Voxels/Types/PaintVoxelData.js +55 -45
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +4 -22
- package/World/Archive/Classes/ImportedSection.js +8 -8
- package/World/Archive/Functions/Sector/ArchiveSector.js +3 -3
- package/World/Cursor/SectionCursor.d.ts +1 -1
- package/World/Cursor/SectionCursor.js +1 -1
- package/World/Cursor/SectorCursor.d.ts +1 -1
- package/World/Cursor/SectorCursor.js +1 -1
- package/World/Cursor/WorldCursor.d.ts +1 -1
- package/World/Cursor/WorldCursor.js +1 -1
- package/World/Lock/Function/LockSectors.d.ts +1 -1
- package/World/Lock/Function/UnLockSectors.d.ts +1 -1
- package/World/SnapShot/SectionSnapShotCursor.d.ts +1 -1
- package/World/SnapShot/SectionSnapShotCursor.js +1 -1
- package/World/SnapShot/SnapShots.d.ts +1 -1
- package/World/SnapShot/SnapShots.js +1 -1
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +1 -1
- package/WorldSimulation/Dimensions/SimulationSector.js +2 -2
- package/WorldSimulation/Tools/SimulationBrush.js +9 -9
- package/WorldSimulation/Voxels/Behaviors/Types/CropVoxelBehavior.js +4 -2
- package/WorldSimulation/Voxels/Behaviors/Types/FarmlandVoxelBehavior.js +5 -2
- package/WorldSimulation/WorldSimulation.d.ts +1 -0
- package/WorldSimulation/WorldSimulation.js +2 -1
- package/package.json +1 -1
- package/Mesher/Voxels/Models/Nodes/Types/GeomtryNode.types.d.ts +0 -7
- package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -18
- package/Voxels/Data/VoxelPalettesRegister.js +0 -24
- package/Voxels/Functions/BuildPaletteData.d.ts +0 -6
- package/Voxels/Functions/BuildPaletteData.js +0 -87
- package/Voxels/Functions/BuildStateData.d.ts +0 -23
- package/Voxels/Functions/BuildStateData.js +0 -327
- package/Voxels/Models/CompiledVoxelModel.types.d.ts +0 -46
- package/Voxels/Models/Indexing/AOOcclusionFaceIndex.js +0 -28
- package/Voxels/Models/Indexing/CulledOcclusionFaceIndex.js +0 -27
- package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +0 -16
- package/Voxels/Models/Rules/Classes/GeomtryInput.js +0 -85
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +0 -22
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.js +0 -15
- package/Voxels/Models/Rules/Classes/VoxelRulesModel.d.ts +0 -19
- package/Voxels/Models/Rules/Classes/VoxelRulesModel.js +0 -29
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.d.ts +0 -5
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +0 -87
- package/Voxels/Models/Rules/Functions/BuildRules.d.ts +0 -7
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +0 -4
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.js +0 -39
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +0 -5
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.js +0 -14
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +0 -6
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +0 -92
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +0 -6
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +0 -115
- package/Voxels/Models/Rules/VoxelModelRuleBuilderRegister.d.ts +0 -18
- package/Voxels/Models/Rules/VoxelModelRuleBuilderRegister.js +0 -202
- package/Voxels/State/CondiotnalTreeReader.d.ts +0 -10
- package/Voxels/State/CondiotnalTreeReader.js +0 -23
- package/Voxels/State/LogicStatementReader.d.ts +0 -9
- package/Voxels/State/LogicStatementReader.js +0 -50
- package/Voxels/State/Schema/Conditions/SameVoxelConditions.js +0 -19
- package/Voxels/State/Schema/Conditions/ShapeStateSchemaRelationsCondition.d.ts +0 -6
- package/Voxels/State/Schema/Conditions/ShapeStateSchemaRelationsCondition.js +0 -6
- package/Voxels/State/Schema/ShapeStateRelationsNode.d.ts +0 -10
- package/Voxels/State/Schema/ShapeStateRelationsNode.js +0 -26
- package/Voxels/State/Schema/StateSchema.d.ts +0 -13
- package/Voxels/State/Schema/StateSchema.js +0 -17
- package/Voxels/State/Schema/VoxelSchema.d.ts +0 -7
- package/Voxels/State/Schema/VoxelSchema.js +0 -10
- package/Voxels/State/SchemaRegister.d.ts +0 -18
- package/Voxels/State/SchemaRegister.js +0 -76
- package/Voxels/State/StateTreeReader.d.ts +0 -9
- package/Voxels/State/StateTreeReader.js +0 -37
- /package/Mesher/{Geomtry → Geometry}/Functions/GetBounds.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Functions/GetBounds.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Geometry.types.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/Quad.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/Quad.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/QuadVertexData.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/QuadVertexData.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/Triangle.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/Triangle.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/TriangleVertexData.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/TriangleVertexData.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/index.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Primitives/index.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Proto/ProtoMesh.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Proto/ProtoMesh.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Proto/ProtoMeshBuffer.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Proto/ProtoMeshBuffer.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Shapes/Box.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Shapes/Box.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Transform/TransformBox.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Transform/TransformBox.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Transform/TransformQuad.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Transform/TransformQuad.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/Transform/TransformTriangle.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/Transform/TransformTriangle.js +0 -0
- /package/Mesher/{Geomtry → Geometry}/index.d.ts +0 -0
- /package/Mesher/{Geomtry → Geometry}/index.js +0 -0
- /package/Mesher/Items/{Geomtry → Geometry}/ItemMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/Items/{Geomtry → Geometry}/ItemMeshVertexStructCursor.js +0 -0
- /package/Mesher/Voxels/{Geomtry → Geometry}/CompactedSectionVoxelMesh.d.ts +0 -0
- /package/Mesher/Voxels/{Geomtry → Geometry}/VoxelMeshBVHBuilder.d.ts +0 -0
- /package/Mesher/Voxels/{Geomtry → Geometry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/Voxels/{Geomtry → Geometry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/Voxels/{Geomtry → Geometry}/VoxelShaderData.d.ts +0 -0
- /package/Mesher/Voxels/{Geomtry → Geometry}/VoxelShaderData.js +0 -0
- /package/Mesher/Voxels/Models/Nodes/Types/{GeomtryNode.types.js → GeometryNode.types.js} +0 -0
- /package/Voxels/{Models/CompiledVoxelModel.types.js → Functions/Geometry/GeometryLUT.types.js} +0 -0
- /package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionFace.d.ts +0 -0
- /package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionFace.js +0 -0
- /package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionFaceRegister.js +0 -0
- /package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionQuadFace.d.ts +0 -0
- /package/Voxels/{Models/Rules/Classes → Functions/Geometry/Rules}/OcclusionTriangleFace.d.ts +0 -0
- /package/Voxels/{Models/Indexing → Geometry}/VoxelRelativeCubeIndex.d.ts +0 -0
- /package/Voxels/{Models/Indexing → Geometry}/VoxelRelativeCubeIndex.js +0 -0
|
@@ -4,7 +4,7 @@ import { NumberPalette } from "../../../Util/NumberPalette";
|
|
|
4
4
|
import { BinaryBuffer, BinaryBufferFormat, } from "../../../Util/BinaryBuffer/index";
|
|
5
5
|
import { VoxelArchivePalette } from "../../../Voxels/Archive/VoxelPaletteArechive";
|
|
6
6
|
import { VoxelTagsRegister } from "../../../Voxels/Data/VoxelTagsRegister";
|
|
7
|
-
import {
|
|
7
|
+
import { VoxelLUT } from "../../../Voxels/Data/VoxelLUT";
|
|
8
8
|
import { EngineSettings } from "../../../Settings/EngineSettings";
|
|
9
9
|
/**
|
|
10
10
|
* Creates an archived template using the passed in the data cursor.
|
|
@@ -44,7 +44,7 @@ export default function CreateArchivedTemplate(dataCursor, bounds) {
|
|
|
44
44
|
? levelPalette.register(level)
|
|
45
45
|
: levelPalette.getId(level);
|
|
46
46
|
let voxelSecondary = 0;
|
|
47
|
-
if (VoxelTagsRegister.VoxelTags[
|
|
47
|
+
if (VoxelTagsRegister.VoxelTags[VoxelLUT.voxels[rawData[0]][0]]["dve_can_have_secondary"]) {
|
|
48
48
|
voxelSecondary = voxelPalette.register(rawData[3]);
|
|
49
49
|
if (!secondaryPalette.isRegistered(voxelSecondary))
|
|
50
50
|
secondaryPalette.register(voxelSecondary);
|
|
@@ -2,7 +2,7 @@ import { TemplateVoxelCursor } from "./TemplateVoxelCursor";
|
|
|
2
2
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
3
3
|
import { IVoxelTemplate } from "../../Templates/VoxelTemplates.types";
|
|
4
4
|
import { TemplateProxy } from "./TemplateProxy";
|
|
5
|
-
import { BoundingBox } from "@amodx/math/
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
6
6
|
export declare class TemplateCursor implements DataCursorInterface {
|
|
7
7
|
_voxelIndex: number;
|
|
8
8
|
_proxy: TemplateProxy | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TemplateVoxelCursor } from "./TemplateVoxelCursor";
|
|
2
2
|
import { TemplateProxy } from "./TemplateProxy";
|
|
3
3
|
import { VoxelCursor } from "../../Voxels/Cursor/VoxelCursor";
|
|
4
|
-
import { BoundingBox } from "@amodx/math/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
5
|
const raw = [0, 0, 0, 0];
|
|
6
6
|
export class TemplateCursor {
|
|
7
7
|
_voxelIndex = 0;
|
|
@@ -2,7 +2,7 @@ import { Flat3DIndex, Vec3Array } from "@amodx/math";
|
|
|
2
2
|
import { IVoxelTemplate } from "../VoxelTemplates.types";
|
|
3
3
|
import { FullVoxelTemplateData } from "./FullVoxelTemplate.types";
|
|
4
4
|
import { RawVoxelData } from "../../Voxels/Types/Voxel.types";
|
|
5
|
-
import { BoundingBox } from "@amodx/math/
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
6
6
|
export declare class FullVoxelTemplate implements IVoxelTemplate<"full"> {
|
|
7
7
|
static CreateNew(bounds: Vec3Array, baseLightValue?: number): FullVoxelTemplateData;
|
|
8
8
|
index: Flat3DIndex;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
2
2
|
import { getBitArrayIndex } from "../../Util/Binary/BinaryArrays";
|
|
3
3
|
import { EngineSettings } from "../../Settings/EngineSettings";
|
|
4
|
-
import { BoundingBox } from "@amodx/math/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
5
|
const point = Vector3Like.Create();
|
|
6
6
|
export class FullVoxelTemplate {
|
|
7
7
|
static CreateNew(bounds, baseLightValue = 0) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BoundsMinMaxData } from "@amodx/math/
|
|
1
|
+
import { BoundsMinMaxData } from "@amodx/math/Geometry/Bounds/BoundsInterface";
|
|
2
2
|
import { DataCursorInterface } from "../../../Voxels/Cursor/DataCursor.interface";
|
|
3
3
|
export default function CreateFullTemplate(dataCursor: DataCursorInterface, bounds: BoundsMinMaxData, storeLight?: boolean): import("../FullVoxelTemplate.types").FullVoxelTemplateData;
|
|
@@ -2,7 +2,7 @@ import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
|
2
2
|
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
4
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
5
|
-
import { BoundingBox } from "@amodx/math/
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
6
6
|
export interface VoxelBFSSelectionData extends IVoxelSelectionData<"bfs"> {
|
|
7
7
|
bitIndex: Uint8Array;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
|
2
2
|
import { CardinalNeighbors3D } from "../../Math/CardinalNeighbors";
|
|
3
3
|
import { getBitArrayIndex, setBitArrayIndex, } from "../../Util/Binary/BinaryArrays";
|
|
4
4
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
5
|
-
import { BoundingBox } from "@amodx/math/
|
|
5
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
6
6
|
export class VoxelBFSSelection {
|
|
7
7
|
origin = Vector3Like.Create();
|
|
8
8
|
bitIndex;
|
|
@@ -3,7 +3,7 @@ import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
|
3
3
|
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
4
4
|
import { IVoxelshapeTemplateBaseData } from "../Shapes/VoxelShapeTemplate.types";
|
|
5
5
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
6
|
-
import { BoundingBox } from "@amodx/math/
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
7
7
|
export interface VoxelBoundsSelectionData extends IVoxelSelectionData<"bounds"> {
|
|
8
8
|
}
|
|
9
9
|
export declare class VoxelBoundsSelection implements IVoxelSelection<"bounds", VoxelBoundsSelectionData> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vec3ArrayLike, Vector3Like } from "@amodx/math";
|
|
2
2
|
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
3
3
|
import { BoxVoxelShapeSelection } from "../Shapes/Selections/BoxVoxelShapeSelection";
|
|
4
|
-
import { BoundingBox } from "@amodx/math/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
5
|
const getMinMax = (...points) => {
|
|
6
6
|
if (points.length === 0) {
|
|
7
7
|
throw new Error("At least one point is required to calculate min/max.");
|
|
@@ -3,7 +3,7 @@ import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
|
3
3
|
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
4
4
|
import { IVoxelshapeTemplateBaseData } from "../Shapes/VoxelShapeTemplate.types";
|
|
5
5
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
6
|
-
import { BoundingBox } from "@amodx/math/
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
7
7
|
export interface VoxelPointSelectionData extends IVoxelSelectionData<"point"> {
|
|
8
8
|
}
|
|
9
9
|
export declare class VoxelPointSelection implements IVoxelSelection<"point", VoxelPointSelectionData> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { VoxelShapeTemplate } from "../Shapes/VoxelShapeTemplate";
|
|
3
3
|
import { BoxVoxelShapeSelection } from "../Shapes/Selections/BoxVoxelShapeSelection";
|
|
4
|
-
import { BoundingBox } from "@amodx/math/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
5
|
export class VoxelPointSelection {
|
|
6
6
|
origin = Vector3Like.Create();
|
|
7
7
|
bounds = new BoundingBox();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export interface IVoxelSelection<Type extends string = "", Data extends IVoxelSelectionData<Type> = any> {
|
|
4
4
|
origin: Vector3Like;
|
|
5
5
|
bounds: BoundingBox;
|
|
@@ -3,7 +3,7 @@ import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
|
3
3
|
import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
|
|
4
4
|
import { PaintVoxelData } from "../../Voxels/Types/PaintVoxelData";
|
|
5
5
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
6
|
-
import { BoundingBox } from "@amodx/math/
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
7
7
|
export interface VoxelSurfaceSelectionData extends IVoxelSelectionData<"surface"> {
|
|
8
8
|
normal: Vector3Like;
|
|
9
9
|
bitIndex: Uint8Array;
|
|
@@ -3,7 +3,7 @@ import { CardinalNeighbors2D } from "../../Math/CardinalNeighbors";
|
|
|
3
3
|
import { getBitArrayIndex, setBitArrayIndex, } from "../../Util/Binary/BinaryArrays";
|
|
4
4
|
import { PaintVoxelData } from "../../Voxels/Types/PaintVoxelData";
|
|
5
5
|
import { FullVoxelTemplate } from "../Full/FullVoxelTemplate";
|
|
6
|
-
import { BoundingBox } from "@amodx/math/
|
|
6
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
7
7
|
export class VoxelSurfaceSelection {
|
|
8
8
|
origin = Vector3Like.Create();
|
|
9
9
|
normal = Vector3Like.Create();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { IVoxelSelection, IVoxelSelectionData } from "./VoxelSelection";
|
|
3
3
|
import { IVoxelTemplate, IVoxelTemplateData } from "../VoxelTemplates.types";
|
|
4
|
-
import { BoundingBox } from "@amodx/math/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
5
|
import type { VoxelTemplateRegister } from "../VoxelTemplateRegister";
|
|
6
6
|
export interface VoxelTemplateSelectionData extends IVoxelSelectionData<"template"> {
|
|
7
7
|
template: IVoxelTemplateData<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class VoxelTemplateSelection {
|
|
4
4
|
static Register;
|
|
5
5
|
origin = Vector3Like.Create();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface BoxVoxelShapeSelectionData extends IVoxelShapeSelectionData<"box-shape"> {
|
|
5
5
|
width: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class BoxVoxelShapeSelection {
|
|
4
4
|
static Type = "box-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface ConeVoxelShapeSelectionData extends IVoxelShapeSelectionData<"cone-shape"> {
|
|
5
5
|
width: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class ConeVoxelShapeSelection {
|
|
4
4
|
static Type = "cone-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface CylinderVoxelShapeSelectionData extends IVoxelShapeSelectionData<"cylinder-shape"> {
|
|
5
5
|
width: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class CylinderVoxelShapeSelection {
|
|
4
4
|
static Type = "cylinder-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface EllipsoidVoxelShapeSelectionData extends IVoxelShapeSelectionData<"ellipsoid-shape"> {
|
|
5
5
|
radiusX: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class EllipsoidVoxelShapeSelection {
|
|
4
4
|
static Type = "ellipsoid-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface OctahedronVoxelShapeSelectionData extends IVoxelShapeSelectionData<"octahedron-shape"> {
|
|
5
5
|
width: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class OctahedronVoxelShapeSelection {
|
|
4
4
|
static Type = "octahedron-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { VoxelShapeShapeDirections } from "../VoxelShape.types";
|
|
4
4
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
5
5
|
export interface PyramidVoxelShapeSelectionData extends IVoxelShapeSelectionData<"pyramid-shape"> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class PyramidVoxelShapeSelection {
|
|
4
4
|
static Type = "pyramid-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface SphereVoxelShapeSelectionData extends IVoxelShapeSelectionData<"sphere-shape"> {
|
|
5
5
|
radius: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class SphereVoxelShapeSelection {
|
|
4
4
|
static Type = "sphere-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
|
|
4
4
|
export interface TorusVoxelShapeSelectionData extends IVoxelShapeSelectionData<"torus-shape"> {
|
|
5
5
|
width: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
export class TorusVoxelShapeSelection {
|
|
4
4
|
static Type = "torus-shape";
|
|
5
5
|
static CreateNew(data) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Flat3DIndex } from "@amodx/math";
|
|
2
2
|
import { PaintVoxelData, RawVoxelData } from "../../Voxels";
|
|
3
3
|
import { VoxelShapeTemplateData, VoxelShapeTemplateFillModes } from "./VoxelShapeTemplate.types";
|
|
4
|
-
import { BoundingBox } from "@amodx/math/
|
|
4
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
5
|
import { IVoxelTemplate } from "../VoxelTemplates.types";
|
|
6
6
|
import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./Selections/VoxelShapeSelection";
|
|
7
7
|
import type { VoxelTemplateRegister } from "../VoxelTemplateRegister";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Flat3DIndex } from "@amodx/math";
|
|
2
2
|
import { PaintVoxelData } from "../../Voxels";
|
|
3
|
-
import { BoundingBox } from "@amodx/math/
|
|
3
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
4
4
|
import { BoxVoxelShapeSelection } from "./Selections/BoxVoxelShapeSelection";
|
|
5
5
|
export class VoxelShapeTemplate {
|
|
6
6
|
static Register;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Flat3DIndex, Vector3Like } from "@amodx/math";
|
|
2
|
-
import { BoundingBox } from "@amodx/math/
|
|
2
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
3
3
|
import { RawVoxelData } from "../Voxels/Types/Voxel.types";
|
|
4
4
|
export interface IVoxelTemplate<Type extends string = "", Data extends IVoxelTemplateData<Type> = any> {
|
|
5
5
|
bounds: BoundingBox;
|
|
@@ -6,50 +6,6 @@ let context;
|
|
|
6
6
|
let atlasCanvas;
|
|
7
7
|
let atlasContext;
|
|
8
8
|
const finalSize = [256, 256];
|
|
9
|
-
function getNearestColor(x, y, data) {
|
|
10
|
-
const searchRadius = 5; // Radius to search for a valid pixel
|
|
11
|
-
for (let r = 1; r <= searchRadius; r++) {
|
|
12
|
-
for (let dx = -r; dx <= r; dx++) {
|
|
13
|
-
for (let dy = -r; dy <= r; dy++) {
|
|
14
|
-
const nx = x + dx;
|
|
15
|
-
const ny = y + dy;
|
|
16
|
-
if (nx >= 0 && nx < canvas.width && ny >= 0 && ny < canvas.height) {
|
|
17
|
-
const index = (ny * canvas.width + nx) * 4;
|
|
18
|
-
if (data[index + 3] > 0) {
|
|
19
|
-
// If pixel is not fully transparent
|
|
20
|
-
return [data[index], data[index + 1], data[index + 2]];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return [0, 0, 0]; // Default to black if no nearby pixel is found
|
|
27
|
-
}
|
|
28
|
-
function applyAlphaBleeding(image) {
|
|
29
|
-
const canvas = document.createElement("canvas");
|
|
30
|
-
const ctx = canvas.getContext("2d", { willReadFrequently: true });
|
|
31
|
-
if (!ctx)
|
|
32
|
-
throw new Error("Could not get 2D context");
|
|
33
|
-
canvas.width = image.width;
|
|
34
|
-
canvas.height = image.height;
|
|
35
|
-
ctx.drawImage(image, 0, 0);
|
|
36
|
-
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
37
|
-
const data = imageData.data;
|
|
38
|
-
for (let y = 0; y < canvas.height; y++) {
|
|
39
|
-
for (let x = 0; x < canvas.width; x++) {
|
|
40
|
-
const index = (y * canvas.width + x) * 4;
|
|
41
|
-
const alpha = data[index + 3];
|
|
42
|
-
if (alpha === 0) {
|
|
43
|
-
const [r, g, b] = getNearestColor(x, y, data);
|
|
44
|
-
data[index] = r;
|
|
45
|
-
data[index + 1] = g;
|
|
46
|
-
data[index + 2] = b;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
ctx.putImageData(imageData, 0, 0);
|
|
51
|
-
return canvas;
|
|
52
|
-
}
|
|
53
9
|
async function getImageBase64(url) {
|
|
54
10
|
const response = await fetch(url);
|
|
55
11
|
const blob = await response.blob();
|
|
@@ -70,17 +26,15 @@ function loadImage(src) {
|
|
|
70
26
|
}
|
|
71
27
|
async function sliceImageIntoTiles(src, tilesX, tilesY) {
|
|
72
28
|
const image = await loadImage(src);
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
const tileWidth = processedCanvas.width / tilesX;
|
|
76
|
-
const tileHeight = processedCanvas.height / tilesY;
|
|
29
|
+
const tileWidth = image.width / tilesX;
|
|
30
|
+
const tileHeight = image.height / tilesY;
|
|
77
31
|
atlasCanvas.width = tileWidth;
|
|
78
32
|
atlasCanvas.height = tileHeight;
|
|
79
33
|
const tiles = [];
|
|
80
34
|
for (let x = 0; x < tilesX; x++) {
|
|
81
35
|
for (let y = 0; y < tilesY; y++) {
|
|
82
36
|
atlasContext.clearRect(0, 0, tileWidth, tileHeight);
|
|
83
|
-
atlasContext.drawImage(
|
|
37
|
+
atlasContext.drawImage(image, x * tileWidth, y * tileHeight, tileWidth, tileHeight, 0, 0, tileWidth, tileHeight);
|
|
84
38
|
tiles[CompiledTexture.GetAtlasIndex(x, y, tilesX)] =
|
|
85
39
|
atlasCanvas.toDataURL("image/png");
|
|
86
40
|
}
|
|
@@ -98,14 +52,12 @@ async function loadImageForShader(imgSrcData) {
|
|
|
98
52
|
if (typeof imgSrcData === "string")
|
|
99
53
|
image.src = imgSrcData;
|
|
100
54
|
image.onload = () => {
|
|
101
|
-
// Apply alpha bleeding before drawing
|
|
102
|
-
const processedCanvas = applyAlphaBleeding(image);
|
|
103
55
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
104
56
|
context.imageSmoothingEnabled = false;
|
|
105
57
|
context.save();
|
|
106
58
|
context.translate(0, canvas.height);
|
|
107
59
|
context.scale(1, -1);
|
|
108
|
-
context.drawImage(
|
|
60
|
+
context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
109
61
|
context.restore();
|
|
110
62
|
const dataUrl = canvas.toDataURL("image/png");
|
|
111
63
|
const returnImage = new Image(canvas.width, canvas.height);
|
package/Tools/Brush/Brush.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WorldCursor } from "../../World/Cursor/WorldCursor.js";
|
|
2
2
|
import { VoxelCursor } from "../../Voxels/Cursor/VoxelCursor.js";
|
|
3
3
|
import { WorldRegister } from "../../World/WorldRegister.js";
|
|
4
|
-
import {
|
|
4
|
+
import { VoxelLUT } from "../../Voxels/Data/VoxelLUT.js";
|
|
5
5
|
import { PaintVoxelData } from "../../Voxels/Types/PaintVoxelData.js";
|
|
6
6
|
const air = [0, 0, 0, 0];
|
|
7
7
|
const temp = [0, 0, 0, 0];
|
|
@@ -67,18 +67,18 @@ export class BrushTool {
|
|
|
67
67
|
}
|
|
68
68
|
setId(id) {
|
|
69
69
|
this.data.id = id;
|
|
70
|
-
this.data.name =
|
|
70
|
+
this.data.name = VoxelLUT.voxelIdToNameMap.get(id);
|
|
71
71
|
return this;
|
|
72
72
|
}
|
|
73
73
|
setName(name) {
|
|
74
|
-
this.data.id =
|
|
74
|
+
this.data.id = VoxelLUT.voxelNametoIdMap.get(name);
|
|
75
75
|
this.data.name = name;
|
|
76
76
|
return this;
|
|
77
77
|
}
|
|
78
78
|
setSecondaryId(id) {
|
|
79
79
|
this.data.secondaryVoxelId = id;
|
|
80
80
|
if (id) {
|
|
81
|
-
this.data.secondaryName =
|
|
81
|
+
this.data.secondaryName = VoxelLUT.voxelIdToNameMap.get(id);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
this.data.secondaryName = "";
|
|
@@ -88,7 +88,7 @@ export class BrushTool {
|
|
|
88
88
|
setSecondaryName(name) {
|
|
89
89
|
if (name) {
|
|
90
90
|
this.data.secondaryVoxelId =
|
|
91
|
-
|
|
91
|
+
VoxelLUT.voxelNametoIdMap.get(name);
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
94
|
this.data.secondaryVoxelId = "";
|
package/Util/StringPalette.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VoxelSchemas } from "../State/VoxelSchemas";
|
|
2
2
|
import { BinarySchema } from "../State/Schema/BinarySchema";
|
|
3
3
|
import { BinaryBuffer } from "../../Util/BinaryBuffer/BinaryBuffer";
|
|
4
4
|
const temp = ["", 0, 0];
|
|
@@ -35,7 +35,7 @@ export class VoxelPaletteArchiveReader {
|
|
|
35
35
|
temp[2] = 0;
|
|
36
36
|
return temp;
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const currentStateSchema = VoxelSchemas.getStateSchema(voxelId);
|
|
39
39
|
let finalStateValue = 0;
|
|
40
40
|
if (this._voxelStateSchema.has(voxelId)) {
|
|
41
41
|
const stateSchema = this._voxelStateSchema.get(voxelId);
|
|
@@ -43,26 +43,27 @@ export class VoxelPaletteArchiveReader {
|
|
|
43
43
|
stateSchema.startEncoding(stateValue);
|
|
44
44
|
for (const node of stateSchema.nodes) {
|
|
45
45
|
if (node.valuePalette) {
|
|
46
|
-
|
|
46
|
+
currentStateSchema.setValue(node.name, stateSchema.getValue(node.name));
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
|
|
49
|
+
currentStateSchema.setNumber(node.name, stateSchema.getNumber(node.name));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
finalStateValue = stateSchema.getEncoded();
|
|
53
53
|
}
|
|
54
54
|
temp[1] = finalStateValue;
|
|
55
55
|
let finalModValue = 0;
|
|
56
|
+
const currentModSchema = VoxelSchemas.mod.get(voxelId);
|
|
56
57
|
if (this._modSchema.has(voxelId)) {
|
|
57
58
|
const modSchema = this._modSchema.get(voxelId);
|
|
58
59
|
const modValue = this.voxelPalette[index + 2];
|
|
59
60
|
modSchema.startEncoding(modValue);
|
|
60
61
|
for (const node of modSchema.nodes) {
|
|
61
62
|
if (node.valuePalette) {
|
|
62
|
-
|
|
63
|
+
currentModSchema.setValue(node.name, modSchema.getValue(node.name));
|
|
63
64
|
}
|
|
64
65
|
else {
|
|
65
|
-
|
|
66
|
+
currentModSchema.setNumber(node.name, modSchema.getNumber(node.name));
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
finalModValue = modSchema.getEncoded();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BinaryBufferFormat } from "../../Util/BinaryBuffer";
|
|
2
2
|
import { BinaryBuffer } from "../../Util/BinaryBuffer/BinaryBuffer";
|
|
3
3
|
import { StringPalette } from "../../Util/StringPalette";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { VoxelLUT } from "../Data/VoxelLUT";
|
|
5
|
+
import { VoxelSchemas } from "../State/VoxelSchemas";
|
|
6
6
|
import { VoxelPaletteCompents, } from "./VoxelArchive.types";
|
|
7
7
|
export class VoxelArchivePalette {
|
|
8
8
|
static GetVoxelPaletteDataKey() {
|
|
@@ -36,13 +36,13 @@ export class VoxelArchivePalette {
|
|
|
36
36
|
register(id) {
|
|
37
37
|
if (this._voxelsRegistered.has(id))
|
|
38
38
|
return this._voxelsRegistered.get(id);
|
|
39
|
-
const stringId =
|
|
39
|
+
const stringId = VoxelLUT.voxelIds.getStringId(VoxelLUT.voxels[id][0]);
|
|
40
40
|
let voxelId = 0;
|
|
41
41
|
if (!this._ids.isRegistered(stringId)) {
|
|
42
42
|
voxelId = this._ids.register(stringId);
|
|
43
|
-
const modelId =
|
|
44
|
-
const stateData =
|
|
45
|
-
const modData =
|
|
43
|
+
const modelId = VoxelLUT.models.getStringId(VoxelLUT.modelsIndex[VoxelLUT.voxelIds.getNumberId(stringId)]);
|
|
44
|
+
const stateData = VoxelSchemas.getStateSchema(stringId).getSchema();
|
|
45
|
+
const modData = VoxelSchemas.mod.get(stringId).getSchema();
|
|
46
46
|
if (stateData && stateData?.length) {
|
|
47
47
|
this._stateShemas[modelId] = stateData;
|
|
48
48
|
}
|
|
@@ -51,7 +51,7 @@ export class VoxelArchivePalette {
|
|
|
51
51
|
...(modData && modData.length ? { modSchema: modData } : {}),
|
|
52
52
|
...(this._stateShemas[modelId] ? { stateSchemaId: modelId } : {}),
|
|
53
53
|
};
|
|
54
|
-
const name =
|
|
54
|
+
const name = VoxelLUT.voxelNametoIdMap.get(stringId);
|
|
55
55
|
if (name !== undefined && name !== stringId) {
|
|
56
56
|
voxelData.name = name;
|
|
57
57
|
}
|
|
@@ -60,7 +60,7 @@ export class VoxelArchivePalette {
|
|
|
60
60
|
else {
|
|
61
61
|
voxelId = this._ids.getNumberId(stringId);
|
|
62
62
|
}
|
|
63
|
-
const [, state, mod] =
|
|
63
|
+
const [, state, mod] = VoxelLUT.voxels[id];
|
|
64
64
|
this._voxelPalette.push(voxelId, state, mod);
|
|
65
65
|
const paletteId = this._voxelCount;
|
|
66
66
|
this._voxelsRegistered.set(id, paletteId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoundingBox } from "@amodx/math/
|
|
1
|
+
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
2
2
|
import { VoxelCursorInterface } from "./VoxelCursor.interface";
|
|
3
3
|
import { Vector3Like } from "@amodx/math";
|
|
4
4
|
export interface DataCursorInterface {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { VoxelLightData } from "./VoxelLightData";
|
|
2
2
|
import { RawVoxelData } from "../Types/Voxel.types";
|
|
3
3
|
import { VoxelSubstanceTags, VoxelTags } from "../../Voxels/Data/VoxelTag.types";
|
|
4
|
-
import { VoxelSchema } from "../../Voxels/State/Schema/VoxelSchema";
|
|
5
4
|
import { NumberArray } from "../../Util/Util.types";
|
|
6
5
|
export declare abstract class VoxelCursorInterface {
|
|
7
6
|
_voxelId: number;
|
|
8
7
|
id: number;
|
|
9
8
|
secondaryId: number;
|
|
10
|
-
schema: VoxelSchema;
|
|
11
9
|
tags: VoxelTags;
|
|
12
10
|
substanceTags: VoxelSubstanceTags;
|
|
13
11
|
__readingSecondaryVoxel: boolean;
|