@divinevoxel/vlox 0.0.73 → 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.
Files changed (217) hide show
  1. package/Contexts/Base/Remote/InitDataSync.js +4 -0
  2. package/Contexts/Base/Remote/InitWorldDataSync.js +1 -1
  3. package/Contexts/Render/DivineVoxelEngineRender.d.ts +1 -0
  4. package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -0
  5. package/Init/StartConstructor.js +2 -0
  6. package/Math/index.d.ts +5 -1
  7. package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
  8. package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
  9. package/Mesher/Functions/MeshSection.d.ts +1 -1
  10. package/Mesher/Functions/MeshSection.js +15 -22
  11. package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
  12. package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
  13. package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +1 -1
  14. package/Mesher/Geomtry/VoxelGeometryBuilder.js +118 -197
  15. package/Mesher/Geomtry/VoxelMesh.js +2 -2
  16. package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +8 -70
  17. package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +18 -183
  18. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
  19. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
  20. package/Mesher/Geomtry/VoxelMeshBuffers.js +2 -2
  21. package/Mesher/InitTask.js +5 -1
  22. package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
  23. package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
  24. package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
  25. package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
  26. package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +7 -7
  27. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +22 -25
  28. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
  29. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
  30. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
  31. package/Mesher/Models/VoxelConstructor.d.ts +3 -3
  32. package/Mesher/Models/VoxelConstructor.js +8 -8
  33. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
  34. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -9
  35. package/Mesher/Models/VoxelModelBuilder.js +1 -8
  36. package/Mesher/Types/Mesher.types.d.ts +1 -0
  37. package/Models/Defaults/CubeVoxelModels.js +16 -39
  38. package/Models/Defaults/LiquidVoxelModel.js +3 -3
  39. package/Models/Defaults/PanelVoxelModels.js +10 -36
  40. package/Models/Defaults/StairVoxelModel.js +6 -21
  41. package/Models/Examples.js +23 -44
  42. package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
  43. package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
  44. package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
  45. package/Models/Rules/Functions/BuildFinalInputs.js +13 -13
  46. package/Models/Rules/VoxelModelRuleBuilderRegister.js +8 -8
  47. package/Models/VoxelModel.types.d.ts +3 -3
  48. package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
  49. package/Renderer/InitTasks.js +1 -9
  50. package/Renderer/MeshManager.d.ts +1 -1
  51. package/Renderer/MeshManager.js +24 -23
  52. package/Renderer/MeshRegister.d.ts +5 -5
  53. package/Renderer/MeshRegister.js +2 -2
  54. package/Settings/EngineSettings.d.ts +1 -0
  55. package/Settings/EngineSettings.js +6 -3
  56. package/Settings/EngineSettings.types.d.ts +7 -21
  57. package/Settings/EngineSettings.types.js +6 -14
  58. package/Tasks/Logic/InitTasks.d.ts +1 -0
  59. package/Tasks/Logic/InitTasks.js +10 -0
  60. package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
  61. package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
  62. package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
  63. package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
  64. package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
  65. package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
  66. package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
  67. package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
  68. package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
  69. package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
  70. package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
  71. package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
  72. package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
  73. package/Tasks/Propagation/InitTasks.js +4 -4
  74. package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
  75. package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
  76. package/Tasks/Tasks.types.d.ts +2 -2
  77. package/Tasks/TasksIds.d.ts +2 -1
  78. package/Tasks/TasksIds.js +1 -0
  79. package/Tasks/Update/Common.d.ts +3 -0
  80. package/Tasks/Update/Common.js +41 -0
  81. package/Tasks/Update/EreaseUpdate.d.ts +3 -0
  82. package/Tasks/Update/EreaseUpdate.js +66 -0
  83. package/Tasks/Update/InitTasks.d.ts +2 -2
  84. package/Tasks/Update/InitTasks.js +3 -1
  85. package/Tasks/Update/PaintUpdate.d.ts +3 -0
  86. package/Tasks/Update/PaintUpdate.js +89 -0
  87. package/Tasks/Update/VoxelUpdate.d.ts +2 -5
  88. package/Tasks/Update/VoxelUpdate.js +5 -147
  89. package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +15 -7
  90. package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +20 -7
  91. package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
  92. package/Tasks/WorldGeneration/WorldGenBrush.js +2 -2
  93. package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
  94. package/Templates/Functions/CreateTemplate.d.ts +1 -1
  95. package/Tools/Brush/AdvancedBrushTool.js +1 -1
  96. package/Tools/Brush/Brush.d.ts +2 -2
  97. package/Tools/Brush/Brush.js +1 -1
  98. package/Tools/Tasks/TasksTool.d.ts +1 -0
  99. package/Tools/Tasks/TasksTool.js +2 -0
  100. package/Util/Binary/BinaryBuffer.d.ts +17 -11
  101. package/Util/Binary/BinaryBuffer.js +65 -59
  102. package/Util/Binary/BinaryTree.d.ts +46 -0
  103. package/Util/Binary/BinaryTree.js +104 -0
  104. package/Voxels/Cursor/VoxelCursor.interface.d.ts +7 -2
  105. package/Voxels/Cursor/VoxelCursor.interface.js +46 -2
  106. package/Voxels/Cursor/VoxelLightData.js +1 -1
  107. package/Voxels/Data/VoxelTag.types.d.ts +17 -2
  108. package/Voxels/Data/VoxelTag.types.js +6 -1
  109. package/Voxels/Data/VoxelTagsRegister.js +5 -0
  110. package/Voxels/Functions/BuildStateData.d.ts +6 -6
  111. package/Voxels/Functions/BuildStateData.js +31 -31
  112. package/Voxels/Functions/BuildTagAndPaletteData.js +5 -0
  113. package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
  114. package/Voxels/Indexes/VoxelIndex.js +16 -18
  115. package/Voxels/InitVoxelData.js +12 -8
  116. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
  117. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
  118. package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
  119. package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
  120. package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
  121. package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
  122. package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
  123. package/Voxels/Logic/VoxelLogic.types.js +1 -0
  124. package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
  125. package/Voxels/Logic/VoxelLogicRegister.js +15 -0
  126. package/Voxels/State/SchemaRegister.js +10 -5
  127. package/Voxels/State/State.types.d.ts +1 -1
  128. package/Voxels/State/StateTreeReader.d.ts +1 -1
  129. package/Voxels/State/StateTreeReader.js +2 -3
  130. package/Voxels/Types/Voxel.types.d.ts +3 -0
  131. package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
  132. package/World/Archive/Archive.types.d.ts +31 -12
  133. package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
  134. package/World/Archive/Classes/ArchiveClasses.js +78 -0
  135. package/World/Archive/Classes/ImportedSection.d.ts +40 -0
  136. package/World/Archive/Classes/ImportedSection.js +307 -0
  137. package/World/Archive/Classes/ImportedSector.d.ts +23 -0
  138. package/World/Archive/Classes/ImportedSector.js +97 -0
  139. package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
  140. package/World/Archive/Functions/ArchiveArea.js +39 -36
  141. package/World/Archive/Functions/ArchiveSector.js +210 -404
  142. package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
  143. package/World/Archive/Functions/CreateArchivedSection.js +207 -0
  144. package/World/Archive/Functions/ImportSector.d.ts +1 -3
  145. package/World/Archive/Functions/ImportSector.js +13 -244
  146. package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
  147. package/World/Archive/Functions/RemoveDuplicates.js +92 -0
  148. package/World/Archive/Functions/Shared.d.ts +2 -2
  149. package/World/Archive/Functions/Shared.js +15 -40
  150. package/World/Archive/InitTasks.js +7 -10
  151. package/World/Cursor/SectionCursor.d.ts +1 -1
  152. package/World/Cursor/SectorCursor.d.ts +1 -1
  153. package/World/Cursor/WorldCursor.d.ts +4 -3
  154. package/World/Cursor/WorldCursor.js +16 -13
  155. package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
  156. package/World/Cursor/WorldVoxelCursor.js +23 -14
  157. package/World/Dimension/Dimension.d.ts +4 -1
  158. package/World/Dimension/Dimension.js +8 -1
  159. package/World/Section/Section.d.ts +17 -4
  160. package/World/Section/Section.js +68 -6
  161. package/World/Section/SectionState.d.ts +4 -2
  162. package/World/Section/SectionState.js +4 -2
  163. package/World/Sector/Sector.d.ts +7 -1
  164. package/World/Sector/Sector.js +37 -4
  165. package/World/Sector/SectorState.d.ts +3 -2
  166. package/World/Sector/SectorState.js +3 -2
  167. package/World/Types/WorldData.types.d.ts +2 -7
  168. package/World/WorldRegister.d.ts +9 -9
  169. package/World/WorldRegister.js +9 -6
  170. package/World/WorldSpaces.js +6 -6
  171. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
  172. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +6 -4
  173. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +9 -5
  174. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
  175. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
  176. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
  177. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
  178. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
  179. package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
  180. package/{Tasks/IWG/Internal/Classes/BuildQueue.js → WorldSimulation/Internal/Classes/TickQueue.js} +16 -7
  181. package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
  182. package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +6 -6
  183. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
  184. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
  185. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
  186. package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
  187. package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +29 -19
  188. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
  189. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
  190. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
  191. package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
  192. package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
  193. package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
  194. package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -14
  195. package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
  196. package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
  197. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
  198. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
  199. package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +5 -5
  200. package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +5 -5
  201. package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +21 -21
  202. package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
  203. package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
  204. package/package.json +1 -1
  205. package/Tasks/IWG/Internal/Classes/BuildQueue.d.ts +0 -11
  206. package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
  207. package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
  208. package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
  209. package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -30
  210. package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
  211. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
  212. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
  213. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
  214. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
  215. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
  216. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
  217. /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  export const simpleCube = {
2
2
  id: "dve_simple_cube",
3
3
  relationsSchema: [],
4
- shapeStateSchema: [],
4
+ stateSchema: [],
5
5
  arguments: {
6
6
  texture: {
7
7
  type: "texture",
@@ -11,8 +11,8 @@ export const simpleCube = {
11
11
  default: false,
12
12
  },
13
13
  },
14
- shapeStatesConditonalNodes: {},
15
- shapeStatesNodes: {
14
+ conditonalNodes: {},
15
+ stateNodes: {
16
16
  "*": [
17
17
  {
18
18
  id: "cube",
@@ -38,28 +38,16 @@ export const simpleCube = {
38
38
  export const orientedCube = {
39
39
  id: "dve_oriented_cube",
40
40
  relationsSchema: [],
41
- shapeStateSchema: [
41
+ stateSchema: [
42
42
  {
43
43
  name: "placement",
44
44
  type: "string",
45
- values: {
46
- 0: "down",
47
- 1: "up",
48
- 2: "north",
49
- 3: "south",
50
- 4: "east",
51
- 5: "west",
52
- },
45
+ values: ["down", "up", "north", "south", "east", "west"],
53
46
  },
54
47
  {
55
48
  name: "direction",
56
49
  type: "string",
57
- values: {
58
- 0: "north",
59
- 1: "south",
60
- 2: "east",
61
- 3: "west",
62
- },
50
+ values: ["north", "south", "east", "west"],
63
51
  },
64
52
  ],
65
53
  arguments: {
@@ -82,8 +70,8 @@ export const orientedCube = {
82
70
  type: "texture",
83
71
  },
84
72
  },
85
- shapeStatesConditonalNodes: {},
86
- shapeStatesNodes: {
73
+ conditonalNodes: {},
74
+ stateNodes: {
87
75
  "placement=down,direction=north": [
88
76
  {
89
77
  id: "cube",
@@ -553,18 +541,11 @@ export const orientedCube = {
553
541
  export const simpleHalfCube = {
554
542
  id: "dve_simple_half_cube",
555
543
  relationsSchema: [],
556
- shapeStateSchema: [
544
+ stateSchema: [
557
545
  {
558
546
  name: "placement",
559
547
  type: "string",
560
- values: {
561
- 0: "down",
562
- 1: "up",
563
- 2: "north",
564
- 3: "south",
565
- 4: "east",
566
- 5: "west",
567
- },
548
+ values: ["down", "up", "north", "south", "east", "west"],
568
549
  },
569
550
  ],
570
551
  arguments: {
@@ -575,8 +556,8 @@ export const simpleHalfCube = {
575
556
  type: "texture",
576
557
  },
577
558
  },
578
- shapeStatesConditonalNodes: {},
579
- shapeStatesNodes: {
559
+ conditonalNodes: {},
560
+ stateNodes: {
580
561
  "placement=down": [
581
562
  {
582
563
  id: "half_cube",
@@ -724,15 +705,11 @@ export const pillarCube = {
724
705
  ],
725
706
  },
726
707
  ],
727
- shapeStateSchema: [
708
+ stateSchema: [
728
709
  {
729
710
  name: "direction",
730
711
  type: "string",
731
- values: {
732
- 0: "down-up",
733
- 1: "south-north",
734
- 2: "west-east",
735
- },
712
+ values: ["down-up", "south-north", "west-east"],
736
713
  },
737
714
  ],
738
715
  arguments: {
@@ -755,8 +732,8 @@ export const pillarCube = {
755
732
  type: "texture",
756
733
  },
757
734
  },
758
- shapeStatesConditonalNodes: {},
759
- shapeStatesNodes: {
735
+ conditonalNodes: {},
736
+ stateNodes: {
760
737
  "direction=down-up,same-down=false,same-up=false": [
761
738
  {
762
739
  id: "cube",
@@ -22,7 +22,7 @@ export const liquidGeometry = {
22
22
  export const liquidModel = {
23
23
  id: "dve_liquid",
24
24
  relationsSchema: [],
25
- shapeStateSchema: [],
25
+ stateSchema: [],
26
26
  arguments: {
27
27
  stillTexture: {
28
28
  type: "texture",
@@ -31,8 +31,8 @@ export const liquidModel = {
31
31
  type: "texture",
32
32
  },
33
33
  },
34
- shapeStatesConditonalNodes: {},
35
- shapeStatesNodes: {
34
+ conditonalNodes: {},
35
+ stateNodes: {
36
36
  "*": [
37
37
  {
38
38
  id: "liquid",
@@ -1,28 +1,16 @@
1
1
  export const simpleThinPannel = {
2
2
  id: "dve_simple_thin_panel",
3
3
  relationsSchema: [],
4
- shapeStateSchema: [
4
+ stateSchema: [
5
5
  {
6
6
  name: "placement",
7
7
  type: "string",
8
- values: {
9
- 0: "down",
10
- 1: "up",
11
- 2: "north",
12
- 3: "south",
13
- 4: "east",
14
- 5: "west",
15
- },
8
+ values: ["down", "up", "north", "south", "east", "west"],
16
9
  },
17
10
  {
18
11
  name: "direction",
19
12
  type: "string",
20
- values: {
21
- 0: "north",
22
- 1: "south",
23
- 2: "east",
24
- 3: "west",
25
- },
13
+ values: ["north", "south", "east", "west"],
26
14
  },
27
15
  ],
28
16
  arguments: {
@@ -37,9 +25,8 @@ export const simpleThinPannel = {
37
25
  type: "texture",
38
26
  },
39
27
  },
40
- shapeStatesConditonalNodes: {},
41
- // shapeStatesOverrides: {},
42
- shapeStatesNodes: {
28
+ conditonalNodes: {},
29
+ stateNodes: {
43
30
  "placement=down,direction=south": [
44
31
  {
45
32
  id: "cube",
@@ -489,28 +476,16 @@ export const simpleThinPannel = {
489
476
  export const simpleCrossedPannel = {
490
477
  id: "dve_simple_crossed_panels",
491
478
  relationsSchema: [],
492
- shapeStateSchema: [
479
+ stateSchema: [
493
480
  {
494
481
  name: "placement",
495
482
  type: "string",
496
- values: {
497
- 0: "down",
498
- 1: "up",
499
- 2: "north",
500
- 3: "south",
501
- 4: "east",
502
- 5: "west",
503
- },
483
+ values: ["down", "up", "north", "south", "east", "west"],
504
484
  },
505
485
  {
506
486
  name: "direction",
507
487
  type: "string",
508
- values: {
509
- 0: "north",
510
- 1: "south",
511
- 2: "east",
512
- 3: "west",
513
- },
488
+ values: ["north", "south", "east", "west"],
514
489
  },
515
490
  ],
516
491
  arguments: {
@@ -526,9 +501,8 @@ export const simpleCrossedPannel = {
526
501
  default: false,
527
502
  },
528
503
  },
529
- shapeStatesConditonalNodes: {},
530
- // shapeStatesOverrides: {},
531
- shapeStatesNodes: {
504
+ conditonalNodes: {},
505
+ stateNodes: {
532
506
  "placement=down,direction=north": [
533
507
  {
534
508
  id: "quad-1",
@@ -1,36 +1,21 @@
1
1
  export const stair = {
2
2
  id: "dve_simple_stair",
3
3
  relationsSchema: [],
4
- shapeStateSchema: [
4
+ stateSchema: [
5
5
  {
6
6
  name: "placement",
7
7
  type: "string",
8
- values: {
9
- 0: "down",
10
- 1: "up",
11
- 2: "north",
12
- 3: "south",
13
- 4: "east",
14
- 5: "west",
15
- },
8
+ values: ["down", "up", "north", "south", "east", "west"],
16
9
  },
17
10
  {
18
11
  name: "direction",
19
12
  type: "string",
20
- values: {
21
- 0: "south",
22
- 1: "north",
23
- 2: "east",
24
- 3: "west",
25
- },
13
+ values: ["south", "north", "east", "west"],
26
14
  },
27
15
  {
28
16
  name: "connected",
29
17
  type: "string",
30
- values: {
31
- 0: "false",
32
- 1: "true",
33
- },
18
+ values: ["false", "true"],
34
19
  },
35
20
  ],
36
21
  arguments: {
@@ -38,8 +23,8 @@ export const stair = {
38
23
  type: "texture",
39
24
  },
40
25
  },
41
- shapeStatesConditonalNodes: {},
42
- shapeStatesNodes: {
26
+ conditonalNodes: {},
27
+ stateNodes: {
43
28
  "placement=up,direction=north,connected=false": [
44
29
  {
45
30
  id: "base",
@@ -42,19 +42,15 @@ export const chainModel = {
42
42
  },
43
43
  },
44
44
  relationsSchema: [],
45
- shapeStateSchema: [
45
+ stateSchema: [
46
46
  {
47
47
  name: "axis",
48
48
  type: "string",
49
- values: {
50
- 0: "y",
51
- 1: "x",
52
- 2: "z",
53
- },
49
+ values: ["y", "x", "z"],
54
50
  },
55
51
  ],
56
- shapeStatesConditonalNodes: {},
57
- shapeStatesNodes: {
52
+ conditonalNodes: {},
53
+ stateNodes: {
58
54
  "axis=y": [
59
55
  {
60
56
  id: "main",
@@ -144,9 +140,9 @@ export const carpetModel = {
144
140
  },
145
141
  },
146
142
  relationsSchema: [],
147
- shapeStateSchema: [],
148
- shapeStatesConditonalNodes: {},
149
- shapeStatesNodes: {
143
+ stateSchema: [],
144
+ conditonalNodes: {},
145
+ stateNodes: {
150
146
  "*": [
151
147
  {
152
148
  id: "main",
@@ -404,6 +400,7 @@ export const fenceNorthsouth = {
404
400
  };
405
401
  export const fence = {
406
402
  id: "dve_fence",
403
+ divisor: [16, 16, 16],
407
404
  relationsSchema: [
408
405
  {
409
406
  name: "same-east",
@@ -442,7 +439,7 @@ export const fence = {
442
439
  ],
443
440
  },
444
441
  ],
445
- shapeStateSchema: [],
442
+ stateSchema: [],
446
443
  arguments: {
447
444
  southTex: {
448
445
  type: "texture",
@@ -463,7 +460,7 @@ export const fence = {
463
460
  type: "texture",
464
461
  },
465
462
  },
466
- shapeStatesConditonalNodes: {
463
+ conditonalNodes: {
467
464
  "same-south=true": [
468
465
  {
469
466
  id: "fence_connection_south",
@@ -523,7 +520,7 @@ export const fence = {
523
520
  },
524
521
  ],
525
522
  },
526
- shapeStatesNodes: {
523
+ stateNodes: {
527
524
  "*": [
528
525
  {
529
526
  id: "fence_post",
@@ -828,7 +825,7 @@ export const candlesModel = {
828
825
  },
829
826
  },
830
827
  relationsSchema: [],
831
- shapeStateSchema: [
828
+ stateSchema: [
832
829
  {
833
830
  name: "num_candles",
834
831
  type: "number",
@@ -837,10 +834,7 @@ export const candlesModel = {
837
834
  {
838
835
  name: "lit",
839
836
  type: "string",
840
- values: {
841
- 0: "false",
842
- 1: "true",
843
- },
837
+ values: ["false", "true"],
844
838
  },
845
839
  ],
846
840
  effects: [
@@ -881,8 +875,8 @@ export const candlesModel = {
881
875
  },
882
876
  },
883
877
  ],
884
- shapeStatesConditonalNodes: {},
885
- shapeStatesNodes: {
878
+ conditonalNodes: {},
879
+ stateNodes: {
886
880
  "num_candles=0,lit=false": [
887
881
  {
888
882
  id: "candel_1",
@@ -1161,40 +1155,25 @@ export const leverModel = {
1161
1155
  },
1162
1156
  },
1163
1157
  relationsSchema: [],
1164
- shapeStateSchema: [
1158
+ stateSchema: [
1165
1159
  {
1166
1160
  name: "placement",
1167
1161
  type: "string",
1168
- values: {
1169
- 0: "down",
1170
- 1: "up",
1171
- 2: "north",
1172
- 3: "south",
1173
- 4: "east",
1174
- 5: "west",
1175
- },
1162
+ values: ["down", "up", "north", "south", "east", "west"],
1176
1163
  },
1177
1164
  {
1178
1165
  name: "direction",
1179
1166
  type: "string",
1180
- values: {
1181
- 0: "north",
1182
- 1: "south",
1183
- 2: "east",
1184
- 3: "west",
1185
- },
1167
+ values: ["north", "south", "east", "west"],
1186
1168
  },
1187
1169
  {
1188
1170
  name: "state",
1189
1171
  type: "string",
1190
- values: {
1191
- 0: "off",
1192
- 1: "on",
1193
- },
1172
+ values: ["off", "on"],
1194
1173
  },
1195
1174
  ],
1196
- shapeStatesConditonalNodes: {},
1197
- shapeStatesNodes: {
1175
+ conditonalNodes: {},
1176
+ stateNodes: {
1198
1177
  "placement=down,direction=north,state=off": [
1199
1178
  {
1200
1179
  id: "lever_base",
@@ -1242,7 +1221,7 @@ export const leverModel = {
1242
1221
  {
1243
1222
  id: "lever",
1244
1223
  geometryId: "dve_lever_model",
1245
- position: [0, -.8, 3],
1224
+ position: [0, -0.8, 3],
1246
1225
  rotation: [45, 0, 0],
1247
1226
  inputs: {
1248
1227
  texture: "@leverTexture",
@@ -1260,7 +1239,7 @@ export const leverModel = {
1260
1239
  {
1261
1240
  id: "lever",
1262
1241
  geometryId: "dve_lever_model",
1263
- position: [0, -.8, -3],
1242
+ position: [0, -0.8, -3],
1264
1243
  rotation: [-45, 0, 0],
1265
1244
  inputs: {
1266
1245
  texture: "@leverTexture",
@@ -2,7 +2,7 @@ import { VoxelModelConstructorData, VoxelModelData } from "../../VoxelModel.type
2
2
  import { BuildStateData } from "../../../Voxels/Functions/BuildStateData";
3
3
  export declare class VoxelRulesModoel {
4
4
  data: VoxelModelData;
5
- shapeStates: Map<string, string[]>;
5
+ states: Map<string, string[]>;
6
6
  conditionalNodes: Map<string, string[]>;
7
7
  stateData: ReturnType<typeof BuildStateData>;
8
8
  voxels: Map<string, VoxelModelConstructorData>;
@@ -1,6 +1,6 @@
1
1
  export class VoxelRulesModoel {
2
2
  data;
3
- shapeStates = new Map();
3
+ states = new Map();
4
4
  conditionalNodes = new Map();
5
5
  stateData;
6
6
  voxels = new Map();
@@ -9,10 +9,10 @@ export class VoxelRulesModoel {
9
9
  this.data = data;
10
10
  }
11
11
  registerShapeState(id, geomtryId) {
12
- let stateArray = this.shapeStates.get(id);
12
+ let stateArray = this.states.get(id);
13
13
  if (!stateArray) {
14
14
  stateArray = [];
15
- this.shapeStates.set(id, stateArray);
15
+ this.states.set(id, stateArray);
16
16
  }
17
17
  if (!stateArray.find((_) => _ == geomtryId))
18
18
  stateArray.push(geomtryId);
@@ -1,7 +1,7 @@
1
1
  import { VoxelFaceTransparentResultsIndex } from "../../Indexing/VoxelFaceTransparentResultsIndex";
2
2
  import { VoxelRulesModoel } from "../Classes/VoxelRulesModel";
3
3
  export declare function BuildFinalInputs(model: VoxelRulesModoel): {
4
- shapeStateVoxelInputs: Record<string, any[]>;
4
+ stateVoxelInputs: Record<string, any[]>;
5
5
  transparentVoxelFaceIndexes: Record<string, VoxelFaceTransparentResultsIndex>;
6
6
  conditionalShapeStateVoxelInputs: Record<string, any[]>;
7
7
  };
@@ -6,7 +6,7 @@ const isArgString = (data) => {
6
6
  return data[0] == "@";
7
7
  };
8
8
  export function BuildFinalInputs(model) {
9
- const shapeStateVoxelInputs = {};
9
+ const stateVoxelInputs = {};
10
10
  const transparentVoxelFaceIndexes = {};
11
11
  const conditionalShapeStateVoxelInputs = {};
12
12
  for (const [voxelId, voxel] of model.voxels) {
@@ -20,10 +20,10 @@ export function BuildFinalInputs(model) {
20
20
  const modVoxelInput = voxel.inputs[modVoxelInputKey];
21
21
  const modIndex = voxelModData.modRecord[modVoxelInputKey];
22
22
  const baseStates = [];
23
- for (const state in model.data.shapeStatesNodes) {
23
+ for (const state in model.data.stateNodes) {
24
24
  const geoNodes = [];
25
- const shapeStateNodes = model.data.shapeStatesNodes[state];
26
- for (const node of shapeStateNodes) {
25
+ const stateNodes = model.data.stateNodes[state];
26
+ for (const node of stateNodes) {
27
27
  const geo = VoxelModelRuleBuilderRegister.getGeomtryFromLink(node);
28
28
  if (!geo)
29
29
  throw new Error(`Geometry does not exist`);
@@ -39,24 +39,24 @@ export function BuildFinalInputs(model) {
39
39
  }
40
40
  geoNodes[model.stateData.geometryLinkPalette[node.id]] =
41
41
  geo.inputs.cloneArgs();
42
- const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.shapeStateRelativeGeometryMap[model.stateData.shapeStateRecord[state]][VoxelModelRuleBuilderRegister.geometryPalette.getNumberId(VoxelModelRuleBuilderRegister.getGeometryLinkId(node))]];
42
+ const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.stateRelativeGeometryMap[model.stateData.stateRecord[state]][VoxelModelRuleBuilderRegister.geometryPalette.getNumberId(VoxelModelRuleBuilderRegister.getGeometryLinkId(node))]];
43
43
  if (geo.data.ogData.doNotBuildRules !== true) {
44
44
  for (let i = 0; i < geo.inputs.faceTransparentIndex.length; i++) {
45
45
  transparentIndex.setValue(modIndex, byteIndex, i, geo.inputs.faceTransparentIndex[i] ? 1 : 0);
46
46
  }
47
47
  }
48
48
  }
49
- baseStates[model.stateData.shapeStateRecord[state]] = geoNodes;
49
+ baseStates[model.stateData.stateRecord[state]] = geoNodes;
50
50
  }
51
- shapeStateVoxelInputs[voxelId] ??= [];
52
- shapeStateVoxelInputs[voxelId][voxelModData.modRecord[modVoxelInputKey]] =
51
+ stateVoxelInputs[voxelId] ??= [];
52
+ stateVoxelInputs[voxelId][voxelModData.modRecord[modVoxelInputKey]] =
53
53
  baseStates;
54
54
  const condiotnalStates = [];
55
- for (const state in model.data.shapeStatesConditonalNodes) {
55
+ for (const state in model.data.conditonalNodes) {
56
56
  const geoNodes = [];
57
- const shapeStateNodes = model.data.shapeStatesConditonalNodes[state];
58
- for (let i = 0; i < shapeStateNodes.length; i++) {
59
- const node = shapeStateNodes[i];
57
+ const stateNodes = model.data.conditonalNodes[state];
58
+ for (let i = 0; i < stateNodes.length; i++) {
59
+ const node = stateNodes[i];
60
60
  const geo = VoxelModelRuleBuilderRegister.getGeomtryFromLink(node);
61
61
  if (!geo)
62
62
  throw new Error(`Geometry does not exist`);
@@ -86,7 +86,7 @@ export function BuildFinalInputs(model) {
86
86
  }
87
87
  }
88
88
  return {
89
- shapeStateVoxelInputs,
89
+ stateVoxelInputs,
90
90
  transparentVoxelFaceIndexes,
91
91
  conditionalShapeStateVoxelInputs,
92
92
  };
@@ -111,8 +111,8 @@ export class VoxelModelRuleBuilderRegister {
111
111
  this.models.set(model.id, rulesModel);
112
112
  const divisor = model.divisor ? model.divisor : null;
113
113
  if (divisor) {
114
- for (const stateId in model.shapeStatesNodes) {
115
- const nodes = model.shapeStatesNodes[stateId];
114
+ for (const stateId in model.stateNodes) {
115
+ const nodes = model.stateNodes[stateId];
116
116
  for (const node of nodes) {
117
117
  const d = "divisor" in node ? node.divisor : divisor;
118
118
  if (node.position) {
@@ -127,8 +127,8 @@ export class VoxelModelRuleBuilderRegister {
127
127
  }
128
128
  }
129
129
  }
130
- for (const stateId in model.shapeStatesConditonalNodes) {
131
- const nodes = model.shapeStatesConditonalNodes[stateId];
130
+ for (const stateId in model.conditonalNodes) {
131
+ const nodes = model.conditonalNodes[stateId];
132
132
  for (const node of nodes) {
133
133
  const d = "divisor" in node ? node.divisor : divisor;
134
134
  if (node.position) {
@@ -157,12 +157,12 @@ export class VoxelModelRuleBuilderRegister {
157
157
  }
158
158
  }
159
159
  }
160
- for (const stateId in model.shapeStatesNodes) {
161
- const nodes = model.shapeStatesNodes[stateId];
160
+ for (const stateId in model.stateNodes) {
161
+ const nodes = model.stateNodes[stateId];
162
162
  addGeo(model, stateId, nodes).forEach((_) => rulesModel.registerShapeState(..._));
163
163
  }
164
- for (const stateId in model.shapeStatesConditonalNodes) {
165
- const nodes = model.shapeStatesConditonalNodes[stateId];
164
+ for (const stateId in model.conditonalNodes) {
165
+ const nodes = model.conditonalNodes[stateId];
166
166
  addGeo(model, stateId, nodes).forEach((_) => rulesModel.registerCondiotnalNode(..._));
167
167
  }
168
168
  }
@@ -123,9 +123,9 @@ export interface VoxelModelData {
123
123
  /**Divisor used all transforms of geometry nodes. */
124
124
  divisor?: Vec3Array;
125
125
  arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument>;
126
- shapeStateSchema: (VoxelStateStringSchemaData | VoxelStateNumberSchemaData)[];
126
+ stateSchema: (VoxelStateStringSchemaData | VoxelStateNumberSchemaData)[];
127
127
  effects?: VoxelEffectData[];
128
128
  relationsSchema: VoxelModelRelationsSchemaData[];
129
- shapeStatesNodes: Record<string, VoxelGeometryLinkData[]>;
130
- shapeStatesConditonalNodes: Record<string, VoxelGeometryLinkData[]>;
129
+ stateNodes: Record<string, VoxelGeometryLinkData[]>;
130
+ conditonalNodes: Record<string, VoxelGeometryLinkData[]>;
131
131
  }
@@ -1,7 +1,6 @@
1
- import { Vec3Array } from "@amodx/math";
2
- import { CompactMeshData } from "../../Mesher/Types/Mesher.types";
3
1
  import { SectionMesh } from "./SectionMesh";
2
+ import { CompactedSectionVoxelMesh } from "../../Mesher/Geomtry/CompactedSectionVoxelMesh";
4
3
  export declare abstract class DVESectionMeshes {
5
- abstract updateVertexData(section: SectionMesh, position: Vec3Array, data: CompactMeshData): SectionMesh;
4
+ abstract updateVertexData(section: SectionMesh, data: CompactedSectionVoxelMesh): SectionMesh;
6
5
  abstract returnMesh(mesh: any): void;
7
6
  }
@@ -7,16 +7,8 @@ export default function RendererTasks(threads) {
7
7
  const tasks = new TaskTool(threads);
8
8
  Threads.registerTask("set-section", (data, origin) => {
9
9
  MeshManager.updateSection(data);
10
- const tranfers = [];
11
- if (data[1][0] == 0) {
12
- const comp = data[1][1];
13
- for (const mesh of comp) {
14
- tranfers.push(mesh[1].buffer);
15
- tranfers.push(mesh[2].buffer);
16
- }
17
- }
18
10
  if (!EngineSettings.settings.rendererSettings.cpuBound) {
19
- origin.sendMessage([], tranfers);
11
+ origin.sendMessage([], [data]);
20
12
  }
21
13
  });
22
14
  Threads.registerTask("remove-sector", (data) => {
@@ -1,4 +1,4 @@
1
- import { SetSectionMeshTask } from "../Renderer/Renderer.types";
1
+ import type { SetSectionMeshTask } from "../Mesher/Types/Mesher.types";
2
2
  import { LocationData } from "../Math/index.js";
3
3
  import { DVESectionMeshes } from "./Classes/DVESectionMeshes";
4
4
  export declare class MeshManager {