@divinevoxel/vlox 0.0.72 → 0.0.74
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/Contexts/Base/Remote/InitDataSync.js +4 -0
- package/Contexts/Base/Remote/InitWorldDataSync.js +1 -1
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +2 -1
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +2 -1
- package/Init/StartConstructor.js +8 -4
- package/Init/StartWorld.d.ts +1 -1
- package/Math/index.d.ts +5 -1
- package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
- package/Mesher/Functions/CompactVoxelMesh.js +1 -1
- package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
- package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
- package/Mesher/Functions/MeshSection.d.ts +1 -1
- package/Mesher/Functions/MeshSection.js +27 -22
- package/Mesher/Functions/MeshTexture.d.ts +1 -1
- package/Mesher/Functions/MeshTexture.js +3 -4
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
- package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +12 -10
- package/Mesher/Geomtry/Primitives/QuadVertexData.js +49 -56
- package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +120 -199
- package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
- package/Mesher/Geomtry/VoxelMesh.js +4 -4
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +16 -0
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +51 -0
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
- package/Mesher/Geomtry/{Buffers.js → VoxelMeshBuffers.js} +2 -2
- package/Mesher/Geomtry/index.d.ts +0 -1
- package/Mesher/Geomtry/index.js +0 -1
- package/Mesher/InitMesher.js +1 -1
- package/Mesher/InitTask.js +9 -23
- package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
- package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
- package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
- package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -2
- package/Mesher/Models/Common/Calc/FaceDataCalc.js +37 -30
- package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +2 -2
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +18 -24
- package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -2
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +1 -0
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +40 -31
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
- package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.d.ts +1 -1
- package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.js +1 -1
- package/Mesher/Models/RenderedMaterials.d.ts +6 -0
- package/Mesher/{RenderedMaterials.js → Models/RenderedMaterials.js} +2 -2
- package/Mesher/Models/VoxelConstructor.d.ts +6 -6
- package/Mesher/Models/VoxelConstructor.js +8 -8
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +3 -5
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -32
- package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +4 -5
- package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +5 -8
- package/Mesher/Types/Mesher.types.d.ts +1 -0
- package/Models/Defaults/CubeVoxelGeometry.js +4 -0
- package/Models/Defaults/CubeVoxelModels.js +360 -383
- package/Models/Defaults/LiquidVoxelModel.js +5 -5
- package/Models/Defaults/PanelVoxelModels.js +442 -468
- package/Models/Defaults/StairVoxelModel.js +582 -597
- package/Models/Examples.js +490 -498
- package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
- package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
- package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
- package/Models/Rules/Functions/BuildFinalInputs.js +21 -19
- package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
- package/Models/Rules/Functions/BuildRules.js +2 -2
- package/Models/Rules/{VoxelModelManager.d.ts → VoxelModelRuleBuilderRegister.d.ts} +1 -1
- package/Models/Rules/VoxelModelRuleBuilderRegister.js +178 -0
- package/Models/VoxelModel.types.d.ts +17 -8
- package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
- package/Renderer/Classes/SectorMesh.d.ts +3 -4
- package/Renderer/Classes/SectorMesh.js +6 -11
- package/Renderer/InitTasks.js +1 -10
- package/Renderer/MeshManager.d.ts +1 -1
- package/Renderer/MeshManager.js +26 -25
- package/Renderer/MeshRegister.d.ts +5 -5
- package/Renderer/MeshRegister.js +4 -3
- package/Settings/EngineSettings.d.ts +2 -1
- package/Settings/EngineSettings.js +6 -5
- package/Settings/EngineSettings.types.d.ts +24 -39
- package/Settings/EngineSettings.types.js +22 -29
- package/Tasks/Logic/InitTasks.d.ts +1 -0
- package/Tasks/Logic/InitTasks.js +10 -0
- package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
- package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
- package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
- package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
- package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
- package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
- package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
- package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
- package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
- package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
- package/Tasks/Propagation/InitTasks.js +4 -4
- package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
- package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
- package/Tasks/Tasks.types.d.ts +2 -2
- package/Tasks/TasksIds.d.ts +2 -1
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/Update/Common.d.ts +3 -0
- package/Tasks/Update/Common.js +41 -0
- package/Tasks/Update/EreaseUpdate.d.ts +3 -0
- package/Tasks/Update/EreaseUpdate.js +66 -0
- package/Tasks/Update/InitTasks.d.ts +2 -2
- package/Tasks/Update/InitTasks.js +3 -1
- package/Tasks/Update/PaintUpdate.d.ts +3 -0
- package/Tasks/Update/PaintUpdate.js +89 -0
- package/Tasks/Update/VoxelUpdate.d.ts +2 -5
- package/Tasks/Update/VoxelUpdate.js +7 -143
- package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +16 -6
- package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +44 -5
- package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
- package/Tasks/WorldGeneration/WorldGenBrush.js +3 -3
- package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
- package/Templates/Cursor/TemplateCursor.d.ts +2 -2
- package/Templates/Cursor/TemplateCursor.js +1 -2
- package/Templates/Functions/CreateTemplate.d.ts +1 -1
- package/Templates/VoxelTemplates.types.d.ts +1 -1
- package/Textures/Classes/CompiledTexture.d.ts +18 -0
- package/Textures/Classes/CompiledTexture.js +50 -0
- package/Textures/Classes/CompiledTextureAnimation.d.ts +12 -0
- package/Textures/Classes/CompiledTextureAnimation.js +27 -0
- package/Textures/Classes/TextureAnimationTexture.d.ts +10 -0
- package/Textures/Classes/TextureAnimationTexture.js +32 -0
- package/Textures/Functions/BuildTextureData.d.ts +10 -0
- package/Textures/Functions/BuildTextureData.js +205 -0
- package/Textures/Texture.types.d.ts +50 -64
- package/Textures/TextureManager.d.ts +8 -19
- package/Textures/TextureManager.js +28 -166
- package/Tools/Brush/AdvancedBrushTool.js +1 -1
- package/Tools/Brush/Brush.d.ts +3 -3
- package/Tools/Brush/Brush.js +40 -8
- package/Tools/Tasks/TasksTool.d.ts +1 -0
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Util/Binary/BinaryArrays.d.ts +6 -0
- package/Util/Binary/BinaryArrays.js +25 -0
- package/Util/Binary/BinaryBuffer.d.ts +35 -0
- package/Util/Binary/BinaryBuffer.js +136 -0
- package/Util/Binary/{BitArray.d.ts → BinaryFunctions.d.ts} +1 -2
- package/Util/Binary/BinaryFunctions.js +11 -0
- package/{Mesher/Tools/VoxelMeshBVHBuilder.d.ts → Util/Binary/BinaryTree.d.ts} +1 -33
- package/Util/Binary/BinaryTree.js +104 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +8 -3
- package/Voxels/Cursor/VoxelCursor.interface.js +54 -13
- package/Voxels/Cursor/VoxelLightData.js +1 -1
- package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -5
- package/Voxels/Data/VoxelPalettesRegister.js +0 -9
- package/Voxels/Data/VoxelTag.types.d.ts +17 -2
- package/Voxels/Data/VoxelTag.types.js +6 -1
- package/Voxels/Data/VoxelTagsRegister.js +12 -7
- package/Voxels/Functions/BuildStateData.d.ts +6 -6
- package/Voxels/Functions/BuildStateData.js +37 -37
- package/Voxels/Functions/BuildTagAndPaletteData.js +6 -3
- package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
- package/Voxels/Indexes/VoxelIndex.js +16 -18
- package/Voxels/InitVoxelData.js +24 -21
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
- package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
- package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
- package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
- package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
- package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
- package/Voxels/Logic/VoxelLogic.types.js +1 -0
- package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
- package/Voxels/Logic/VoxelLogicRegister.js +15 -0
- package/Voxels/State/Schema/StateSchema.d.ts +1 -1
- package/Voxels/State/SchemaRegister.js +10 -5
- package/Voxels/State/State.types.d.ts +1 -1
- package/Voxels/State/StateTreeReader.d.ts +1 -1
- package/Voxels/State/StateTreeReader.js +2 -3
- package/Voxels/Types/Voxel.types.d.ts +21 -0
- package/Voxels/Types/Voxel.types.js +6 -2
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
- package/World/Archive/Archive.types.d.ts +65 -42
- package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
- package/World/Archive/Classes/ArchiveClasses.js +78 -0
- package/World/Archive/Classes/ImportedSection.d.ts +40 -0
- package/World/Archive/Classes/ImportedSection.js +307 -0
- package/World/Archive/Classes/ImportedSector.d.ts +23 -0
- package/World/Archive/Classes/ImportedSector.js +97 -0
- package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
- package/World/Archive/Functions/ArchiveArea.js +49 -54
- package/World/Archive/Functions/ArchiveSector.js +373 -282
- package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
- package/World/Archive/Functions/CreateArchivedSection.js +207 -0
- package/World/Archive/Functions/ImportSector.d.ts +2 -4
- package/World/Archive/Functions/ImportSector.js +50 -220
- package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
- package/World/Archive/Functions/RemoveDuplicates.js +92 -0
- package/World/Archive/Functions/Shared.d.ts +6 -0
- package/World/Archive/Functions/Shared.js +50 -0
- package/World/Archive/InitTasks.js +37 -23
- package/World/Cursor/SectionCursor.d.ts +3 -3
- package/World/Cursor/SectionCursor.js +2 -3
- package/World/Cursor/SectorCursor.d.ts +3 -3
- package/World/Cursor/SectorCursor.js +1 -2
- package/World/Cursor/WorldCursor.d.ts +6 -5
- package/World/Cursor/WorldCursor.js +17 -15
- package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
- package/World/Cursor/WorldVoxelCursor.js +24 -14
- package/World/Dimension/Dimension.d.ts +4 -1
- package/World/Dimension/Dimension.js +8 -1
- package/World/InitTasks.d.ts +1 -1
- package/World/Lock/WorldLock.d.ts +1 -1
- package/World/Section/Section.d.ts +27 -18
- package/World/Section/Section.js +125 -21
- package/World/Section/SectionState.d.ts +12 -0
- package/World/Section/SectionState.js +13 -0
- package/World/Sector/Sector.d.ts +20 -6
- package/World/Sector/Sector.js +100 -17
- package/World/Sector/SectorHeightMap.js +2 -2
- package/World/Sector/SectorState.d.ts +16 -7
- package/World/Sector/SectorState.js +29 -15
- package/World/Types/WorldData.types.d.ts +2 -7
- package/World/Types/WorldStorage.interface.js +1 -0
- package/World/WorldRegister.d.ts +13 -9
- package/World/WorldRegister.js +24 -9
- package/World/WorldSpaces.d.ts +4 -0
- package/World/WorldSpaces.js +25 -12
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +10 -3
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +19 -3
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
- package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
- package/WorldSimulation/Internal/Classes/TickQueue.js +58 -0
- package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
- package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +8 -8
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
- package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
- package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +38 -9
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
- package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
- package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
- package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
- package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
- package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -24
- package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
- package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
- package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
- package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +7 -5
- package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +6 -5
- package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +29 -23
- package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
- package/package.json +1 -1
- package/Mesher/Functions/CompactMesh.d.ts +0 -2
- package/Mesher/Functions/CompactMesh.js +0 -42
- package/Mesher/Geomtry/GeometryNormals.d.ts +0 -10
- package/Mesher/Geomtry/GeometryNormals.js +0 -52
- package/Mesher/Geomtry/MeshData.types.d.ts +0 -13
- package/Mesher/Geomtry/MeshData.types.js +0 -6
- package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +0 -7
- package/Mesher/Geomtry/Tools/MesherDataTools.js +0 -12
- package/Mesher/Geomtry/Tools/index.d.ts +0 -1
- package/Mesher/Geomtry/Tools/index.js +0 -1
- package/Mesher/RenderedMaterials.d.ts +0 -6
- package/Mesher/Tools/VoxelMeshBVHBuilder.js +0 -216
- package/Models/Rules/VoxelModelManager.js +0 -82
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
- package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
- package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -34
- package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
- package/Textures/TextureAnimations.d.ts +0 -4
- package/Textures/TextureAnimations.js +0 -35
- package/Textures/TextureArray.d.ts +0 -47
- package/Textures/TextureArray.js +0 -202
- package/Textures/TextureBuilder.d.ts +0 -13
- package/Textures/TextureBuilder.js +0 -120
- package/Textures/TextureRegister.d.ts +0 -9
- package/Textures/TextureRegister.js +0 -28
- package/Tools/DataCursor.interface.d.ts +0 -5
- package/Tools/DataCursor.interface.js +0 -2
- package/Util/Binary/BitArray.js +0 -16
- package/World/Structs/WorldDataStructProperties.d.ts +0 -8
- package/World/Structs/WorldDataStructProperties.js +0 -9
- /package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +0 -0
- /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
- /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
- /package/{World/Storage/WorldStorage.interface.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
- /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
|
@@ -8,8 +8,8 @@ export class VoxelNamedState {
|
|
|
8
8
|
compiled = {
|
|
9
9
|
mod: 0,
|
|
10
10
|
modAny: false,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
state: 0,
|
|
12
|
+
stateAny: false,
|
|
13
13
|
};
|
|
14
14
|
constructor(voxelId, data) {
|
|
15
15
|
this.voxelId = voxelId;
|
|
@@ -20,10 +20,10 @@ export class VoxelNamedState {
|
|
|
20
20
|
if (SchemaRegister.voxelModSchemaData.has(this.voxelId)) {
|
|
21
21
|
const schema = SchemaRegister.getVoxelSchemas(this.voxelId);
|
|
22
22
|
if (this.data.state == "*") {
|
|
23
|
-
this.compiled.
|
|
23
|
+
this.compiled.stateAny = true;
|
|
24
24
|
}
|
|
25
25
|
else if (this.data.state) {
|
|
26
|
-
this.compiled.
|
|
26
|
+
this.compiled.state = schema.state.readString(this.data.state);
|
|
27
27
|
}
|
|
28
28
|
if (this.data.mod == "*") {
|
|
29
29
|
this.compiled.modAny = true;
|
|
@@ -34,7 +34,7 @@ export class VoxelNamedState {
|
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
this.compiled.modAny = true;
|
|
37
|
-
this.compiled.
|
|
37
|
+
this.compiled.stateAny = true;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
getPaintData() {
|
|
@@ -43,7 +43,7 @@ export class VoxelNamedState {
|
|
|
43
43
|
id: this.voxelId,
|
|
44
44
|
level: 0,
|
|
45
45
|
levelState: 0,
|
|
46
|
-
state: this.compiled.
|
|
46
|
+
state: this.compiled.state,
|
|
47
47
|
mod: this.compiled.mod,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -108,25 +108,23 @@ export class VoxelIndex {
|
|
|
108
108
|
const conatiner = this.states.get(data.id);
|
|
109
109
|
if (!conatiner)
|
|
110
110
|
return false;
|
|
111
|
-
const { mod, state
|
|
112
|
-
for (const
|
|
113
|
-
if ((mod ==
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
-
return state;
|
|
111
|
+
const { mod, state } = data;
|
|
112
|
+
for (const modelState of conatiner?.stateArray) {
|
|
113
|
+
if ((mod == modelState.compiled.mod || modelState.compiled.modAny) &&
|
|
114
|
+
(state == modelState.compiled.state || modelState.compiled.stateAny))
|
|
115
|
+
return modelState;
|
|
117
116
|
}
|
|
118
117
|
return false;
|
|
119
118
|
}
|
|
120
119
|
getStateFromRawData(data) {
|
|
121
|
-
const [id, light,
|
|
120
|
+
const [id, light, state, secondary, mod] = data;
|
|
122
121
|
const conatiner = this.states.get(VoxelPalettesRegister.voxels.getStringId(id));
|
|
123
122
|
if (!conatiner)
|
|
124
123
|
return false;
|
|
125
|
-
for (const
|
|
126
|
-
if ((mod ==
|
|
127
|
-
(
|
|
128
|
-
|
|
129
|
-
return state;
|
|
124
|
+
for (const modelState of conatiner?.stateArray) {
|
|
125
|
+
if ((mod == modelState.compiled.mod || modelState.compiled.modAny) &&
|
|
126
|
+
(state == modelState.compiled.state || modelState.compiled.stateAny))
|
|
127
|
+
return modelState;
|
|
130
128
|
}
|
|
131
129
|
return false;
|
|
132
130
|
}
|
package/Voxels/InitVoxelData.js
CHANGED
|
@@ -4,7 +4,7 @@ import { orientedCube, pillarCube, simpleCube, simpleHalfCube, } from "../Models
|
|
|
4
4
|
import { diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, thinPanelDown, thinPanelSouth, thinPanelWest, } from "../Models/Defaults/PanelVoxelGeometry";
|
|
5
5
|
import { stair } from "../Models/Defaults/StairVoxelModel";
|
|
6
6
|
import { liquidGeometry, liquidModel, } from "../Models/Defaults/LiquidVoxelModel";
|
|
7
|
-
import {
|
|
7
|
+
import { VoxelModelRuleBuilderRegister } from "../Models/Rules/VoxelModelRuleBuilderRegister";
|
|
8
8
|
import { BuildRules } from "../Models/Rules/Functions/BuildRules";
|
|
9
9
|
import { BuildStateData } from "./Functions/BuildStateData";
|
|
10
10
|
import { BuildFinalInputs } from "../Models/Rules/Functions/BuildFinalInputs";
|
|
@@ -16,6 +16,7 @@ import { CacheManager } from "../Cache/CacheManager";
|
|
|
16
16
|
import { VoxelLightData } from "./Cursor/VoxelLightData";
|
|
17
17
|
import { VoxelTagIds } from "./Data/VoxelTag.types";
|
|
18
18
|
import { BuildTagAndPaletteData } from "./Functions/BuildTagAndPaletteData";
|
|
19
|
+
import { VoxelLogicRegister } from "./Logic/VoxelLogicRegister";
|
|
19
20
|
function GetModelData(data) {
|
|
20
21
|
if (CacheManager.cacheLoadEnabled && CacheManager.cachedData) {
|
|
21
22
|
const syncData = CacheManager.cachedData.models;
|
|
@@ -30,10 +31,10 @@ function GetModelData(data) {
|
|
|
30
31
|
VoxelTagStates.load(syncData.tagState);
|
|
31
32
|
return syncData;
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
VoxelModelRuleBuilderRegister.registerGeometry(cube, halfDownCube, halfSouthCube, halfWestCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, eighthCube, thinPanelDown, thinPanelSouth, thinPanelWest, diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, fencePost, fenceEastWest, fenceNorthsouth, chainGeometry, carpetGeometry, candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, liquidGeometry, ...leverGeometry, ...(data.geometry || []));
|
|
35
|
+
VoxelModelRuleBuilderRegister.registerModels(simpleCube, orientedCube, simpleHalfCube, pillarCube, simpleThinPannel, stair, simpleCrossedPannel, chainModel, carpetModel, candlesModel, leverModel, fence, liquidModel, ...(data.models || []));
|
|
35
36
|
const syncData = {
|
|
36
|
-
geometryPalette:
|
|
37
|
+
geometryPalette: VoxelModelRuleBuilderRegister.geometryPalette._palette,
|
|
37
38
|
geometry: [],
|
|
38
39
|
models: [],
|
|
39
40
|
voxels: [],
|
|
@@ -43,13 +44,13 @@ function GetModelData(data) {
|
|
|
43
44
|
const voxelData = voxel.properties["dve_model_data"];
|
|
44
45
|
if (!voxelData)
|
|
45
46
|
continue;
|
|
46
|
-
|
|
47
|
-
const model =
|
|
47
|
+
VoxelModelRuleBuilderRegister.registerVoxel(voxel.id, voxelData);
|
|
48
|
+
const model = VoxelModelRuleBuilderRegister.models.get(voxelData.id);
|
|
48
49
|
if (!model)
|
|
49
50
|
throw new Error(`Voxel model with id ${voxelData.id} does not exist.`);
|
|
50
51
|
model.voxels.set(voxel.id, voxelData);
|
|
51
52
|
}
|
|
52
|
-
for (const [mainKey, mainGeo] of
|
|
53
|
+
for (const [mainKey, mainGeo] of VoxelModelRuleBuilderRegister.geometry) {
|
|
53
54
|
if (mainGeo.data.ogData.doNotBuildRules) {
|
|
54
55
|
syncData.geometry.push({
|
|
55
56
|
id: mainKey,
|
|
@@ -58,15 +59,15 @@ function GetModelData(data) {
|
|
|
58
59
|
});
|
|
59
60
|
continue;
|
|
60
61
|
}
|
|
61
|
-
const output = BuildRules(mainGeo,
|
|
62
|
+
const output = BuildRules(mainGeo, VoxelModelRuleBuilderRegister.geometryPalette);
|
|
62
63
|
syncData.geometry.push({
|
|
63
64
|
id: mainKey,
|
|
64
65
|
nodes: mainGeo.data.nodes,
|
|
65
66
|
...output,
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
for (const [mainKey, model] of
|
|
69
|
-
const stateData = BuildStateData(model,
|
|
69
|
+
for (const [mainKey, model] of VoxelModelRuleBuilderRegister.models) {
|
|
70
|
+
const stateData = BuildStateData(model, VoxelModelRuleBuilderRegister.geometryPalette);
|
|
70
71
|
model.stateData = stateData;
|
|
71
72
|
SchemaRegister.registerModel(mainKey, stateData.schema);
|
|
72
73
|
syncData.models.push({
|
|
@@ -74,15 +75,15 @@ function GetModelData(data) {
|
|
|
74
75
|
effects: stateData.effects,
|
|
75
76
|
schema: stateData.schema,
|
|
76
77
|
geoLinkMap: stateData.geometryLinkStateMap,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
stateMap: stateData.statePalette,
|
|
79
|
+
stateGeometryMap: stateData.stateGeometryPalette,
|
|
80
|
+
stateTree: stateData.stateTree,
|
|
80
81
|
condiotnalStateTree: stateData.condiotnalNodeStateTree,
|
|
81
82
|
condiotnalStatements: stateData.condiotnalStatements,
|
|
82
|
-
condiotnalStateMap: stateData.
|
|
83
|
+
condiotnalStateMap: stateData.condiotnalStatePalette,
|
|
83
84
|
condiotnalShapeStateMap: stateData.condiotanlStatePalette,
|
|
84
85
|
condiotnalShapeStateGeometryMap: stateData.condiotanlGeometryStatePalette,
|
|
85
|
-
|
|
86
|
+
stateRelativeGeometryMap: stateData.stateRelativeGeometryMap,
|
|
86
87
|
relativeGeometryByteIndexMap: stateData.relativeGeometryByteIndexMap,
|
|
87
88
|
condiotnalShapeStateRelativeGeometryMap: stateData.condiotnalShapeStateRelativeGeometryMap,
|
|
88
89
|
});
|
|
@@ -90,9 +91,9 @@ function GetModelData(data) {
|
|
|
90
91
|
/* for (const [mainKey, geometry] of VoxelModelManager.geometry) {
|
|
91
92
|
BuildGeomtryInputs(geometry);
|
|
92
93
|
} */
|
|
93
|
-
for (const [mainKey, model] of
|
|
94
|
-
const {
|
|
95
|
-
for (const v in
|
|
94
|
+
for (const [mainKey, model] of VoxelModelRuleBuilderRegister.models) {
|
|
95
|
+
const { stateVoxelInputs, conditionalShapeStateVoxelInputs, transparentVoxelFaceIndexes, } = BuildFinalInputs(model);
|
|
96
|
+
for (const v in stateVoxelInputs) {
|
|
96
97
|
const stateData = model.voxelModData.get(v);
|
|
97
98
|
SchemaRegister.registerVoxel(v, mainKey, stateData.modSchema);
|
|
98
99
|
syncData.voxels.push({
|
|
@@ -102,7 +103,7 @@ function GetModelData(data) {
|
|
|
102
103
|
transparentFaceIndex: transparentVoxelFaceIndexes[v].data,
|
|
103
104
|
modSchema: stateData.modSchema,
|
|
104
105
|
modStateTree: stateData.modStateTree,
|
|
105
|
-
baseGeometryInputMap:
|
|
106
|
+
baseGeometryInputMap: stateVoxelInputs[v],
|
|
106
107
|
condiotnalGeometryInputMap: conditionalShapeStateVoxelInputs[v],
|
|
107
108
|
});
|
|
108
109
|
}
|
|
@@ -115,8 +116,7 @@ function GetModelData(data) {
|
|
|
115
116
|
}
|
|
116
117
|
export function InitVoxelData(data) {
|
|
117
118
|
const lightData = new VoxelLightData();
|
|
118
|
-
|
|
119
|
-
console.warn(voxelIndex, voxelIndex.dataMap);
|
|
119
|
+
new VoxelIndex(data.voxels);
|
|
120
120
|
const materials = [
|
|
121
121
|
{ id: "dve_solid", properties: {} },
|
|
122
122
|
{ id: "dve_flora", properties: {} },
|
|
@@ -244,6 +244,9 @@ export function InitVoxelData(data) {
|
|
|
244
244
|
materials,
|
|
245
245
|
});
|
|
246
246
|
let models = GetModelData(data);
|
|
247
|
+
for (const id in voxelData.data.logic) {
|
|
248
|
+
VoxelLogicRegister.register(id, voxelData.data.logic[id]);
|
|
249
|
+
}
|
|
247
250
|
return {
|
|
248
251
|
models,
|
|
249
252
|
...voxelData,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VoxelCursorInterface } from "../../Cursor/VoxelCursor.interface";
|
|
2
|
+
import { VoxelLogicData } from "../VoxelLogic.types";
|
|
3
|
+
import { VoxelLogicType } from "./VoxelLogicType";
|
|
4
|
+
export declare class VoxelLogic {
|
|
5
|
+
types: VoxelLogicType[];
|
|
6
|
+
effectedTags: Map<string, VoxelLogicType[]>;
|
|
7
|
+
constructor(data: VoxelLogicData[]);
|
|
8
|
+
getTagValue(tagId: string, cursor: VoxelCursorInterface): any;
|
|
9
|
+
registerEffectOnTag(tagId: string, effect: VoxelLogicType): void;
|
|
10
|
+
hasTag(tag: string): boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { VoxelLogicRegister } from "../VoxelLogicRegister";
|
|
2
|
+
export class VoxelLogic {
|
|
3
|
+
types = [];
|
|
4
|
+
effectedTags = new Map();
|
|
5
|
+
constructor(data) {
|
|
6
|
+
for (const type of data) {
|
|
7
|
+
const logicType = VoxelLogicRegister.types.get(type.type);
|
|
8
|
+
this.types.push(logicType);
|
|
9
|
+
if (type.type == "powered") {
|
|
10
|
+
for (const effect of type.on)
|
|
11
|
+
if (effect.type == "tag")
|
|
12
|
+
this.registerEffectOnTag(effect.tagId, logicType);
|
|
13
|
+
for (const effect of type.off)
|
|
14
|
+
if (effect.type == "tag")
|
|
15
|
+
this.registerEffectOnTag(effect.tagId, logicType);
|
|
16
|
+
}
|
|
17
|
+
if (type.type == "state") {
|
|
18
|
+
for (const effect of type.true)
|
|
19
|
+
if (effect.type == "tag")
|
|
20
|
+
this.registerEffectOnTag(effect.tagId, logicType);
|
|
21
|
+
for (const effect of type.false)
|
|
22
|
+
if (effect.type == "tag")
|
|
23
|
+
this.registerEffectOnTag(effect.tagId, logicType);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
getTagValue(tagId, cursor) {
|
|
28
|
+
let effects = this.effectedTags.get(tagId);
|
|
29
|
+
if (!effects)
|
|
30
|
+
return null;
|
|
31
|
+
let finalValue = null;
|
|
32
|
+
for (let i = 0; i < effects.length; i++) {
|
|
33
|
+
const effect = effects[i];
|
|
34
|
+
finalValue = effect.run(cursor);
|
|
35
|
+
}
|
|
36
|
+
return finalValue;
|
|
37
|
+
}
|
|
38
|
+
registerEffectOnTag(tagId, effect) {
|
|
39
|
+
let effects = this.effectedTags.get(tagId);
|
|
40
|
+
if (!effects) {
|
|
41
|
+
effects = [];
|
|
42
|
+
this.effectedTags.set(tagId, effects);
|
|
43
|
+
}
|
|
44
|
+
effects.push(effect);
|
|
45
|
+
}
|
|
46
|
+
hasTag(tag) {
|
|
47
|
+
return this.effectedTags.has(tag);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type VoxelLogicEffects = {
|
|
2
|
+
type: "tag";
|
|
3
|
+
tagId: string;
|
|
4
|
+
value: any;
|
|
5
|
+
} | {
|
|
6
|
+
type: "state";
|
|
7
|
+
key: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
} | {
|
|
10
|
+
type: "mod";
|
|
11
|
+
key: string;
|
|
12
|
+
value: string | number;
|
|
13
|
+
};
|
|
14
|
+
export type VoxelLogicData = {
|
|
15
|
+
type: "powered";
|
|
16
|
+
on: VoxelLogicEffects[];
|
|
17
|
+
off: VoxelLogicEffects[];
|
|
18
|
+
} | {
|
|
19
|
+
type: "state";
|
|
20
|
+
value: string;
|
|
21
|
+
true: VoxelLogicEffects[];
|
|
22
|
+
false: VoxelLogicEffects[];
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VoxelLogic } from "./Classes/VoxelLogic";
|
|
2
|
+
import { VoxelLogicData } from "./VoxelLogic.types";
|
|
3
|
+
import { VoxelLogicType } from "./Classes/VoxelLogicType";
|
|
4
|
+
export declare class VoxelLogicRegister {
|
|
5
|
+
static voxels: VoxelLogic[];
|
|
6
|
+
static types: Map<string, VoxelLogicType>;
|
|
7
|
+
static register(id: string, logicData: VoxelLogicData[]): void;
|
|
8
|
+
static registerType(id: string, logic: VoxelLogicType): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VoxelPalettesRegister } from "../../Voxels/Data/VoxelPalettesRegister";
|
|
2
|
+
import { VoxelLogic } from "./Classes/VoxelLogic";
|
|
3
|
+
import { VoxelPoweredLogicType } from "./Classes/Default/Types/VoxelPoweredLogicType";
|
|
4
|
+
export class VoxelLogicRegister {
|
|
5
|
+
static voxels = [];
|
|
6
|
+
static types = new Map();
|
|
7
|
+
static register(id, logicData) {
|
|
8
|
+
const voxelId = VoxelPalettesRegister.voxels.getNumberId(id);
|
|
9
|
+
this.voxels[voxelId] = new VoxelLogic(logicData);
|
|
10
|
+
}
|
|
11
|
+
static registerType(id, logic) {
|
|
12
|
+
this.types.set(id, logic);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
VoxelLogicRegister.registerType("powered", new VoxelPoweredLogicType());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ShapeStateRelationsNode } from "./ShapeStateRelationsNode";
|
|
2
2
|
import { BinarySchemaNode } from "./BinarySchemaNode";
|
|
3
3
|
import { VoxelModelStateSchemaData } from "../State.types";
|
|
4
|
-
import { DataCursorInterface } from "
|
|
4
|
+
import { DataCursorInterface } from "../../Cursor/DataCursor.interface";
|
|
5
5
|
import { Vector3Like } from "@amodx/math";
|
|
6
6
|
import { VoxelCursorInterface } from "../../Cursor/VoxelCursor.interface";
|
|
7
7
|
export declare class StateSchema {
|
|
@@ -9,7 +9,12 @@ export class SchemaRegister {
|
|
|
9
9
|
static voxelModelMap = new Map();
|
|
10
10
|
static voxelSchemas = new Map();
|
|
11
11
|
static hasVoxelSchema(voxelId) {
|
|
12
|
-
|
|
12
|
+
if (this.voxelSchemas.has(voxelId))
|
|
13
|
+
return true;
|
|
14
|
+
if (this.modelStateSchemaData.has(this.voxelModelMap.get(voxelId) || "") &&
|
|
15
|
+
this.voxelModSchemaData.has(voxelId))
|
|
16
|
+
return true;
|
|
17
|
+
return false;
|
|
13
18
|
}
|
|
14
19
|
static getVoxelSchemas(voxelId) {
|
|
15
20
|
if (this.voxelSchemas.has(voxelId)) {
|
|
@@ -18,12 +23,12 @@ export class SchemaRegister {
|
|
|
18
23
|
const modelId = this.voxelModelMap.get(voxelId);
|
|
19
24
|
if (!modelId)
|
|
20
25
|
throw new Error(`Voxel ${voxelId} is not registered`);
|
|
21
|
-
let
|
|
22
|
-
if (!
|
|
26
|
+
let stateSchema = this.modelStaeSchemas.get(modelId);
|
|
27
|
+
if (!stateSchema) {
|
|
23
28
|
const schemaData = this.modelStateSchemaData.get(modelId);
|
|
24
29
|
if (!schemaData)
|
|
25
30
|
throw new Error(`Model ${modelId} is not registered`);
|
|
26
|
-
|
|
31
|
+
stateSchema = new BinarySchema(schemaData);
|
|
27
32
|
}
|
|
28
33
|
let modSchema = this.voxelModSchemas.get(voxelId);
|
|
29
34
|
if (!modSchema) {
|
|
@@ -32,7 +37,7 @@ export class SchemaRegister {
|
|
|
32
37
|
throw new Error(`Voxel ${voxelId} is not registered`);
|
|
33
38
|
modSchema = new BinarySchema(schemaData);
|
|
34
39
|
}
|
|
35
|
-
const voxelSchema = new VoxelSchema(voxelId,
|
|
40
|
+
const voxelSchema = new VoxelSchema(voxelId, stateSchema, modSchema);
|
|
36
41
|
this.voxelSchemas.set(voxelId, voxelSchema);
|
|
37
42
|
return voxelSchema;
|
|
38
43
|
}
|
|
@@ -8,15 +8,14 @@ export class StateTreeReader {
|
|
|
8
8
|
this.defaultValue = defaultValue;
|
|
9
9
|
this.tree = tree;
|
|
10
10
|
}
|
|
11
|
-
getState(
|
|
11
|
+
getState(state) {
|
|
12
12
|
if (!this.tree.length)
|
|
13
13
|
return this.defaultValue;
|
|
14
14
|
let found = -1;
|
|
15
15
|
let index = this.startingIndex;
|
|
16
16
|
let curretNode = this.tree;
|
|
17
17
|
while (found == -1) {
|
|
18
|
-
curretNode =
|
|
19
|
-
curretNode[index][this.schema.nodes[index].getValue(shapeState)];
|
|
18
|
+
curretNode = curretNode[index][this.schema.nodes[index].getValue(state)];
|
|
20
19
|
if (typeof curretNode == "number") {
|
|
21
20
|
return curretNode;
|
|
22
21
|
}
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { TextureId } from "../../Textures/index";
|
|
2
2
|
import { VoxelModelConstructorData } from "../../Models/VoxelModel.types";
|
|
3
3
|
import { VoxelTags } from "../Data/VoxelTag.types";
|
|
4
|
+
import { VoxelLogicData } from "../Logic/VoxelLogic.types";
|
|
5
|
+
export interface VoxelDataArrays {
|
|
6
|
+
/**The runtime numeric voxel ids */
|
|
7
|
+
ids: Uint16Array;
|
|
8
|
+
/**The light data for voxels stored as 4 nibbles. 0 -> sun light 1 -> red light 2 -> green light 3 -> blue light */
|
|
9
|
+
light: Uint16Array;
|
|
10
|
+
/**The levels of the voxel. Used mainly for waterflow now. */
|
|
11
|
+
level: Uint8Array;
|
|
12
|
+
/**The state of the voxel. Used mainly be the voxel model system to get the model shape. */
|
|
13
|
+
state: Uint16Array;
|
|
14
|
+
/**The mod state of the voxel. Used mainly by the voxel model system to change model inputs. */
|
|
15
|
+
mod: Uint16Array;
|
|
16
|
+
/**The secondary state of the voxel. Can be set to a voxel id to make things like water logged voxels.
|
|
17
|
+
* But the main voxel itself must not use state or mod because the secondary voxel will use the same state and mod.
|
|
18
|
+
*/
|
|
19
|
+
secondary: Uint16Array;
|
|
20
|
+
}
|
|
4
21
|
export type VoxelNamedStateData = {
|
|
5
22
|
id: string;
|
|
6
23
|
name?: string;
|
|
@@ -20,11 +37,13 @@ export type VoxelNamedStateData = {
|
|
|
20
37
|
};
|
|
21
38
|
export declare class PaintVoxelData {
|
|
22
39
|
id: string;
|
|
40
|
+
name: string;
|
|
23
41
|
mod: number;
|
|
24
42
|
state: number;
|
|
25
43
|
level: number;
|
|
26
44
|
levelState: number;
|
|
27
45
|
secondaryVoxelId: string;
|
|
46
|
+
secondaryVoxeName: string;
|
|
28
47
|
static Create(data: Partial<PaintVoxelData>): PaintVoxelData;
|
|
29
48
|
private constructor();
|
|
30
49
|
}
|
|
@@ -47,6 +66,8 @@ export type RawVoxelData = [
|
|
|
47
66
|
];
|
|
48
67
|
interface VoxelProperties extends Partial<VoxelTags> {
|
|
49
68
|
[key: string]: any;
|
|
69
|
+
/**Logic data for a the voxel */
|
|
70
|
+
dve_logic_data?: VoxelLogicData[];
|
|
50
71
|
/** Named states associated with the voxel. */
|
|
51
72
|
dve_named_states?: VoxelNamedStateData[];
|
|
52
73
|
/** Model data used to construct the voxel's appearance. */
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
export class PaintVoxelData {
|
|
2
2
|
id;
|
|
3
|
+
name;
|
|
3
4
|
mod;
|
|
4
5
|
state;
|
|
5
6
|
level;
|
|
6
7
|
levelState;
|
|
7
8
|
secondaryVoxelId;
|
|
9
|
+
secondaryVoxeName;
|
|
8
10
|
static Create(data) {
|
|
9
|
-
return new PaintVoxelData(data.id, data.mod, data.state, data.level, data.levelState, data.secondaryVoxelId);
|
|
11
|
+
return new PaintVoxelData(data.id, data.name, data.mod, data.state, data.level, data.levelState, data.secondaryVoxelId, data.secondaryVoxeName);
|
|
10
12
|
}
|
|
11
|
-
constructor(id = "dve_air", mod = 0, state = 0, level = 0, levelState = 0, secondaryVoxelId = "dve_air") {
|
|
13
|
+
constructor(id = "dve_air", name = "", mod = 0, state = 0, level = 0, levelState = 0, secondaryVoxelId = "dve_air", secondaryVoxeName = "") {
|
|
12
14
|
this.id = id;
|
|
15
|
+
this.name = name;
|
|
13
16
|
this.mod = mod;
|
|
14
17
|
this.state = state;
|
|
15
18
|
this.level = level;
|
|
16
19
|
this.levelState = levelState;
|
|
17
20
|
this.secondaryVoxelId = secondaryVoxelId;
|
|
21
|
+
this.secondaryVoxeName = secondaryVoxeName;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -7,8 +7,10 @@ import { VoxelGeometryData, VoxelGeometryNodes } from "../../Models/VoxelModel.t
|
|
|
7
7
|
import { VoxelEffectSyncData } from "../Effects/VoxelEffects.types";
|
|
8
8
|
import { VoxelTagStatesData } from "../Data/VoxelTagStates";
|
|
9
9
|
import { VoxelSubstanceTags, VoxelTags } from "../Data/VoxelTag.types";
|
|
10
|
+
import { VoxelLogicData } from "../../Voxels/Logic/VoxelLogic.types";
|
|
10
11
|
export type CompiledVoxelTagAndPaletteData = {
|
|
11
12
|
data: {
|
|
13
|
+
logic: Record<string, VoxelLogicData[]>;
|
|
12
14
|
tags: VoxelTags[];
|
|
13
15
|
palette: string[];
|
|
14
16
|
nameToIdMap: [string, string][];
|
|
@@ -60,10 +62,10 @@ export interface CompiledVoxelModelData {
|
|
|
60
62
|
schema: VoxelModelStateSchemaData[];
|
|
61
63
|
effects: VoxelEffectSyncData[];
|
|
62
64
|
geoLinkMap: number[];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
stateTree: any[];
|
|
66
|
+
stateMap: number[][];
|
|
67
|
+
stateGeometryMap: number[][];
|
|
68
|
+
stateRelativeGeometryMap: number[][];
|
|
67
69
|
relativeGeometryByteIndexMap: number[];
|
|
68
70
|
condiotnalStatements: StateLogicStatement[];
|
|
69
71
|
condiotnalStateMap: number[][];
|