@divinevoxel/vlox 0.0.71 → 0.0.73

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 (271) hide show
  1. package/Contexts/Base/Main/InitDataGenerator.js +0 -9
  2. package/Contexts/Base/Remote/DataSync.types.d.ts +0 -5
  3. package/Contexts/Base/Remote/InitDataSync.js +17 -31
  4. package/Contexts/Render/DivineVoxelEngineRender.d.ts +1 -1
  5. package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -1
  6. package/Init/StartConstructor.js +7 -7
  7. package/Init/StartWorld.d.ts +1 -1
  8. package/Init/StartWorld.js +0 -12
  9. package/Math/Indexing.d.ts +12 -3
  10. package/Math/Indexing.js +24 -15
  11. package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
  12. package/Mesher/Functions/CompactVoxelMesh.js +4 -5
  13. package/Mesher/Functions/MeshSection.d.ts +1 -1
  14. package/Mesher/Functions/MeshSection.js +72 -66
  15. package/Mesher/Functions/MeshTexture.d.ts +1 -1
  16. package/Mesher/Functions/MeshTexture.js +3 -4
  17. package/Mesher/Functions/MeshVoxel.js +20 -26
  18. package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +12 -10
  19. package/Mesher/Geomtry/Primitives/QuadVertexData.js +49 -56
  20. package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +2 -2
  21. package/Mesher/Geomtry/VoxelGeometryBuilder.js +108 -125
  22. package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
  23. package/Mesher/Geomtry/VoxelMesh.js +2 -2
  24. package/Mesher/{Tools → Geomtry}/VoxelMeshBVHBuilder.d.ts +2 -9
  25. package/Mesher/{Tools → Geomtry}/VoxelMeshBVHBuilder.js +4 -16
  26. package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +9 -8
  27. package/Mesher/Geomtry/VoxelMeshBuffers.js +49 -0
  28. package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +10 -0
  29. package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +10 -0
  30. package/Mesher/Geomtry/index.d.ts +0 -1
  31. package/Mesher/Geomtry/index.js +0 -1
  32. package/Mesher/InitMesher.js +2 -11
  33. package/Mesher/InitTask.js +10 -22
  34. package/Mesher/Models/Common/BoundsFunctions.d.ts +1 -3
  35. package/Mesher/Models/Common/BoundsFunctions.js +0 -16
  36. package/Mesher/Models/Common/Calc/CalcConstants.js +14 -31
  37. package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -8
  38. package/Mesher/Models/Common/Calc/FaceDataCalc.js +50 -52
  39. package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +2 -2
  40. package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
  41. package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +1 -5
  42. package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +40 -42
  43. package/Mesher/Models/Nodes/GeometryNode.d.ts +3 -5
  44. package/Mesher/Models/Nodes/GeometryNode.js +1 -2
  45. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +3 -6
  46. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +55 -40
  47. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.d.ts +2 -6
  48. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +52 -51
  49. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.d.ts +2 -6
  50. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +18 -19
  51. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.d.ts +2 -6
  52. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +37 -40
  53. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.d.ts +1 -1
  54. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.js +1 -1
  55. package/Mesher/Models/RenderedMaterials.d.ts +6 -0
  56. package/Mesher/{RenderedMaterials.js → Models/RenderedMaterials.js} +2 -2
  57. package/Mesher/Models/VoxelConstructor.d.ts +4 -5
  58. package/Mesher/Models/VoxelConstructor.js +23 -12
  59. package/Mesher/Models/{VoxelGeometryLookUp.d.ts → VoxelGeometryBuilderCacheSpace.d.ts} +6 -14
  60. package/Mesher/Models/{VoxelGeometryLookUp.js → VoxelGeometryBuilderCacheSpace.js} +26 -44
  61. package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +10 -8
  62. package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +44 -19
  63. package/Mesher/Models/VoxelModelConstructorRegister.js +3 -3
  64. package/Models/Defaults/CubeVoxelGeometry.js +4 -0
  65. package/Models/Defaults/CubeVoxelModels.js +344 -344
  66. package/Models/Defaults/LiquidVoxelModel.js +2 -2
  67. package/Models/Defaults/PanelVoxelModels.js +432 -432
  68. package/Models/Defaults/StairVoxelModel.js +576 -576
  69. package/Models/Examples.js +469 -456
  70. package/Models/Indexing/VoxelAOResultsIndex.d.ts +4 -4
  71. package/Models/Indexing/VoxelAOResultsIndex.js +15 -9
  72. package/Models/Indexing/VoxelFaceCullResultsIndex.d.ts +3 -3
  73. package/Models/Indexing/VoxelFaceCullResultsIndex.js +14 -9
  74. package/Models/Indexing/VoxelFaceTransparentResultsIndex.d.ts +1 -1
  75. package/Models/Indexing/VoxelFaceTransparentResultsIndex.js +1 -1
  76. package/Models/Rules/Functions/BuildFinalInputs.js +9 -7
  77. package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
  78. package/Models/Rules/Functions/BuildRules.js +4 -4
  79. package/Models/Rules/{VoxelModelManager.d.ts → VoxelModelRuleBuilderRegister.d.ts} +1 -1
  80. package/Models/Rules/VoxelModelRuleBuilderRegister.js +178 -0
  81. package/Models/VoxelModel.types.d.ts +14 -5
  82. package/Renderer/Classes/SectorMesh.d.ts +3 -4
  83. package/Renderer/Classes/SectorMesh.js +6 -11
  84. package/Renderer/InitTasks.js +6 -7
  85. package/Renderer/MeshManager.js +2 -2
  86. package/Renderer/MeshRegister.js +2 -1
  87. package/Settings/EngineSettings.d.ts +1 -1
  88. package/Settings/EngineSettings.js +3 -5
  89. package/Settings/EngineSettings.types.d.ts +17 -18
  90. package/Settings/EngineSettings.types.js +16 -15
  91. package/Tasks/IWG/IWG.d.ts +2 -1
  92. package/Tasks/IWG/IWG.js +9 -3
  93. package/Tasks/IWG/Internal/Classes/BuildQueue.d.ts +11 -0
  94. package/Tasks/IWG/Internal/Classes/BuildQueue.js +49 -0
  95. package/Tasks/IWG/Internal/Classes/Generator.d.ts +6 -1
  96. package/Tasks/IWG/Internal/Classes/Generator.js +14 -2
  97. package/Tasks/IWG/Internal/Classes/IWGTaskBase.js +2 -2
  98. package/Tasks/IWG/Internal/Functions/getSectorState.js +4 -7
  99. package/Tasks/IWG/Internal/Functions/runBuildUpdate.js +21 -2
  100. package/Tasks/IWG/Internal/Functions/runWorldUpdate.js +5 -6
  101. package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -4
  102. package/Tasks/IWG/Internal/IWGTasks.js +12 -31
  103. package/Tasks/IWG/Internal/IWGTools.d.ts +1 -1
  104. package/Tasks/IWG/Procedures/SaveAllSectors.js +2 -0
  105. package/Tasks/Propagation/Flow/FlowManager.d.ts +0 -2
  106. package/Tasks/Propagation/Flow/FlowManager.js +86 -87
  107. package/Tasks/Propagation/Flow/WorldFlow.js +2 -3
  108. package/Tasks/Propagation/Illumanation/WorldRGB.js +1 -2
  109. package/Tasks/Update/InitTasks.d.ts +2 -1
  110. package/Tasks/Update/InitTasks.js +6 -6
  111. package/Tasks/Update/UpdateTask.d.ts +3 -1
  112. package/Tasks/Update/UpdateTask.js +28 -2
  113. package/Tasks/Update/VoxelUpdate.js +21 -7
  114. package/Tasks/WorldGeneration/WorldGenBrush.js +2 -1
  115. package/Templates/Cursor/TemplateCursor.d.ts +2 -2
  116. package/Templates/Cursor/TemplateCursor.js +1 -2
  117. package/Templates/Functions/CreateTemplate.js +1 -1
  118. package/Templates/VoxelTemplate.js +6 -8
  119. package/Templates/VoxelTemplates.types.d.ts +1 -1
  120. package/Textures/Classes/CompiledTexture.d.ts +18 -0
  121. package/Textures/Classes/CompiledTexture.js +50 -0
  122. package/Textures/Classes/CompiledTextureAnimation.d.ts +12 -0
  123. package/Textures/Classes/CompiledTextureAnimation.js +27 -0
  124. package/Textures/Classes/TextureAnimationTexture.d.ts +10 -0
  125. package/Textures/Classes/TextureAnimationTexture.js +32 -0
  126. package/Textures/Functions/BuildTextureData.d.ts +10 -0
  127. package/Textures/Functions/BuildTextureData.js +205 -0
  128. package/Textures/Texture.types.d.ts +50 -64
  129. package/Textures/TextureManager.d.ts +8 -19
  130. package/Textures/TextureManager.js +28 -166
  131. package/Tools/Brush/Brush.d.ts +1 -3
  132. package/Tools/Brush/Brush.js +43 -12
  133. package/Util/Binary/BinaryArrays.d.ts +6 -0
  134. package/Util/Binary/BinaryArrays.js +25 -0
  135. package/Util/Binary/BinaryBuffer.d.ts +29 -0
  136. package/Util/Binary/BinaryBuffer.js +130 -0
  137. package/Util/Binary/BinaryFunctions.d.ts +3 -0
  138. package/Util/Binary/BinaryFunctions.js +11 -0
  139. package/Util/StringPalette.d.ts +1 -0
  140. package/Util/StringPalette.js +8 -0
  141. package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
  142. package/Voxels/Cursor/VoxelCursor.d.ts +6 -6
  143. package/Voxels/Cursor/VoxelCursor.interface.d.ts +11 -16
  144. package/Voxels/Cursor/VoxelCursor.interface.js +35 -58
  145. package/Voxels/Cursor/VoxelCursor.js +13 -12
  146. package/Voxels/Cursor/VoxelLightData.d.ts +3 -4
  147. package/Voxels/Cursor/VoxelLightData.js +8 -7
  148. package/Voxels/Data/VoxelPalettesRegister.d.ts +8 -0
  149. package/Voxels/Data/VoxelPalettesRegister.js +8 -0
  150. package/Voxels/Data/VoxelTag.types.d.ts +56 -0
  151. package/Voxels/Data/VoxelTag.types.js +23 -0
  152. package/Voxels/{State → Data}/VoxelTagStates.d.ts +2 -2
  153. package/Voxels/{State → Data}/VoxelTagStates.js +5 -5
  154. package/Voxels/Data/VoxelTagsRegister.d.ts +9 -0
  155. package/Voxels/Data/VoxelTagsRegister.js +32 -0
  156. package/Voxels/Functions/BuildStateData.js +12 -12
  157. package/Voxels/Functions/BuildTagAndPaletteData.d.ts +13 -0
  158. package/Voxels/Functions/BuildTagAndPaletteData.js +55 -0
  159. package/Voxels/Indexes/VoxelIndex.js +3 -3
  160. package/Voxels/InitVoxelData.js +31 -73
  161. package/Voxels/State/Schema/StateSchema.d.ts +1 -1
  162. package/Voxels/Types/Voxel.types.d.ts +20 -42
  163. package/Voxels/Types/Voxel.types.js +6 -17
  164. package/Voxels/Types/VoxelModelCompiledData.types.d.ts +11 -13
  165. package/Voxels/Types/VoxelSubstances.types.d.ts +2 -15
  166. package/Voxels/Types/VoxelSubstances.types.js +1 -9
  167. package/World/Archive/Archive.types.d.ts +38 -34
  168. package/World/Archive/Functions/ArchiveArea.js +18 -30
  169. package/World/Archive/Functions/ArchiveSector.js +484 -213
  170. package/World/Archive/Functions/ImportSector.d.ts +3 -3
  171. package/World/Archive/Functions/ImportSector.js +205 -151
  172. package/World/Archive/Functions/Shared.d.ts +6 -0
  173. package/World/Archive/Functions/Shared.js +75 -0
  174. package/World/Archive/InitTasks.js +30 -13
  175. package/World/Cursor/SectionCursor.d.ts +3 -2
  176. package/World/Cursor/SectionCursor.js +9 -4
  177. package/World/Cursor/SectorCursor.d.ts +3 -2
  178. package/World/Cursor/SectorCursor.js +5 -3
  179. package/World/Cursor/WorldCursor.d.ts +2 -2
  180. package/World/Cursor/WorldCursor.js +6 -3
  181. package/World/Cursor/WorldVoxelCursor.d.ts +7 -7
  182. package/World/Cursor/WorldVoxelCursor.js +21 -24
  183. package/World/InitTasks.d.ts +1 -1
  184. package/World/Lock/WorldLock.d.ts +1 -1
  185. package/World/Section/Section.d.ts +31 -23
  186. package/World/Section/Section.js +116 -18
  187. package/World/Section/SectionState.d.ts +10 -0
  188. package/World/Section/SectionState.js +11 -0
  189. package/World/Sector/Sector.d.ts +24 -9
  190. package/World/Sector/Sector.js +92 -21
  191. package/World/Sector/SectorHeightMap.js +3 -5
  192. package/World/Sector/SectorState.d.ts +21 -0
  193. package/World/Sector/SectorState.js +28 -0
  194. package/World/WorldRegister.d.ts +4 -0
  195. package/World/WorldRegister.js +15 -3
  196. package/World/WorldSpaces.d.ts +6 -0
  197. package/World/WorldSpaces.js +25 -6
  198. package/package.json +1 -1
  199. package/Data/Cursor/DataCursor.interface.d.ts +0 -5
  200. package/Data/Cursor/DataCursor.interface.js +0 -2
  201. package/Data/Register/MappedDataRegister.d.ts +0 -5
  202. package/Data/Register/MappedDataRegister.js +0 -9
  203. package/Data/Register/MappedRegisterBase.d.ts +0 -14
  204. package/Data/Register/MappedRegisterBase.js +0 -50
  205. package/Data/Structs/StructBuilder.d.ts +0 -34
  206. package/Data/Structs/StructBuilder.js +0 -157
  207. package/Data/Structs/StructBuilder.types.d.ts +0 -30
  208. package/Mesher/Functions/CompactMesh.d.ts +0 -2
  209. package/Mesher/Functions/CompactMesh.js +0 -42
  210. package/Mesher/Geomtry/Buffers.js +0 -81
  211. package/Mesher/Geomtry/GeometryNormals.d.ts +0 -10
  212. package/Mesher/Geomtry/GeometryNormals.js +0 -52
  213. package/Mesher/Geomtry/MeshData.types.d.ts +0 -13
  214. package/Mesher/Geomtry/MeshData.types.js +0 -6
  215. package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +0 -7
  216. package/Mesher/Geomtry/Tools/MesherDataTools.js +0 -12
  217. package/Mesher/Geomtry/Tools/index.d.ts +0 -1
  218. package/Mesher/Geomtry/Tools/index.js +0 -1
  219. package/Mesher/RenderedMaterials.d.ts +0 -6
  220. package/Models/Rules/VoxelModelManager.js +0 -82
  221. package/Textures/TextureAnimations.d.ts +0 -4
  222. package/Textures/TextureAnimations.js +0 -35
  223. package/Textures/TextureArray.d.ts +0 -47
  224. package/Textures/TextureArray.js +0 -202
  225. package/Textures/TextureBuilder.d.ts +0 -13
  226. package/Textures/TextureBuilder.js +0 -120
  227. package/Textures/TextureRegister.d.ts +0 -9
  228. package/Textures/TextureRegister.js +0 -28
  229. package/Tools/Data/SubstanceDataTool.d.ts +0 -13
  230. package/Tools/Data/SubstanceDataTool.js +0 -51
  231. package/Voxels/Palettes/MaterialPalette.d.ts +0 -9
  232. package/Voxels/Palettes/MaterialPalette.js +0 -11
  233. package/Voxels/Palettes/SubstancePalette.d.ts +0 -9
  234. package/Voxels/Palettes/SubstancePalette.js +0 -11
  235. package/Voxels/Palettes/VoxelPalette.d.ts +0 -11
  236. package/Voxels/Palettes/VoxelPalette.js +0 -15
  237. package/Voxels/Segments/MaterialDataGenerator.d.ts +0 -6
  238. package/Voxels/Segments/MaterialDataGenerator.js +0 -12
  239. package/Voxels/Segments/SubstanceDataGenerator.d.ts +0 -6
  240. package/Voxels/Segments/SubstanceDataGenerator.js +0 -35
  241. package/Voxels/Segments/VoxelDataGenerator.d.ts +0 -10
  242. package/Voxels/Segments/VoxelDataGenerator.js +0 -56
  243. package/Voxels/Structs/Builder/SubstanceStructBuilder.d.ts +0 -2
  244. package/Voxels/Structs/Builder/SubstanceStructBuilder.js +0 -42
  245. package/Voxels/Structs/Builder/VoxelStructBuilder.d.ts +0 -2
  246. package/Voxels/Structs/Builder/VoxelStructBuilder.js +0 -68
  247. package/Voxels/Structs/SubstanceStruct.d.ts +0 -17
  248. package/Voxels/Structs/SubstanceStruct.js +0 -17
  249. package/Voxels/Structs/VoxelStruct.d.ts +0 -27
  250. package/Voxels/Structs/VoxelStruct.js +0 -29
  251. package/World/Section/SectionHeightMap.d.ts +0 -10
  252. package/World/Section/SectionHeightMap.js +0 -39
  253. package/World/Section/SectionStruct.d.ts +0 -8
  254. package/World/Section/SectionStruct.js +0 -29
  255. package/World/Section/SectionStructProperties.d.ts +0 -10
  256. package/World/Section/SectionStructProperties.js +0 -11
  257. package/World/Sector/SectorStruct.d.ts +0 -1
  258. package/World/Sector/SectorStruct.js +0 -46
  259. package/World/Sector/SectorStructIds.d.ts +0 -13
  260. package/World/Sector/SectorStructIds.js +0 -14
  261. package/World/Structs/WorldDataStructProperties.d.ts +0 -8
  262. package/World/Structs/WorldDataStructProperties.js +0 -9
  263. /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
  264. /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
  265. /package/{Data/Functions → Util/Binary}/Palettes.d.ts +0 -0
  266. /package/{Data/Functions → Util/Binary}/Palettes.js +0 -0
  267. /package/{Data/Structs/StructBuilder.types.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
  268. /package/Voxels/{VoxelLevelReader.d.ts → Cursor/VoxelLevelReader.d.ts} +0 -0
  269. /package/Voxels/{VoxelLevelReader.js → Cursor/VoxelLevelReader.js} +0 -0
  270. /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
  271. /package/World/{Storage → Types}/WorldStorage.interface.js +0 -0
@@ -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 "../../../Data/Cursor/DataCursor.interface";
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 {
@@ -1,5 +1,22 @@
1
1
  import { TextureId } from "../../Textures/index";
2
2
  import { VoxelModelConstructorData } from "../../Models/VoxelModel.types";
3
+ import { VoxelTags } from "../Data/VoxelTag.types";
4
+ export interface VoxelDataArrays {
5
+ /**The runtime numeric voxel ids */
6
+ ids: Uint16Array;
7
+ /**The light data for voxels stored as 4 nibbles. 0 -> sun light 1 -> red light 2 -> green light 3 -> blue light */
8
+ light: Uint16Array;
9
+ /**The levels of the voxel. Used mainly for waterflow now. */
10
+ level: Uint8Array;
11
+ /**The state of the voxel. Used mainly be the voxel model system to get the model shape. */
12
+ state: Uint16Array;
13
+ /**The mod state of the voxel. Used mainly by the voxel model system to change model inputs. */
14
+ mod: Uint16Array;
15
+ /**The secondary state of the voxel. Can be set to a voxel id to make things like water logged voxels.
16
+ * But the main voxel itself must not use state or mod because the secondary voxel will use the same state and mod.
17
+ */
18
+ secondary: Uint16Array;
19
+ }
3
20
  export type VoxelNamedStateData = {
4
21
  id: string;
5
22
  name?: string;
@@ -19,11 +36,13 @@ export type VoxelNamedStateData = {
19
36
  };
20
37
  export declare class PaintVoxelData {
21
38
  id: string;
39
+ name: string;
22
40
  mod: number;
23
41
  state: number;
24
42
  level: number;
25
43
  levelState: number;
26
44
  secondaryVoxelId: string;
45
+ secondaryVoxeName: string;
27
46
  static Create(data: Partial<PaintVoxelData>): PaintVoxelData;
28
47
  private constructor();
29
48
  }
@@ -44,49 +63,8 @@ export type RawVoxelData = [
44
63
  /**The secondary id of the voxel */
45
64
  secondary: number
46
65
  ];
47
- export declare enum VoxelStructIds {
48
- substance = "dve_substance",
49
- renderedMaterial = "dve_rendered_material",
50
- voxelMaterial = "dve_voxel_material",
51
- hardness = "dve_hardness",
52
- colliderID = "dve_collider_id",
53
- checkCollisions = "dve_check_collisions",
54
- isLightSource = "dve_is_light_source",
55
- noAO = "dve_no_ao",
56
- isTransparent = "dve_is_transparent",
57
- lightValue = "dve_light_value",
58
- isRich = "dve_is_rich",
59
- canHaveSecondary = "dve_can_have_secondary"
60
- }
61
- interface VoxelProperties {
66
+ interface VoxelProperties extends Partial<VoxelTags> {
62
67
  [key: string]: any;
63
- /** The material used to render the voxel. Used by the engine to assign meshes to the proper material. */
64
- [VoxelStructIds.renderedMaterial]?: string;
65
- /** A description of the material used for the voxel. Not used by the engine directly. */
66
- [VoxelStructIds.voxelMaterial]?: string;
67
- /** Specifies the substance of the voxel.
68
- * The voxel will inherit properties from the substance and change how it acts in the world.
69
- * Properties include being solid or liquid.
70
- * */
71
- [VoxelStructIds.substance]?: string;
72
- /** Indicates whether the voxel is a light source. */
73
- [VoxelStructIds.isLightSource]?: boolean;
74
- /** Indicates if the voxel lets light through */
75
- [VoxelStructIds.isTransparent]?: boolean;
76
- /** Disables ambient occlusion for this voxel if set to true. */
77
- [VoxelStructIds.noAO]?: boolean;
78
- /** Defines the light value emitted by the voxel (r, g, z). */
79
- [VoxelStructIds.lightValue]?: [r: number, g: number, z: number];
80
- /** The collider ID for the voxel, used for collision detection. */
81
- [VoxelStructIds.colliderID]?: string;
82
- /** Specifies if the voxel participates in collision checks. */
83
- [VoxelStructIds.checkCollisions]?: boolean;
84
- /** Indicates if the voxel can have a secondary voxel. */
85
- [VoxelStructIds.canHaveSecondary]?: boolean;
86
- /** The hardness level of the voxel, affecting how it is broken or interacted with. */
87
- [VoxelStructIds.hardness]?: number;
88
- /** Marks the voxel as "rich" for specialized interactions or rendering. */
89
- [VoxelStructIds.isRich]?: boolean;
90
68
  /** Named states associated with the voxel. */
91
69
  dve_named_states?: VoxelNamedStateData[];
92
70
  /** Model data used to construct the voxel's appearance. */
@@ -1,34 +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
  }
20
- export var VoxelStructIds;
21
- (function (VoxelStructIds) {
22
- VoxelStructIds["substance"] = "dve_substance";
23
- VoxelStructIds["renderedMaterial"] = "dve_rendered_material";
24
- VoxelStructIds["voxelMaterial"] = "dve_voxel_material";
25
- VoxelStructIds["hardness"] = "dve_hardness";
26
- VoxelStructIds["colliderID"] = "dve_collider_id";
27
- VoxelStructIds["checkCollisions"] = "dve_check_collisions";
28
- VoxelStructIds["isLightSource"] = "dve_is_light_source";
29
- VoxelStructIds["noAO"] = "dve_no_ao";
30
- VoxelStructIds["isTransparent"] = "dve_is_transparent";
31
- VoxelStructIds["lightValue"] = "dve_light_value";
32
- VoxelStructIds["isRich"] = "dve_is_rich";
33
- VoxelStructIds["canHaveSecondary"] = "dve_can_have_secondary";
34
- })(VoxelStructIds || (VoxelStructIds = {}));
@@ -5,29 +5,26 @@ import { VoxelFaceTransparentResultsIndexData } from "../../Models/Indexing/Voxe
5
5
  import { VoxelModelStateSchemaData, StateLogicStatement } from "../State/State.types";
6
6
  import { VoxelGeometryData, VoxelGeometryNodes } from "../../Models/VoxelModel.types";
7
7
  import { VoxelEffectSyncData } from "../Effects/VoxelEffects.types";
8
- import { VoxelTagStatesData } from "../State/VoxelTagStates";
9
- import { BinaryStructData } from "@amodx/binary";
10
- export type CompiledVoxelData = {
11
- models: FinalCompiledVoxelModelData;
8
+ import { VoxelTagStatesData } from "../Data/VoxelTagStates";
9
+ import { VoxelSubstanceTags, VoxelTags } from "../Data/VoxelTag.types";
10
+ export type CompiledVoxelTagAndPaletteData = {
12
11
  data: {
13
- struct: BinaryStructData;
14
- index: Uint16Array;
12
+ tags: VoxelTags[];
15
13
  palette: string[];
16
- nameToIdMap: Record<string, string>;
17
- idToNameMap: Record<string, string>;
18
- stringMaps: Record<string, string[]>;
19
- objectMaps: Record<string, any[]>;
14
+ nameToIdMap: [string, string][];
15
+ idToNameMap: [string, string][];
20
16
  };
21
17
  substances: {
22
- struct: BinaryStructData;
18
+ tags: VoxelSubstanceTags[];
23
19
  palette: string[];
24
- stringMaps: Record<string, string[]>;
25
- objectMaps: Record<string, any[]>;
26
20
  };
27
21
  materials: {
28
22
  palette: string[];
29
23
  };
30
24
  };
25
+ export type CompiledVoxelData = {
26
+ models: FinalCompiledVoxelModelData;
27
+ } & CompiledVoxelTagAndPaletteData;
31
28
  export interface CompiledVoxelGeometryNodes {
32
29
  node: VoxelGeometryNodes;
33
30
  tranform: VoxelGeometryTransform;
@@ -77,6 +74,7 @@ export interface CompiledVoxelModelData {
77
74
  }
78
75
  export interface CompiledVoxelModelInputData {
79
76
  id: string;
77
+ materialId: string;
80
78
  modelId: string;
81
79
  transparentFaceIndex: VoxelFaceTransparentResultsIndexData;
82
80
  modSchema: VoxelModelStateSchemaData[];
@@ -1,19 +1,6 @@
1
- export declare enum SubstanceStructIds {
2
- parent = "dve_parent_substance",
3
- isSolid = "dve_is_solid",
4
- isTransparent = "dve_is_transparent",
5
- isLiquid = "dve_is_liquid",
6
- flowRate = "dve_flow_rate",
7
- isWindAffected = "dve_is_wind_affected"
8
- }
9
- export interface VoxelSubstanceDataProperties {
1
+ import { VoxelSubstanceTags } from "../Data/VoxelTag.types";
2
+ export interface VoxelSubstanceDataProperties extends Partial<VoxelSubstanceTags> {
10
3
  [key: string]: any;
11
- [SubstanceStructIds.parent]?: string;
12
- [SubstanceStructIds.isTransparent]?: boolean;
13
- [SubstanceStructIds.isSolid]?: boolean;
14
- [SubstanceStructIds.isLiquid]?: boolean;
15
- [SubstanceStructIds.flowRate]?: number;
16
- [SubstanceStructIds.isWindAffected]?: boolean;
17
4
  }
18
5
  export type VoxelSubstanceData = {
19
6
  id: string;
@@ -1,9 +1 @@
1
- export var SubstanceStructIds;
2
- (function (SubstanceStructIds) {
3
- SubstanceStructIds["parent"] = "dve_parent_substance";
4
- SubstanceStructIds["isSolid"] = "dve_is_solid";
5
- SubstanceStructIds["isTransparent"] = "dve_is_transparent";
6
- SubstanceStructIds["isLiquid"] = "dve_is_liquid";
7
- SubstanceStructIds["flowRate"] = "dve_flow_rate";
8
- SubstanceStructIds["isWindAffected"] = "dve_is_wind_affected";
9
- })(SubstanceStructIds || (SubstanceStructIds = {}));
1
+ export {};
@@ -1,45 +1,46 @@
1
1
  import { Vec3Array } from "@amodx/math";
2
2
  import { LocationData } from "../../Math";
3
+ import { BinaryBufferData } from "../../Util/Binary/BinaryBuffer";
4
+ export type ArchivedLightSegments = "sun" | "red" | "green" | "blue";
3
5
  /**
4
6
  * Interface for an archived sector.
5
7
  */
6
8
  export interface ArchivedSectorData {
7
- /** The version of vlox the data was stored in. */
9
+ /** A user provided version of the data. */
8
10
  version: string;
11
+ /** The version of vlox the data was stored in. */
12
+ vloxVersion: string;
9
13
  /** The location of the sector in the world. */
10
14
  location: LocationData;
11
- /** Record of the sector's state, storing dynamic or user-defined data. */
12
- sectorState: Record<string, any>;
15
+ /** Record of the sector's bit flags. */
16
+ flags: Record<string, boolean>;
17
+ /** Record of the sector's timestamps. */
18
+ timestamps: Record<string, number>;
13
19
  /** The palette data used within the sector. */
14
20
  palettes: ArchivedSectorPaletteData;
15
21
  /** Placeholder for future buffer data. */
16
22
  buffers: ArchivedSectorBuffersData;
17
- /** Keys associated with section states and other objects. */
18
- keys: ArchivedSectorKeysData;
23
+ duplicates: ArchivedSectorDuplicteData;
19
24
  /** Array of archived section data within the sector. */
20
- sections: ArchivedSectionData[];
25
+ sections: (ArchivedSectionData | string)[];
26
+ }
27
+ export interface ArchivedSectorDuplicteData {
28
+ sections?: Record<string, ArchivedSectionData>;
21
29
  }
22
30
  /**
23
31
  * Interface for the palettes of an archived sector.
24
32
  */
25
33
  export interface ArchivedSectorPaletteData {
26
34
  id: string[];
27
- secondaryId?: string[];
28
- level?: Uint8Array;
29
- stateMap: Record<number, any[]>;
30
- modMap: Record<number, any[]>;
35
+ secondaryId: string[];
31
36
  state: Uint16Array;
37
+ stateMap: Record<number, any[]>;
32
38
  mod: Uint16Array;
33
- light?: Uint16Array;
39
+ modMap: Record<number, any[]>;
40
+ level?: Uint8Array;
41
+ light: Partial<Record<ArchivedLightSegments, Uint8Array>>;
34
42
  secondaryState?: Uint16Array;
35
43
  }
36
- /**
37
- * Interface for the keys of an archived sector.
38
- */
39
- export interface ArchivedSectorKeysData {
40
- /** Array of strings that are the keys for the section state struct. */
41
- sectionState: string[];
42
- }
43
44
  /**
44
45
  * Placeholder interface for future buffer data in a sector.
45
46
  */
@@ -49,10 +50,10 @@ export interface ArchivedSectorBuffersData {
49
50
  * Interface for an archived section.
50
51
  */
51
52
  export interface ArchivedSectionData {
52
- /** Array representing the section's state, holding dynamic or user-defined data. */
53
- state: any[];
53
+ /** Record of the sections's bit flags. */
54
+ flags?: Record<string, boolean>;
54
55
  /** Palette data used within the section. */
55
- palettes: ArchivedSectionPaletteData;
56
+ palettes?: ArchivedSectionPaletteData;
56
57
  /** Buffer data for the section, holding voxel type identifiers, light data, state, and secondary state. */
57
58
  buffers: ArchivedSectionBuffers;
58
59
  }
@@ -61,7 +62,7 @@ export interface ArchivedSectionData {
61
62
  */
62
63
  export interface ArchivedSectionPaletteData {
63
64
  id?: Uint16Array;
64
- light?: Uint16Array;
65
+ light?: Partial<Record<ArchivedLightSegments, Uint8Array>>;
65
66
  level?: Uint8Array;
66
67
  secondaryId?: Uint16Array;
67
68
  state?: Uint16Array;
@@ -72,12 +73,15 @@ export interface ArchivedSectionPaletteData {
72
73
  * Interface representing the buffer data for a section.
73
74
  */
74
75
  export interface ArchivedSectionBuffers {
75
- id: Uint16Array | Uint8Array | number;
76
- light: Uint16Array | Uint8Array | number;
77
- level: Uint8Array | number;
78
- state: Uint16Array | Uint8Array | number;
79
- mod: Uint16Array | Uint8Array | number;
80
- secondary: Uint16Array | Uint8Array | number;
76
+ buried?: Uint8Array | number;
77
+ voxelMap?: Uint8Array | number;
78
+ dirtyMap?: Uint8Array | number;
79
+ id?: BinaryBufferData | number;
80
+ light?: Partial<Record<ArchivedLightSegments, BinaryBufferData | number>>;
81
+ level?: BinaryBufferData | number;
82
+ state?: BinaryBufferData | number;
83
+ mod?: BinaryBufferData | number;
84
+ secondary?: BinaryBufferData | number;
81
85
  }
82
86
  /**
83
87
  * Interface for an archived area.
@@ -133,14 +137,14 @@ export interface ArchivedAreaKeysData {
133
137
  */
134
138
  export interface ArchivedAreaSectorPaletteData {
135
139
  id: string[];
136
- light?: Uint16Array;
137
- level?: Uint8Array;
138
- state?: Uint16Array;
139
- mod?: Uint16Array;
140
+ light: Uint16Array;
141
+ level: Uint8Array;
142
+ state: Uint16Array;
143
+ mod: Uint16Array;
140
144
  stateMap: Record<number, any[]>;
141
145
  modMap: Record<number, any[]>;
142
- secondaryId?: string[];
143
- secondaryState?: Uint16Array;
146
+ secondaryId: string[];
147
+ secondaryState: Uint16Array;
144
148
  }
145
149
  /**
146
150
  * Interface representing the archived data for a sector within an area.
@@ -1,19 +1,5 @@
1
1
  import { BinaryObject } from "@amodx/binary";
2
- import { Sector } from "../../../World/index";
3
- const charset = "0123456789ABCDEF";
4
- function uint16To4CharString(value) {
5
- if (value < 0 || value > 0xffff) {
6
- throw new RangeError("Value must be a 16-bit unsigned integer.");
7
- }
8
- const chars = [];
9
- for (let i = 0; i < 4; i++) {
10
- const charCode = (value >> (i * 4)) & 0x0f;
11
- chars.unshift(charset[charCode]);
12
- }
13
- const result = chars.join("").replace(/^0+(?!$)/, "");
14
- return result;
15
- }
16
- let sectorStructInstance;
2
+ import { uint16To4CharString } from "./Shared";
17
3
  const processPalettes = (archiveData) => {
18
4
  const allRegistered = new Set();
19
5
  for (const sector of archiveData.sectors) {
@@ -107,7 +93,7 @@ const buildSectorState = (archiveData) => {
107
93
  const maped = new Map();
108
94
  const binaryObjects = new Map();
109
95
  let count = 0;
110
- const sectorStateKeys = sectorStructInstance.getKeys();
96
+ const sectorStateKeys = [];
111
97
  const created = new Map();
112
98
  const processSectorState = (sector, sectorStateMap) => {
113
99
  if (typeof sector.sectorState == "string")
@@ -227,8 +213,7 @@ function SectorToArchivedAreaSector(sector) {
227
213
  palettes.id = sector.palettes.id;
228
214
  if (sector.palettes.secondaryId)
229
215
  palettes.secondaryId = sector.palettes.secondaryId;
230
- if (sector.palettes.light)
231
- palettes.light = sector.palettes.light;
216
+ // if (sector.palettes.light) palettes.light = sector.palettes.light;
232
217
  if (sector.palettes.secondaryState)
233
218
  palettes.secondaryState = sector.palettes.secondaryState;
234
219
  if (sector.palettes.state)
@@ -239,16 +224,14 @@ function SectorToArchivedAreaSector(sector) {
239
224
  sector.palettes.modMap = sector.palettes.modMap;
240
225
  return {
241
226
  position: [sector.location[1], sector.location[2], sector.location[3]],
242
- sectorState: sector.sectorState,
227
+ sectorState: sector.flags,
243
228
  buffers: sector.buffers,
244
229
  palettes,
245
230
  sections: sector.sections,
246
231
  };
247
232
  }
248
233
  export default function CreateArchiveArea(archiveData) {
249
- if (!sectorStructInstance)
250
- sectorStructInstance = Sector.StateStruct.instantiate();
251
- const sectorStateKeys = sectorStructInstance.getKeys();
234
+ const sectorStateKeys = [];
252
235
  const sectors = [];
253
236
  for (const sector of archiveData.sectors) {
254
237
  sectors.push(SectorToArchivedAreaSector(sector));
@@ -258,7 +241,8 @@ export default function CreateArchiveArea(archiveData) {
258
241
  version: "",
259
242
  keys: {
260
243
  sectorState: sectorStateKeys,
261
- sectionState: archiveData.sectors[0].keys.sectionState,
244
+ sectionState: []
245
+ // sectionState: archiveData.sectors[0].keys.sectionState,
262
246
  },
263
247
  maps: {
264
248
  sectorState: buildSectorState(archiveData),
@@ -289,10 +273,11 @@ export function CreateSectorFromArea(area, sector) {
289
273
  id[i] = area.maps.id[i];
290
274
  }
291
275
  palettes.id = id;
292
- palettes.light =
276
+ /* palettes.light =
293
277
  typeof sector.palettes.light == "string"
294
- ? area.maps.lightPalette[sector.palettes.light]
295
- : sector.palettes.light;
278
+ ? area.maps.lightPalette[sector.palettes.light]
279
+ : sector.palettes.light;
280
+ */
296
281
  palettes.level =
297
282
  typeof sector.palettes.level == "string"
298
283
  ? area.maps.levelPalette[sector.palettes.level]
@@ -333,11 +318,14 @@ export function CreateSectorFromArea(area, sector) {
333
318
  }
334
319
  return {
335
320
  version: area.version,
321
+ vloxVersion: area.version,
336
322
  location: [area.dimension, ...sector.position],
337
- sectorState,
338
- keys: {
339
- sectionState: area.keys.sectionState,
340
- },
323
+ flags: sectorState,
324
+ timestamps: {},
325
+ /* keys: {
326
+ sectionState: area.keys.sectionState,
327
+ }, */
328
+ duplicates: {},
341
329
  palettes,
342
330
  buffers: sector.buffers,
343
331
  sections,