@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,42 +0,0 @@
1
- import { BinaryNumberTypes } from "@amodx/binary";
2
- import { SubstanceStructIds } from "../../Types/VoxelSubstances.types";
3
- import { StructBuilder } from "../../../Data/Structs/StructBuilder.js";
4
- export const SubstanceStructBuilder = new StructBuilder("substance-tag-manager", "substance");
5
- SubstanceStructBuilder.addNode([
6
- {
7
- id: SubstanceStructIds.parent,
8
- type: "string-map",
9
- allowedComms: ["constructor", "nexus", "fx", "world", "render"],
10
- },
11
- /* {
12
- id: SubstanceStructIds.culledSubstnaces,
13
- type: "object-map",
14
- allowedComms: ["constructor"],
15
- }, */
16
- {
17
- id: SubstanceStructIds.isTransparent,
18
- type: "boolean",
19
- default: false,
20
- },
21
- {
22
- id: SubstanceStructIds.isSolid,
23
- type: "boolean",
24
- default: false,
25
- },
26
- {
27
- id: SubstanceStructIds.isLiquid,
28
- type: "boolean",
29
- default: false,
30
- },
31
- {
32
- id: SubstanceStructIds.flowRate,
33
- type: "number",
34
- numberType: BinaryNumberTypes.Float32,
35
- default: 1,
36
- },
37
- {
38
- id: SubstanceStructIds.isWindAffected,
39
- type: "boolean",
40
- default: false,
41
- },
42
- ]);
@@ -1,2 +0,0 @@
1
- import { StructBuilder } from "../../../Data/Structs/StructBuilder.js";
2
- export declare const VoxelStructBuilder: StructBuilder;
@@ -1,68 +0,0 @@
1
- import { BinaryNumberTypes } from "@amodx/binary";
2
- import { VoxelStructIds } from "../../Types/Voxel.types";
3
- import { StructBuilder } from "../../../Data/Structs/StructBuilder.js";
4
- export const VoxelStructBuilder = new StructBuilder("voxel-tag-manager", "voxel");
5
- VoxelStructBuilder.addNode([
6
- {
7
- id: VoxelStructIds.substance,
8
- type: "string-map",
9
- allowedComms: ["constructor", "nexus", "fx", "world", "render"],
10
- },
11
- {
12
- id: VoxelStructIds.colliderID,
13
- type: "string-map",
14
- allowedComms: ["nexus"],
15
- },
16
- {
17
- id: VoxelStructIds.checkCollisions,
18
- type: "boolean",
19
- default: false,
20
- },
21
- {
22
- id: VoxelStructIds.renderedMaterial,
23
- type: "string-map",
24
- allowedComms: ["constructor", "nexus", "fx", "world", "render"],
25
- },
26
- {
27
- id: VoxelStructIds.voxelMaterial,
28
- type: "string-map",
29
- allowedComms: ["constructor", "nexus", "fx", "world", "render"],
30
- },
31
- {
32
- id: VoxelStructIds.isLightSource,
33
- type: "boolean",
34
- default: false,
35
- },
36
- {
37
- id: VoxelStructIds.noAO,
38
- type: "boolean",
39
- default: false,
40
- },
41
- {
42
- id: VoxelStructIds.lightValue,
43
- type: "number",
44
- numberType: BinaryNumberTypes.Uint16,
45
- default: 0,
46
- },
47
- {
48
- id: VoxelStructIds.isRich,
49
- type: "boolean",
50
- default: false,
51
- },
52
- {
53
- id: VoxelStructIds.isTransparent,
54
- type: "boolean",
55
- default: false,
56
- },
57
- {
58
- id: VoxelStructIds.canHaveSecondary,
59
- type: "boolean",
60
- default: false,
61
- },
62
- {
63
- id: VoxelStructIds.hardness,
64
- type: "number",
65
- numberType: BinaryNumberTypes.Uint32,
66
- default: 0,
67
- },
68
- ]);
@@ -1,17 +0,0 @@
1
- import { BinaryStructData, InstantiatedStruct } from "@amodx/binary/";
2
- import { SubstanceStructIds } from "../Types/VoxelSubstances.types.js";
3
- export interface SubstanceStruct {
4
- [key: string]: any;
5
- [SubstanceStructIds.parent]: number;
6
- [SubstanceStructIds.isSolid]: number;
7
- [SubstanceStructIds.isTransparent]: number;
8
- [SubstanceStructIds.isLiquid]: number;
9
- [SubstanceStructIds.flowRate]: number;
10
- [SubstanceStructIds.isWindAffected]: number;
11
- }
12
- export declare class SubstanceStruct extends InstantiatedStruct<SubstanceStruct> {
13
- static instance: SubstanceStruct;
14
- static init(data: BinaryStructData): void;
15
- static setSubstance(id: string | number): void;
16
- static initData: BinaryStructData;
17
- }
@@ -1,17 +0,0 @@
1
- import { RemoteBinaryStruct, InstantiatedStruct, } from "@amodx/binary/";
2
- import { SubstanceStructIds } from "../Types/VoxelSubstances.types.js";
3
- import { SubstancePalette } from "../Palettes/SubstancePalette.js";
4
- const remote = new RemoteBinaryStruct("voxel-data");
5
- export class SubstanceStruct extends InstantiatedStruct {
6
- static instance;
7
- static init(data) {
8
- remote.init(data);
9
- const instance = remote.instantiate();
10
- this.initData = data;
11
- SubstanceStruct.instance = instance;
12
- }
13
- static setSubstance(id) {
14
- this.instance.setIndex(typeof id == "string" ? SubstancePalette.id.numberFromString(id) : id);
15
- }
16
- static initData;
17
- }
@@ -1,27 +0,0 @@
1
- import { BinaryStructData, InstantiatedStruct } from "@amodx/binary/";
2
- import { VoxelStructIds } from "../Types/Voxel.types";
3
- export interface VoxelStruct {
4
- [key: string]: any;
5
- [VoxelStructIds.substance]: number;
6
- [VoxelStructIds.renderedMaterial]: number;
7
- [VoxelStructIds.voxelMaterial]: number;
8
- [VoxelStructIds.hardness]: number;
9
- [VoxelStructIds.colliderID]: number;
10
- [VoxelStructIds.checkCollisions]: number;
11
- [VoxelStructIds.isLightSource]: number;
12
- [VoxelStructIds.noAO]: number;
13
- [VoxelStructIds.lightValue]: number;
14
- [VoxelStructIds.isRich]: number;
15
- [VoxelStructIds.canHaveSecondary]: number;
16
- [VoxelStructIds.isTransparent]: number;
17
- }
18
- export declare class VoxelStruct extends InstantiatedStruct<VoxelStruct> {
19
- static instance: VoxelStruct;
20
- static init(data: BinaryStructData): void;
21
- static clone(): InstantiatedStruct<VoxelStruct> & VoxelStruct;
22
- static sync(voxelMap: Uint16Array): void;
23
- static setVoxel(id: number): void;
24
- static setStringVoxel(id: string): void;
25
- static voxelIndex: Uint16Array;
26
- static initData: BinaryStructData;
27
- }
@@ -1,29 +0,0 @@
1
- import { RemoteBinaryStruct, InstantiatedStruct, } from "@amodx/binary/";
2
- import { VoxelStructIds } from "../Types/Voxel.types";
3
- import { VoxelPalette } from "../Palettes/VoxelPalette";
4
- const remote = new RemoteBinaryStruct("voxel-data");
5
- export class VoxelStruct extends InstantiatedStruct {
6
- static instance;
7
- static init(data) {
8
- remote.init(data);
9
- const instance = remote.instantiate();
10
- this.initData = data;
11
- VoxelStruct.instance = instance;
12
- }
13
- static clone() {
14
- return this.instance.createClone();
15
- }
16
- static sync(voxelMap) {
17
- this.voxelIndex = voxelMap;
18
- }
19
- static setVoxel(id) {
20
- const index = this.voxelIndex[id];
21
- this.instance.setIndex(index);
22
- }
23
- static setStringVoxel(id) {
24
- const index = this.voxelIndex[VoxelPalette.ids.getNumberId(id)];
25
- this.instance.setIndex(index);
26
- }
27
- static voxelIndex = new Uint16Array();
28
- static initData;
29
- }
@@ -1,10 +0,0 @@
1
- import { Section } from "./Section";
2
- export declare class SectionHeightMap {
3
- private static _sectionState;
4
- static setSection(section: Section): typeof SectionHeightMap;
5
- static setVoxel(y: number, hasVoxel: boolean): void;
6
- static getVoxel(y: number): boolean;
7
- static setDirty(y: number, dirty: boolean): void;
8
- static getDirty(y: number): boolean;
9
- static getMinMax(): number[];
10
- }
@@ -1,39 +0,0 @@
1
- import { WorldSpaces } from "../WorldSpaces";
2
- import { Section } from "./Section";
3
- import { SectionStructProperties } from "./SectionStructProperties";
4
- export class SectionHeightMap {
5
- static _sectionState;
6
- static setSection(section) {
7
- if (!this._sectionState)
8
- this._sectionState = Section.StateStruct.instantiate();
9
- this._sectionState.setData(section.sectionState);
10
- return this;
11
- }
12
- static setVoxel(y, hasVoxel) {
13
- this._sectionState[SectionStructProperties.heightMap][y] = hasVoxel ? 1 : 0;
14
- }
15
- static getVoxel(y) {
16
- return this._sectionState[SectionStructProperties.heightMap][y] == 1;
17
- }
18
- static setDirty(y, dirty) {
19
- this._sectionState[SectionStructProperties.dirtyMap][y] = dirty ? 1 : 0;
20
- }
21
- static getDirty(y) {
22
- return this._sectionState[SectionStructProperties.dirtyMap][y] == 1;
23
- }
24
- static getMinMax() {
25
- let min = Infinity;
26
- let max = -Infinity;
27
- let i = WorldSpaces.section.bounds.y;
28
- while (i--) {
29
- if (this._sectionState[SectionStructProperties.heightMap][i] ||
30
- this._sectionState[SectionStructProperties.dirtyMap][i]) {
31
- if (i < min)
32
- min = i;
33
- if (i > max)
34
- max = i;
35
- }
36
- }
37
- return [min, max];
38
- }
39
- }
@@ -1,8 +0,0 @@
1
- import { SectionStructProperties } from "./SectionStructProperties.js";
2
- export interface SectionStruct {
3
- [SectionStructProperties.minHeight]: number;
4
- [SectionStructProperties.maxHeight]: number;
5
- [SectionStructProperties.heightMap]: number[];
6
- [SectionStructProperties.dirtyMap]: number[];
7
- }
8
- export declare function InitalizeSectionTags(): void;
@@ -1,29 +0,0 @@
1
- import { BinaryNumberTypes, BinaryStruct } from "@amodx/binary/";
2
- import { WorldSpaces } from "../WorldSpaces.js";
3
- import { SectionStructProperties } from "./SectionStructProperties.js";
4
- import { Section } from "./Section.js";
5
- const SectionStateStruct = new BinaryStruct("section-tags");
6
- SectionStateStruct.registerProperty({
7
- id: SectionStructProperties.minHeight,
8
- type: "typed-number",
9
- numberType: BinaryNumberTypes.Uint8,
10
- }, {
11
- id: SectionStructProperties.maxHeight,
12
- type: "typed-number",
13
- numberType: BinaryNumberTypes.Uint8,
14
- });
15
- export function InitalizeSectionTags() {
16
- SectionStateStruct.registerProperty({
17
- id: SectionStructProperties.heightMap,
18
- type: "bit-array",
19
- length: WorldSpaces.section.bounds.y,
20
- }, {
21
- id: SectionStructProperties.dirtyMap,
22
- type: "bit-array",
23
- length: WorldSpaces.section.bounds.y,
24
- });
25
- const initData = SectionStateStruct.init({
26
- indexBufferMode: "shared",
27
- });
28
- Section.StateStruct.init(initData);
29
- }
@@ -1,10 +0,0 @@
1
- export declare enum SectionStructProperties {
2
- minHeight = "dve_min_height",
3
- maxHeight = "dve_max_height",
4
- heightMap = "dve_height_map",
5
- dirtyMap = "dve_dirty_map",
6
- voxelIDSegment = "dve_voxel_id",
7
- voxelLightSegment = "dve_voxel_light",
8
- voxelStateSegment = "dve_voxel_state",
9
- voxelSecondaryIDSegment = "dve_voxel_secondary_id"
10
- }
@@ -1,11 +0,0 @@
1
- export var SectionStructProperties;
2
- (function (SectionStructProperties) {
3
- SectionStructProperties["minHeight"] = "dve_min_height";
4
- SectionStructProperties["maxHeight"] = "dve_max_height";
5
- SectionStructProperties["heightMap"] = "dve_height_map";
6
- SectionStructProperties["dirtyMap"] = "dve_dirty_map";
7
- SectionStructProperties["voxelIDSegment"] = "dve_voxel_id";
8
- SectionStructProperties["voxelLightSegment"] = "dve_voxel_light";
9
- SectionStructProperties["voxelStateSegment"] = "dve_voxel_state";
10
- SectionStructProperties["voxelSecondaryIDSegment"] = "dve_voxel_secondary_id";
11
- })(SectionStructProperties || (SectionStructProperties = {}));
@@ -1 +0,0 @@
1
- export declare function InitalizeSectorTags(): void;
@@ -1,46 +0,0 @@
1
- import { BinaryNumberTypes, BinaryStruct } from "@amodx/binary/";
2
- import { Sector } from "./Sector.js";
3
- import { SectorStateStructIds } from "./SectorStructIds.js";
4
- const SectorStateStruct = new BinaryStruct("sector-tags");
5
- SectorStateStruct.registerProperty({
6
- id: SectorStateStructIds.lastSaveTimestamp,
7
- type: "typed-number",
8
- numberType: BinaryNumberTypes.Uint32,
9
- }, {
10
- id: SectorStateStructIds.lastAnalyzerUpdateTimestamp,
11
- type: "typed-number",
12
- numberType: BinaryNumberTypes.Uint32,
13
- }, {
14
- id: SectorStateStructIds.hasRichData,
15
- type: "boolean",
16
- }, {
17
- id: SectorStateStructIds.hasEntityData,
18
- type: "boolean",
19
- }, {
20
- id: SectorStateStructIds.isStored,
21
- type: "boolean",
22
- }, {
23
- id: SectorStateStructIds.isWorldGenDone,
24
- type: "boolean",
25
- }, {
26
- id: SectorStateStructIds.isWorldDecorDone,
27
- type: "boolean",
28
- }, {
29
- id: SectorStateStructIds.isWorldSunDone,
30
- type: "boolean",
31
- }, {
32
- id: SectorStateStructIds.isWorldPropagationDone,
33
- type: "boolean",
34
- }, {
35
- id: SectorStateStructIds.isDirty,
36
- type: "boolean",
37
- }, {
38
- id: SectorStateStructIds.persistent,
39
- type: "boolean",
40
- });
41
- export function InitalizeSectorTags() {
42
- const initData = SectorStateStruct.init({
43
- indexBufferMode: "shared",
44
- });
45
- Sector.StateStruct.init(initData);
46
- }
@@ -1,13 +0,0 @@
1
- export declare enum SectorStateStructIds {
2
- lastSaveTimestamp = "dve_last_save_timestamp",
3
- lastAnalyzerUpdateTimestamp = "dve_last_analyzer_update_timestamp",
4
- hasRichData = "dve_has_rich_data",
5
- hasEntityData = "dve_has_entity_data",
6
- isStored = "dve_is_stored",
7
- isWorldGenDone = "dve_is_world_gen_done",
8
- isWorldDecorDone = "dve_is_world_decor_done",
9
- isWorldSunDone = "dve_is_world_sun_done",
10
- isWorldPropagationDone = "dve_is_world_propagation_done",
11
- isDirty = "dve_is_dirty",
12
- persistent = "dve_persistent"
13
- }
@@ -1,14 +0,0 @@
1
- export var SectorStateStructIds;
2
- (function (SectorStateStructIds) {
3
- SectorStateStructIds["lastSaveTimestamp"] = "dve_last_save_timestamp";
4
- SectorStateStructIds["lastAnalyzerUpdateTimestamp"] = "dve_last_analyzer_update_timestamp";
5
- SectorStateStructIds["hasRichData"] = "dve_has_rich_data";
6
- SectorStateStructIds["hasEntityData"] = "dve_has_entity_data";
7
- SectorStateStructIds["isStored"] = "dve_is_stored";
8
- SectorStateStructIds["isWorldGenDone"] = "dve_is_world_gen_done";
9
- SectorStateStructIds["isWorldDecorDone"] = "dve_is_world_decor_done";
10
- SectorStateStructIds["isWorldSunDone"] = "dve_is_world_sun_done";
11
- SectorStateStructIds["isWorldPropagationDone"] = "dve_is_world_propagation_done";
12
- SectorStateStructIds["isDirty"] = "dve_is_dirty";
13
- SectorStateStructIds["persistent"] = "dve_persistent";
14
- })(SectorStateStructIds || (SectorStateStructIds = {}));
@@ -1,8 +0,0 @@
1
- export declare enum WorldDataStructProperties {
2
- header = "dve_header",
3
- dataType = "dve_data_type",
4
- dimensionId = "dve_dimension_id",
5
- positionX = "dve_p_x",
6
- positionY = "dve_p_y",
7
- positionZ = "dve_p_z"
8
- }
@@ -1,9 +0,0 @@
1
- export var WorldDataStructProperties;
2
- (function (WorldDataStructProperties) {
3
- WorldDataStructProperties["header"] = "dve_header";
4
- WorldDataStructProperties["dataType"] = "dve_data_type";
5
- WorldDataStructProperties["dimensionId"] = "dve_dimension_id";
6
- WorldDataStructProperties["positionX"] = "dve_p_x";
7
- WorldDataStructProperties["positionY"] = "dve_p_y";
8
- WorldDataStructProperties["positionZ"] = "dve_p_z";
9
- })(WorldDataStructProperties || (WorldDataStructProperties = {}));
File without changes
File without changes