@divinevoxel/vlox 0.0.77 → 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
|
@@ -1,115 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VoxelFaceNames } from "../../Math";
|
|
1
|
+
import { Vec3Array } from "@amodx/math";
|
|
3
2
|
import { VoxelModelRelationsSchemaNodes, VoxelBinaryStateSchemaNode } from "../../Voxels/State/State.types";
|
|
4
3
|
import { VoxelEffectData } from "../../Voxels/Effects/VoxelEffects.types";
|
|
5
4
|
import { VoxelBaseProperties } from "../Types/Voxel.types";
|
|
6
|
-
|
|
7
|
-
export interface VoxelCustomGeomtryNode {
|
|
8
|
-
type: "custom";
|
|
9
|
-
id: string;
|
|
10
|
-
inputs: Record<string, any>;
|
|
11
|
-
}
|
|
12
|
-
export interface VoxelBoxGeometryNode {
|
|
13
|
-
type: "box";
|
|
14
|
-
/**Divisor used for transform of this specific node.*/
|
|
15
|
-
divisor?: Vec3Array;
|
|
16
|
-
points: [start: Vec3Array, end: Vec3Array];
|
|
17
|
-
rotation?: Vec3Array;
|
|
18
|
-
faces: Record<VoxelFaceNames, BaseVoxelQuadData>;
|
|
19
|
-
}
|
|
20
|
-
export interface BaseVoxelQuadData {
|
|
21
|
-
doubleSided?: boolean | string;
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
/**Id for an input arg for the texture */
|
|
24
|
-
texture: string;
|
|
25
|
-
/**UV for the face or id for an input arg. */
|
|
26
|
-
uv: [x1: number, y1: number, x2: number, y2: number] | string;
|
|
27
|
-
/**UV rotation or id for an input arg */
|
|
28
|
-
rotation?: number | string;
|
|
29
|
-
}
|
|
30
|
-
export interface VoxelQuadGeometryNode extends BaseVoxelQuadData {
|
|
31
|
-
type: "quad";
|
|
32
|
-
/**Divisor used for transform of this specific node.*/
|
|
33
|
-
divisor?: Vec3Array;
|
|
34
|
-
points: [p1: Vec3Array, p2: Vec3Array, p3: Vec3Array, p4: Vec3Array];
|
|
35
|
-
}
|
|
36
|
-
export interface BaseVoxelTriangleData {
|
|
37
|
-
doubleSided?: boolean;
|
|
38
|
-
/**Id for the input arg for the texture */
|
|
39
|
-
texture: string;
|
|
40
|
-
/**UV for the triangle or id for the input arg. */
|
|
41
|
-
uv: [v1: Vec2Array, v2: Vec2Array, v3: Vec2Array] | string;
|
|
42
|
-
/**UV rotation or id for an input arg */
|
|
43
|
-
rotation?: number | string;
|
|
44
|
-
}
|
|
45
|
-
export interface VoxelTriangleGeometryNode extends BaseVoxelTriangleData {
|
|
46
|
-
type: "triangle";
|
|
47
|
-
/**Divisor used for transform of this specific node.*/
|
|
48
|
-
divisor?: Vec3Array;
|
|
49
|
-
points: [p1: Vec3Array, p2: Vec3Array, p3: Vec3Array];
|
|
50
|
-
}
|
|
51
|
-
export interface VoxelGeometryTextureArgument {
|
|
52
|
-
type: "texture";
|
|
53
|
-
}
|
|
54
|
-
/**Creates a way to set multiple arguments to the same thing. What ever value is passed in will be passed to the arguments. */
|
|
55
|
-
export interface VoxelGeometryArgumentAliasList {
|
|
56
|
-
type: "arg-list";
|
|
57
|
-
arguments: string[];
|
|
58
|
-
}
|
|
59
|
-
export interface VoxelGeometryBooleanArgument {
|
|
60
|
-
type: "boolean";
|
|
61
|
-
default: boolean;
|
|
62
|
-
}
|
|
63
|
-
export interface VoxelGeometryIntArgument {
|
|
64
|
-
type: "int";
|
|
65
|
-
default: number;
|
|
66
|
-
}
|
|
67
|
-
export interface VoxelGeometryFloatArgument {
|
|
68
|
-
type: "float";
|
|
69
|
-
default: number;
|
|
70
|
-
}
|
|
71
|
-
export interface VoxelGeometryBoxUVArgument {
|
|
72
|
-
type: "box-uv";
|
|
73
|
-
default: [x1: number, y1: number, x2: number, y2: number];
|
|
74
|
-
}
|
|
75
|
-
export interface VoxelGeometryUVArgument {
|
|
76
|
-
type: "uv";
|
|
77
|
-
default: Vec2Array[];
|
|
78
|
-
}
|
|
79
|
-
export interface VoxelGeometryVector3Argument {
|
|
80
|
-
type: "vector3";
|
|
81
|
-
default?: Vec3Array;
|
|
82
|
-
min?: Vec3Array;
|
|
83
|
-
max?: Vec3Array;
|
|
84
|
-
}
|
|
85
|
-
export type VoxelGeometryNodes = VoxelCustomGeomtryNode | VoxelBoxGeometryNode | VoxelTriangleGeometryNode | VoxelQuadGeometryNode;
|
|
86
|
-
export type CullingProcedureData = {
|
|
87
|
-
type: "default";
|
|
88
|
-
} | {
|
|
89
|
-
type: "none";
|
|
90
|
-
} | {
|
|
91
|
-
type: "transparent";
|
|
92
|
-
} | {
|
|
93
|
-
type: "custom";
|
|
94
|
-
id: string;
|
|
95
|
-
data: any;
|
|
96
|
-
};
|
|
97
|
-
export interface VoxelGeometryData {
|
|
98
|
-
id: string;
|
|
99
|
-
nodes: VoxelGeometryNodes[];
|
|
100
|
-
divisor?: Vec3Array;
|
|
101
|
-
/**
|
|
102
|
-
* If this is set the voxel geometry will not be included in the
|
|
103
|
-
* geometry rules and will be fall back to custom inputs.
|
|
104
|
-
* Ideal for advanced or non cubic models.
|
|
105
|
-
* */
|
|
106
|
-
doNotBuildRules?: true;
|
|
107
|
-
/**
|
|
108
|
-
* Define the culling procedure for faces
|
|
109
|
-
*/
|
|
110
|
-
cullingProcedure?: CullingProcedureData;
|
|
111
|
-
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument | VoxelGeometryArgumentAliasList>;
|
|
112
|
-
}
|
|
5
|
+
import { CullingProcedureData, VoxelGeometryTextureArgument, VoxelGeometryBoxUVArgument, VoxelGeometryVector3Argument, VoxelGeometryIntArgument, VoxelGeometryBooleanArgument, VoxelGeometryFloatArgument } from "../Geometry/VoxelGeometry.types";
|
|
113
6
|
export interface VoxelGeometryLinkData {
|
|
114
7
|
geometryId: string;
|
|
115
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SameVoxelRelationsConditionData } from "../../State.types";
|
|
2
2
|
import { ShapeStateSchemaRelationsCondition } from "./ShapeStateSchemaRelationsCondition";
|
|
3
|
-
import {
|
|
3
|
+
import { ReltionalStateBuilder } from "../ReltionalStateBuilder";
|
|
4
4
|
export declare class SameVoxelCondition extends ShapeStateSchemaRelationsCondition {
|
|
5
5
|
data: SameVoxelRelationsConditionData;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(builder: ReltionalStateBuilder, data: SameVoxelRelationsConditionData);
|
|
7
7
|
evulate(): boolean;
|
|
8
8
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ShapeStateSchemaRelationsCondition } from "./ShapeStateSchemaRelationsCondition";
|
|
2
|
+
export class SameVoxelCondition extends ShapeStateSchemaRelationsCondition {
|
|
3
|
+
data;
|
|
4
|
+
constructor(builder, data) {
|
|
5
|
+
super(builder);
|
|
6
|
+
this.data = data;
|
|
7
|
+
}
|
|
8
|
+
evulate() {
|
|
9
|
+
const nx = this.builder.position.x + this.data.direction[0];
|
|
10
|
+
const ny = this.builder.position.y + this.data.direction[1];
|
|
11
|
+
const nz = this.builder.position.z + this.data.direction[2];
|
|
12
|
+
if (!this.builder.dataCursor.inBounds(nx, ny, nz))
|
|
13
|
+
return false;
|
|
14
|
+
const nVoxel = this.builder.dataCursor.getVoxel(nx, ny, nz);
|
|
15
|
+
if (!nVoxel)
|
|
16
|
+
return false;
|
|
17
|
+
return this.builder.voxel.isSameVoxel(nVoxel);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { VoxelModelRelationsSchemaNodes } from "../State.types";
|
|
3
|
+
import { ShapeStateSchemaRelationsCondition } from "./Conditions/ShapeStateSchemaRelationsCondition";
|
|
4
|
+
import { VoxelCursorInterface } from "../../Cursor/VoxelCursor.interface";
|
|
5
|
+
import { DataCursorInterface } from "../../Cursor/DataCursor.interface";
|
|
6
|
+
import { BinarySchema } from "../Schema/BinarySchema";
|
|
7
|
+
export declare class ReltionalStateBuilder {
|
|
8
|
+
binarySchema: BinarySchema;
|
|
9
|
+
readonly schemaNodes: VoxelModelRelationsSchemaNodes[];
|
|
10
|
+
name: string;
|
|
11
|
+
position: Vector3Like;
|
|
12
|
+
voxel: VoxelCursorInterface;
|
|
13
|
+
dataCursor: DataCursorInterface;
|
|
14
|
+
nodes: Map<string, ShapeStateSchemaRelationsCondition[]>;
|
|
15
|
+
constructor(binarySchema: BinarySchema, schemaNodes: VoxelModelRelationsSchemaNodes[]);
|
|
16
|
+
buildState(): number;
|
|
17
|
+
getSchema(): VoxelModelRelationsSchemaNodes[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
import { SameVoxelCondition } from "./Conditions/SameVoxelConditions";
|
|
3
|
+
export class ReltionalStateBuilder {
|
|
4
|
+
binarySchema;
|
|
5
|
+
schemaNodes;
|
|
6
|
+
name;
|
|
7
|
+
position = Vector3Like.Create();
|
|
8
|
+
voxel;
|
|
9
|
+
dataCursor;
|
|
10
|
+
nodes = new Map();
|
|
11
|
+
constructor(binarySchema, schemaNodes) {
|
|
12
|
+
this.binarySchema = binarySchema;
|
|
13
|
+
this.schemaNodes = schemaNodes;
|
|
14
|
+
for (const node of schemaNodes) {
|
|
15
|
+
const conditions = [];
|
|
16
|
+
for (const cond of node.conditions) {
|
|
17
|
+
if (cond.type == "same-voxel") {
|
|
18
|
+
conditions.push(new SameVoxelCondition(this, cond));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
this.nodes.set(node.name, conditions);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
buildState() {
|
|
25
|
+
this.binarySchema.startEncoding(0);
|
|
26
|
+
for (const [nodeId, conditions] of this.nodes) {
|
|
27
|
+
let value = 1;
|
|
28
|
+
const conditionsLength = conditions.length;
|
|
29
|
+
for (let i = 0; i < conditionsLength; i++) {
|
|
30
|
+
if (!conditions[i].evulate()) {
|
|
31
|
+
value = 0;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
this.binarySchema.setNumber(nodeId, value);
|
|
36
|
+
}
|
|
37
|
+
return this.binarySchema.getEncoded();
|
|
38
|
+
}
|
|
39
|
+
getSchema() {
|
|
40
|
+
return this.schemaNodes;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -24,28 +24,3 @@ export interface VoxelModelRelationsSchemaNodes {
|
|
|
24
24
|
name: string;
|
|
25
25
|
conditions: VoxelStateRelationsConditionData[];
|
|
26
26
|
}
|
|
27
|
-
export declare enum StateCompareOperations {
|
|
28
|
-
Equals = 0,
|
|
29
|
-
NotEquals = 1,
|
|
30
|
-
GreaterThan = 2,
|
|
31
|
-
LessThan = 3
|
|
32
|
-
}
|
|
33
|
-
export declare enum StateLogiceOperations {
|
|
34
|
-
And = 0,
|
|
35
|
-
Or = 1
|
|
36
|
-
}
|
|
37
|
-
export declare const StateCompareOperationsMap: Record<string, StateCompareOperations>;
|
|
38
|
-
export declare const StateLogicOperationsMap: Record<string, StateLogiceOperations>;
|
|
39
|
-
export type StateLogicNode = [
|
|
40
|
-
schemaId: number,
|
|
41
|
-
operation: StateCompareOperations,
|
|
42
|
-
value: number
|
|
43
|
-
];
|
|
44
|
-
export type StateLogicStatement = (StateLogicNode | StateLogiceOperations)[];
|
|
45
|
-
/**
|
|
46
|
-
* Voxel State
|
|
47
|
-
*/
|
|
48
|
-
export type VoxelStateSchemaData = {
|
|
49
|
-
binary: VoxelBinaryStateSchemaNode[];
|
|
50
|
-
relational: VoxelModelRelationsSchemaNodes[];
|
|
51
|
-
};
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (StateCompareOperations) {
|
|
3
|
-
StateCompareOperations[StateCompareOperations["Equals"] = 0] = "Equals";
|
|
4
|
-
StateCompareOperations[StateCompareOperations["NotEquals"] = 1] = "NotEquals";
|
|
5
|
-
StateCompareOperations[StateCompareOperations["GreaterThan"] = 2] = "GreaterThan";
|
|
6
|
-
StateCompareOperations[StateCompareOperations["LessThan"] = 3] = "LessThan";
|
|
7
|
-
})(StateCompareOperations || (StateCompareOperations = {}));
|
|
8
|
-
export var StateLogiceOperations;
|
|
9
|
-
(function (StateLogiceOperations) {
|
|
10
|
-
StateLogiceOperations[StateLogiceOperations["And"] = 0] = "And";
|
|
11
|
-
StateLogiceOperations[StateLogiceOperations["Or"] = 1] = "Or";
|
|
12
|
-
})(StateLogiceOperations || (StateLogiceOperations = {}));
|
|
13
|
-
export const StateCompareOperationsMap = {
|
|
14
|
-
"=": StateCompareOperations.Equals,
|
|
15
|
-
"!=": StateCompareOperations.NotEquals,
|
|
16
|
-
">": StateCompareOperations.GreaterThan,
|
|
17
|
-
"<": StateCompareOperations.LessThan,
|
|
18
|
-
};
|
|
19
|
-
export const StateLogicOperationsMap = {
|
|
20
|
-
"&&": StateLogiceOperations.And,
|
|
21
|
-
"||": StateLogiceOperations.Or,
|
|
22
|
-
};
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReltionalStateBuilder } from "./Reltional/ReltionalStateBuilder";
|
|
2
|
+
import { BinarySchema } from "./Schema/BinarySchema";
|
|
3
|
+
import { VoxelBinaryStateSchemaNode, VoxelModelRelationsSchemaNodes } from "./State.types";
|
|
4
|
+
export type VoxelSchemasExport = {
|
|
5
|
+
state: [key: string, VoxelBinaryStateSchemaNode[]][];
|
|
6
|
+
mod: [key: string, VoxelBinaryStateSchemaNode[]][];
|
|
7
|
+
reltioanlState: [key: string, VoxelBinaryStateSchemaNode[]][];
|
|
8
|
+
reltionalStateBuilder: [key: string, VoxelModelRelationsSchemaNodes[]][];
|
|
9
|
+
reltioanlMod: [key: string, VoxelBinaryStateSchemaNode[]][];
|
|
10
|
+
reltionalModBuilder: [key: string, VoxelModelRelationsSchemaNodes[]][];
|
|
11
|
+
};
|
|
12
|
+
export declare class VoxelSchemas {
|
|
13
|
+
static state: Map<string, BinarySchema>;
|
|
14
|
+
static mod: Map<string, BinarySchema>;
|
|
15
|
+
static reltioanlState: Map<string, BinarySchema>;
|
|
16
|
+
static reltionalStateBuilder: Map<string, ReltionalStateBuilder>;
|
|
17
|
+
static reltioanlMod: Map<string, BinarySchema>;
|
|
18
|
+
static reltionalModBuilder: Map<string, ReltionalStateBuilder>;
|
|
19
|
+
static getStateSchema(voxelId: string): BinarySchema | undefined;
|
|
20
|
+
static export(): VoxelSchemasExport;
|
|
21
|
+
static import(exported: VoxelSchemasExport): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { VoxelLUT } from "../Data/VoxelLUT";
|
|
2
|
+
import { ReltionalStateBuilder } from "./Reltional/ReltionalStateBuilder";
|
|
3
|
+
import { BinarySchema } from "./Schema/BinarySchema";
|
|
4
|
+
export class VoxelSchemas {
|
|
5
|
+
//maps voxel model ids to the their state scehma
|
|
6
|
+
static state = new Map();
|
|
7
|
+
//maps voxel ids to their mod schemao
|
|
8
|
+
static mod = new Map();
|
|
9
|
+
//maps voxel model ids to their reltional state schema
|
|
10
|
+
static reltioanlState = new Map();
|
|
11
|
+
//maps voxel model ids = their reltional state builder
|
|
12
|
+
static reltionalStateBuilder = new Map();
|
|
13
|
+
//maps voxel ids to their reltional mod schema
|
|
14
|
+
static reltioanlMod = new Map();
|
|
15
|
+
//maps voxel ids = their reltional mod builder
|
|
16
|
+
static reltionalModBuilder = new Map();
|
|
17
|
+
static getStateSchema(voxelId) {
|
|
18
|
+
const modelId = VoxelLUT.models.getStringId(VoxelLUT.modelsIndex[VoxelLUT.voxelIds.getNumberId(voxelId)]);
|
|
19
|
+
return this.state.get(modelId);
|
|
20
|
+
}
|
|
21
|
+
static export() {
|
|
22
|
+
return {
|
|
23
|
+
state: [...this.state].map(([key, value]) => [key, value.getSchema()]),
|
|
24
|
+
mod: [...this.mod].map(([key, value]) => [key, value.getSchema()]),
|
|
25
|
+
reltioanlState: [...this.reltioanlState].map(([key, value]) => [
|
|
26
|
+
key,
|
|
27
|
+
value.getSchema(),
|
|
28
|
+
]),
|
|
29
|
+
reltionalStateBuilder: [...this.reltionalStateBuilder].map(([key, value]) => [key, value.getSchema()]),
|
|
30
|
+
reltioanlMod: [...this.reltioanlMod].map(([key, value]) => [
|
|
31
|
+
key,
|
|
32
|
+
value.getSchema(),
|
|
33
|
+
]),
|
|
34
|
+
reltionalModBuilder: [...this.reltionalModBuilder].map(([key, value]) => [
|
|
35
|
+
key,
|
|
36
|
+
value.getSchema(),
|
|
37
|
+
]),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static import(exported) {
|
|
41
|
+
this.state = new Map(exported.state.map(([key, nodes]) => [key, new BinarySchema(nodes)]));
|
|
42
|
+
this.mod = new Map(exported.mod.map(([key, nodes]) => [key, new BinarySchema(nodes)]));
|
|
43
|
+
this.reltioanlState = new Map(exported.reltioanlState.map(([key, nodes]) => [
|
|
44
|
+
key,
|
|
45
|
+
new BinarySchema(nodes),
|
|
46
|
+
]));
|
|
47
|
+
this.reltionalStateBuilder = new Map(exported.reltionalStateBuilder.map(([key, nodes]) => [
|
|
48
|
+
key,
|
|
49
|
+
new ReltionalStateBuilder(this.reltioanlState.get(key), nodes),
|
|
50
|
+
]));
|
|
51
|
+
this.reltioanlMod = new Map(exported.reltioanlMod.map(([key, nodes]) => [
|
|
52
|
+
key,
|
|
53
|
+
new BinarySchema(nodes),
|
|
54
|
+
]));
|
|
55
|
+
this.reltionalModBuilder = new Map(exported.reltionalModBuilder.map(([key, nodes]) => [
|
|
56
|
+
key,
|
|
57
|
+
new ReltionalStateBuilder(this.reltioanlMod.get(key), nodes),
|
|
58
|
+
]));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VoxelLUT } from "../Data/VoxelLUT";
|
|
2
2
|
import { VoxelLevelReader } from "../Cursor/VoxelLevelReader";
|
|
3
|
-
import {
|
|
3
|
+
import { VoxelSchemas } from "../../Voxels/State/VoxelSchemas";
|
|
4
4
|
export class PaintVoxelData {
|
|
5
5
|
id;
|
|
6
6
|
name;
|
|
@@ -21,20 +21,18 @@ export class PaintVoxelData {
|
|
|
21
21
|
}
|
|
22
22
|
/**Transforms numeric voxel data into a PaintVoxelData object */
|
|
23
23
|
static FromRaw(data, paintData = PaintVoxelData.Create()) {
|
|
24
|
-
const [trueVoxelId, state, mod] =
|
|
25
|
-
paintData.id =
|
|
24
|
+
const [trueVoxelId, state, mod] = VoxelLUT.voxels[data[0]];
|
|
25
|
+
paintData.id = VoxelLUT.voxelIds.getStringId(trueVoxelId);
|
|
26
26
|
paintData.state = state;
|
|
27
27
|
paintData.mod = mod;
|
|
28
|
-
paintData.name =
|
|
29
|
-
VoxelPalettesRegister.voxelIdToNameMap.get(paintData.id) || "";
|
|
28
|
+
paintData.name = VoxelLUT.voxelIdToNameMap.get(paintData.id) || "";
|
|
30
29
|
if (data[3] !== 0) {
|
|
31
|
-
const [trueVoxelId, state, mod] =
|
|
32
|
-
paintData.secondaryVoxelId =
|
|
33
|
-
VoxelPalettesRegister.voxelIds.getStringId(trueVoxelId);
|
|
30
|
+
const [trueVoxelId, state, mod] = VoxelLUT.voxels[data[3]];
|
|
31
|
+
paintData.secondaryVoxelId = VoxelLUT.voxelIds.getStringId(trueVoxelId);
|
|
34
32
|
paintData.secondaryState = state;
|
|
35
33
|
paintData.secondaryMod = mod;
|
|
36
34
|
paintData.secondaryName =
|
|
37
|
-
|
|
35
|
+
VoxelLUT.voxelIdToNameMap.get(paintData.secondaryVoxelId) || "";
|
|
38
36
|
}
|
|
39
37
|
paintData.level = VoxelLevelReader.getLevel(data[2]);
|
|
40
38
|
paintData.levelState = VoxelLevelReader.getLevel(data[2]);
|
|
@@ -45,41 +43,47 @@ export class PaintVoxelData {
|
|
|
45
43
|
let stringId = data.id
|
|
46
44
|
? data.id
|
|
47
45
|
: data.name
|
|
48
|
-
?
|
|
46
|
+
? VoxelLUT.voxelNametoIdMap.get(data.name)
|
|
49
47
|
: "dve_air";
|
|
50
48
|
let secondaryStringId = data.secondaryName
|
|
51
49
|
? data.secondaryVoxelId
|
|
52
50
|
: data.secondaryName
|
|
53
|
-
?
|
|
51
|
+
? VoxelLUT.voxelNametoIdMap.get(data.secondaryName)
|
|
54
52
|
: "dve_air";
|
|
55
53
|
let state = data.state || 0;
|
|
56
54
|
let mod = data.mod || 0;
|
|
57
55
|
let secondaryState = data.secondaryState || 0;
|
|
58
56
|
let secondaryMod = data.secondaryMod || 0;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
const trueId = VoxelLUT.voxelIds.getNumberId(stringId);
|
|
58
|
+
const stateSchema = VoxelSchemas.state.get(VoxelLUT.models.getStringId(VoxelLUT.modelsIndex[trueId]));
|
|
59
|
+
if (stateSchema && data.stateString && data.stateString !== "") {
|
|
60
|
+
state = stateSchema.readString(data.stateString);
|
|
61
|
+
}
|
|
62
|
+
const modSchema = VoxelSchemas.mod.get(stringId);
|
|
63
|
+
if (modSchema && data.modString && data.modString !== "") {
|
|
64
|
+
mod = modSchema.readString(data.modString);
|
|
67
65
|
}
|
|
68
|
-
if (secondaryStringId
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
if (secondaryStringId) {
|
|
67
|
+
const trueId = VoxelLUT.voxelIds.getNumberId(secondaryStringId);
|
|
68
|
+
const stateSchema = VoxelSchemas.state.get(VoxelLUT.models.getStringId(VoxelLUT.modelsIndex[trueId]));
|
|
69
|
+
if (stateSchema &&
|
|
70
|
+
data.secondaryStateString &&
|
|
71
|
+
data.secondaryStateString !== "") {
|
|
72
|
+
secondaryState = stateSchema.readString(data.secondaryStateString);
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
const modSchema = VoxelSchemas.mod.get(secondaryStringId);
|
|
75
|
+
if (modSchema &&
|
|
76
|
+
data.secondaryModString &&
|
|
77
|
+
data.secondaryModString !== "") {
|
|
78
|
+
secondaryMod = modSchema.readString(data.secondaryModString);
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
const id = stringId !== "dve_air"
|
|
78
|
-
?
|
|
82
|
+
? VoxelLUT.getVoxelIdFromString(stringId, state || 0, mod || 0)
|
|
79
83
|
: 0;
|
|
80
84
|
const secondaryId = secondaryStringId !== "dve_air"
|
|
81
85
|
? secondaryStringId
|
|
82
|
-
?
|
|
86
|
+
? VoxelLUT.getVoxelIdFromString(secondaryStringId, secondaryState || 0, secondaryMod || 0)
|
|
83
87
|
: 0
|
|
84
88
|
: 0;
|
|
85
89
|
let levleData = 0;
|
|
@@ -145,15 +149,15 @@ export class PaintVoxelData {
|
|
|
145
149
|
let stringId = data.id
|
|
146
150
|
? data.id
|
|
147
151
|
: data.name
|
|
148
|
-
?
|
|
152
|
+
? VoxelLUT.voxelNametoIdMap.get(data.name)
|
|
149
153
|
: "dve_air";
|
|
150
154
|
let secondaryStringId = data.secondaryName
|
|
151
155
|
? data.secondaryVoxelId
|
|
152
156
|
: data.secondaryName
|
|
153
|
-
?
|
|
157
|
+
? VoxelLUT.voxelNametoIdMap.get(data.secondaryName)
|
|
154
158
|
: "dve_air";
|
|
155
159
|
if (data.name && !data.id) {
|
|
156
|
-
data.id =
|
|
160
|
+
data.id = VoxelLUT.voxelNametoIdMap.get(data.name);
|
|
157
161
|
}
|
|
158
162
|
if (!data.name && !data.id) {
|
|
159
163
|
data.id = "dve_air";
|
|
@@ -161,14 +165,14 @@ export class PaintVoxelData {
|
|
|
161
165
|
delete data.name;
|
|
162
166
|
let state = data.state || 0;
|
|
163
167
|
let mod = data.mod || 0;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
const trueId = VoxelLUT.voxelIds.getNumberId(stringId);
|
|
169
|
+
const stateSchema = VoxelSchemas.state.get(VoxelLUT.models.getStringId(VoxelLUT.modelsIndex[trueId]));
|
|
170
|
+
if (stateSchema && data.stateString && data.stateString !== "") {
|
|
171
|
+
state = stateSchema.readString(data.stateString);
|
|
172
|
+
}
|
|
173
|
+
const modSchema = VoxelSchemas.mod.get(stringId);
|
|
174
|
+
if (modSchema && data.modString && data.modString !== "") {
|
|
175
|
+
mod = modSchema.readString(data.modString);
|
|
172
176
|
}
|
|
173
177
|
data.state = state;
|
|
174
178
|
data.mod = mod;
|
|
@@ -176,13 +180,19 @@ export class PaintVoxelData {
|
|
|
176
180
|
delete data.modString;
|
|
177
181
|
let secondaryState = data.secondaryState || 0;
|
|
178
182
|
let secondaryMod = data.secondaryMod || 0;
|
|
179
|
-
if (secondaryStringId
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
if (secondaryStringId) {
|
|
184
|
+
const trueId = VoxelLUT.voxelIds.getNumberId(secondaryStringId);
|
|
185
|
+
const stateSchema = VoxelSchemas.state.get(VoxelLUT.models.getStringId(VoxelLUT.modelsIndex[trueId]));
|
|
186
|
+
if (stateSchema &&
|
|
187
|
+
data.secondaryStateString &&
|
|
188
|
+
data.secondaryStateString !== "") {
|
|
189
|
+
secondaryState = stateSchema.readString(data.secondaryStateString);
|
|
183
190
|
}
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
const modSchema = VoxelSchemas.mod.get(secondaryStringId);
|
|
192
|
+
if (modSchema &&
|
|
193
|
+
data.secondaryModString &&
|
|
194
|
+
data.secondaryModString !== "") {
|
|
195
|
+
secondaryMod = modSchema.readString(data.secondaryModString);
|
|
186
196
|
}
|
|
187
197
|
}
|
|
188
198
|
data.secondaryState = secondaryState;
|
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
import { VoxelSubstanceTags, VoxelTags } from "../Data/VoxelTag.types";
|
|
2
2
|
import { VoxelLogicData } from "../Logic/VoxelLogic.types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
logic: Record<string, VoxelLogicData[]>;
|
|
8
|
-
tags: VoxelTags[];
|
|
9
|
-
idPalette: string[];
|
|
10
|
-
palette: typeof VoxelPalettesRegister.voxels;
|
|
11
|
-
record: typeof VoxelPalettesRegister.voxelRecord;
|
|
12
|
-
nameToIdMap: [string, string][];
|
|
13
|
-
idToNameMap: [string, string][];
|
|
14
|
-
};
|
|
15
|
-
substances: {
|
|
16
|
-
tags: VoxelSubstanceTags[];
|
|
17
|
-
palette: string[];
|
|
18
|
-
};
|
|
19
|
-
materials: {
|
|
20
|
-
palette: string[];
|
|
21
|
-
};
|
|
3
|
+
export type CompiledvVxelTags = {
|
|
4
|
+
logic: Record<string, VoxelLogicData[]>;
|
|
5
|
+
tags: VoxelTags[];
|
|
6
|
+
substanceTags: VoxelSubstanceTags[];
|
|
22
7
|
};
|
|
23
|
-
export type CompiledVoxelData = {
|
|
24
|
-
models: FinalCompiledVoxelModelData;
|
|
25
|
-
} & CompiledVoxelTagAndPaletteData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NumberPalette } from "../../../Util/NumberPalette";
|
|
2
2
|
import { BinaryBuffer, BinaryBufferFormat, } from "../../../Util/BinaryBuffer/index";
|
|
3
|
-
import {
|
|
3
|
+
import { VoxelLUT } from "../../../Voxels/Data/VoxelLUT";
|
|
4
4
|
import { lightSegments, lightSemgnetSet, } from "../Functions/Shared/LightSegments";
|
|
5
5
|
import { VoxelTagsRegister } from "../../../Voxels/Data/VoxelTagsRegister";
|
|
6
6
|
import { WorldSpaces } from "../../WorldSpaces";
|
|
@@ -110,12 +110,12 @@ export class ImportedSection {
|
|
|
110
110
|
getId(index) {
|
|
111
111
|
const value = this.buffers.ids.getValue(index);
|
|
112
112
|
if (this.buffers.ids.isValue) {
|
|
113
|
-
return
|
|
113
|
+
return VoxelLUT.getVoxelIdFromString(...this.sector.voxels.getVoxelData(value));
|
|
114
114
|
}
|
|
115
115
|
if (this.palettes.voxels) {
|
|
116
|
-
return
|
|
116
|
+
return VoxelLUT.getVoxelIdFromString(...this.sector.voxels.getVoxelData(this.palettes.voxels.getValue(value)));
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return VoxelLUT.getVoxelIdFromString(...this.sector.voxels.getVoxelData(value));
|
|
119
119
|
}
|
|
120
120
|
getLight(index) {
|
|
121
121
|
let finalLight = 0;
|
|
@@ -153,16 +153,16 @@ export class ImportedSection {
|
|
|
153
153
|
return value;
|
|
154
154
|
}
|
|
155
155
|
getSecondary(index) {
|
|
156
|
-
const trueVoxelId =
|
|
156
|
+
const trueVoxelId = VoxelLUT.voxels[this.getId(index)][0];
|
|
157
157
|
const value = this.buffers.secondary.getValue(index);
|
|
158
158
|
if (VoxelTagsRegister.VoxelTags[trueVoxelId]["dve_can_have_secondary"]) {
|
|
159
159
|
if (this.buffers.ids.isValue) {
|
|
160
|
-
return
|
|
160
|
+
return VoxelLUT.getVoxelIdFromString(...this.sector.voxels.getVoxelData(value));
|
|
161
161
|
}
|
|
162
162
|
if (this.palettes.secondaryVoxels) {
|
|
163
|
-
return
|
|
163
|
+
return VoxelLUT.getVoxelIdFromString(...this.sector.voxels.getVoxelData(this.palettes.secondaryVoxels.getValue(value)));
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return VoxelLUT.getVoxelIdFromString(...this.sector.voxels.getVoxelData(value));
|
|
166
166
|
}
|
|
167
167
|
return value;
|
|
168
168
|
}
|