@divinevoxel/vlox 0.0.72 → 0.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) 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 +2 -1
  4. package/Contexts/World/DivineVoxelEngineWorld.d.ts +2 -1
  5. package/Init/StartConstructor.js +8 -4
  6. package/Init/StartWorld.d.ts +1 -1
  7. package/Math/index.d.ts +5 -1
  8. package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
  9. package/Mesher/Functions/CompactVoxelMesh.js +1 -1
  10. package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
  11. package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
  12. package/Mesher/Functions/MeshSection.d.ts +1 -1
  13. package/Mesher/Functions/MeshSection.js +27 -22
  14. package/Mesher/Functions/MeshTexture.d.ts +1 -1
  15. package/Mesher/Functions/MeshTexture.js +3 -4
  16. package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
  17. package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
  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 +120 -199
  22. package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
  23. package/Mesher/Geomtry/VoxelMesh.js +4 -4
  24. package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +16 -0
  25. package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +51 -0
  26. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
  27. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
  28. package/Mesher/Geomtry/{Buffers.js → VoxelMeshBuffers.js} +2 -2
  29. package/Mesher/Geomtry/index.d.ts +0 -1
  30. package/Mesher/Geomtry/index.js +0 -1
  31. package/Mesher/InitMesher.js +1 -1
  32. package/Mesher/InitTask.js +9 -23
  33. package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
  34. package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
  35. package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
  36. package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -2
  37. package/Mesher/Models/Common/Calc/FaceDataCalc.js +37 -30
  38. package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
  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.js +18 -24
  42. package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -2
  43. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +1 -0
  44. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +40 -31
  45. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
  46. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
  47. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
  48. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.d.ts +1 -1
  49. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.js +1 -1
  50. package/Mesher/Models/RenderedMaterials.d.ts +6 -0
  51. package/Mesher/{RenderedMaterials.js → Models/RenderedMaterials.js} +2 -2
  52. package/Mesher/Models/VoxelConstructor.d.ts +6 -6
  53. package/Mesher/Models/VoxelConstructor.js +8 -8
  54. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +3 -5
  55. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -32
  56. package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +4 -5
  57. package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +5 -8
  58. package/Mesher/Types/Mesher.types.d.ts +1 -0
  59. package/Models/Defaults/CubeVoxelGeometry.js +4 -0
  60. package/Models/Defaults/CubeVoxelModels.js +360 -383
  61. package/Models/Defaults/LiquidVoxelModel.js +5 -5
  62. package/Models/Defaults/PanelVoxelModels.js +442 -468
  63. package/Models/Defaults/StairVoxelModel.js +582 -597
  64. package/Models/Examples.js +490 -498
  65. package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
  66. package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
  67. package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
  68. package/Models/Rules/Functions/BuildFinalInputs.js +21 -19
  69. package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
  70. package/Models/Rules/Functions/BuildRules.js +2 -2
  71. package/Models/Rules/{VoxelModelManager.d.ts → VoxelModelRuleBuilderRegister.d.ts} +1 -1
  72. package/Models/Rules/VoxelModelRuleBuilderRegister.js +178 -0
  73. package/Models/VoxelModel.types.d.ts +17 -8
  74. package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
  75. package/Renderer/Classes/SectorMesh.d.ts +3 -4
  76. package/Renderer/Classes/SectorMesh.js +6 -11
  77. package/Renderer/InitTasks.js +1 -10
  78. package/Renderer/MeshManager.d.ts +1 -1
  79. package/Renderer/MeshManager.js +26 -25
  80. package/Renderer/MeshRegister.d.ts +5 -5
  81. package/Renderer/MeshRegister.js +4 -3
  82. package/Settings/EngineSettings.d.ts +2 -1
  83. package/Settings/EngineSettings.js +6 -5
  84. package/Settings/EngineSettings.types.d.ts +24 -39
  85. package/Settings/EngineSettings.types.js +22 -29
  86. package/Tasks/Logic/InitTasks.d.ts +1 -0
  87. package/Tasks/Logic/InitTasks.js +10 -0
  88. package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
  89. package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
  90. package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
  91. package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
  92. package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
  93. package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
  94. package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
  95. package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
  96. package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
  97. package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
  98. package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
  99. package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
  100. package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
  101. package/Tasks/Propagation/InitTasks.js +4 -4
  102. package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
  103. package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
  104. package/Tasks/Tasks.types.d.ts +2 -2
  105. package/Tasks/TasksIds.d.ts +2 -1
  106. package/Tasks/TasksIds.js +1 -0
  107. package/Tasks/Update/Common.d.ts +3 -0
  108. package/Tasks/Update/Common.js +41 -0
  109. package/Tasks/Update/EreaseUpdate.d.ts +3 -0
  110. package/Tasks/Update/EreaseUpdate.js +66 -0
  111. package/Tasks/Update/InitTasks.d.ts +2 -2
  112. package/Tasks/Update/InitTasks.js +3 -1
  113. package/Tasks/Update/PaintUpdate.d.ts +3 -0
  114. package/Tasks/Update/PaintUpdate.js +89 -0
  115. package/Tasks/Update/VoxelUpdate.d.ts +2 -5
  116. package/Tasks/Update/VoxelUpdate.js +7 -143
  117. package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +16 -6
  118. package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +44 -5
  119. package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
  120. package/Tasks/WorldGeneration/WorldGenBrush.js +3 -3
  121. package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
  122. package/Templates/Cursor/TemplateCursor.d.ts +2 -2
  123. package/Templates/Cursor/TemplateCursor.js +1 -2
  124. package/Templates/Functions/CreateTemplate.d.ts +1 -1
  125. package/Templates/VoxelTemplates.types.d.ts +1 -1
  126. package/Textures/Classes/CompiledTexture.d.ts +18 -0
  127. package/Textures/Classes/CompiledTexture.js +50 -0
  128. package/Textures/Classes/CompiledTextureAnimation.d.ts +12 -0
  129. package/Textures/Classes/CompiledTextureAnimation.js +27 -0
  130. package/Textures/Classes/TextureAnimationTexture.d.ts +10 -0
  131. package/Textures/Classes/TextureAnimationTexture.js +32 -0
  132. package/Textures/Functions/BuildTextureData.d.ts +10 -0
  133. package/Textures/Functions/BuildTextureData.js +205 -0
  134. package/Textures/Texture.types.d.ts +50 -64
  135. package/Textures/TextureManager.d.ts +8 -19
  136. package/Textures/TextureManager.js +28 -166
  137. package/Tools/Brush/AdvancedBrushTool.js +1 -1
  138. package/Tools/Brush/Brush.d.ts +3 -3
  139. package/Tools/Brush/Brush.js +40 -8
  140. package/Tools/Tasks/TasksTool.d.ts +1 -0
  141. package/Tools/Tasks/TasksTool.js +2 -0
  142. package/Util/Binary/BinaryArrays.d.ts +6 -0
  143. package/Util/Binary/BinaryArrays.js +25 -0
  144. package/Util/Binary/BinaryBuffer.d.ts +35 -0
  145. package/Util/Binary/BinaryBuffer.js +136 -0
  146. package/Util/Binary/{BitArray.d.ts → BinaryFunctions.d.ts} +1 -2
  147. package/Util/Binary/BinaryFunctions.js +11 -0
  148. package/{Mesher/Tools/VoxelMeshBVHBuilder.d.ts → Util/Binary/BinaryTree.d.ts} +1 -33
  149. package/Util/Binary/BinaryTree.js +104 -0
  150. package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
  151. package/Voxels/Cursor/VoxelCursor.interface.d.ts +8 -3
  152. package/Voxels/Cursor/VoxelCursor.interface.js +54 -13
  153. package/Voxels/Cursor/VoxelLightData.js +1 -1
  154. package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -5
  155. package/Voxels/Data/VoxelPalettesRegister.js +0 -9
  156. package/Voxels/Data/VoxelTag.types.d.ts +17 -2
  157. package/Voxels/Data/VoxelTag.types.js +6 -1
  158. package/Voxels/Data/VoxelTagsRegister.js +12 -7
  159. package/Voxels/Functions/BuildStateData.d.ts +6 -6
  160. package/Voxels/Functions/BuildStateData.js +37 -37
  161. package/Voxels/Functions/BuildTagAndPaletteData.js +6 -3
  162. package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
  163. package/Voxels/Indexes/VoxelIndex.js +16 -18
  164. package/Voxels/InitVoxelData.js +24 -21
  165. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
  166. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
  167. package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
  168. package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
  169. package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
  170. package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
  171. package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
  172. package/Voxels/Logic/VoxelLogic.types.js +1 -0
  173. package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
  174. package/Voxels/Logic/VoxelLogicRegister.js +15 -0
  175. package/Voxels/State/Schema/StateSchema.d.ts +1 -1
  176. package/Voxels/State/SchemaRegister.js +10 -5
  177. package/Voxels/State/State.types.d.ts +1 -1
  178. package/Voxels/State/StateTreeReader.d.ts +1 -1
  179. package/Voxels/State/StateTreeReader.js +2 -3
  180. package/Voxels/Types/Voxel.types.d.ts +21 -0
  181. package/Voxels/Types/Voxel.types.js +6 -2
  182. package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
  183. package/World/Archive/Archive.types.d.ts +65 -42
  184. package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
  185. package/World/Archive/Classes/ArchiveClasses.js +78 -0
  186. package/World/Archive/Classes/ImportedSection.d.ts +40 -0
  187. package/World/Archive/Classes/ImportedSection.js +307 -0
  188. package/World/Archive/Classes/ImportedSector.d.ts +23 -0
  189. package/World/Archive/Classes/ImportedSector.js +97 -0
  190. package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
  191. package/World/Archive/Functions/ArchiveArea.js +49 -54
  192. package/World/Archive/Functions/ArchiveSector.js +373 -282
  193. package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
  194. package/World/Archive/Functions/CreateArchivedSection.js +207 -0
  195. package/World/Archive/Functions/ImportSector.d.ts +2 -4
  196. package/World/Archive/Functions/ImportSector.js +50 -220
  197. package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
  198. package/World/Archive/Functions/RemoveDuplicates.js +92 -0
  199. package/World/Archive/Functions/Shared.d.ts +6 -0
  200. package/World/Archive/Functions/Shared.js +50 -0
  201. package/World/Archive/InitTasks.js +37 -23
  202. package/World/Cursor/SectionCursor.d.ts +3 -3
  203. package/World/Cursor/SectionCursor.js +2 -3
  204. package/World/Cursor/SectorCursor.d.ts +3 -3
  205. package/World/Cursor/SectorCursor.js +1 -2
  206. package/World/Cursor/WorldCursor.d.ts +6 -5
  207. package/World/Cursor/WorldCursor.js +17 -15
  208. package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
  209. package/World/Cursor/WorldVoxelCursor.js +24 -14
  210. package/World/Dimension/Dimension.d.ts +4 -1
  211. package/World/Dimension/Dimension.js +8 -1
  212. package/World/InitTasks.d.ts +1 -1
  213. package/World/Lock/WorldLock.d.ts +1 -1
  214. package/World/Section/Section.d.ts +27 -18
  215. package/World/Section/Section.js +125 -21
  216. package/World/Section/SectionState.d.ts +12 -0
  217. package/World/Section/SectionState.js +13 -0
  218. package/World/Sector/Sector.d.ts +20 -6
  219. package/World/Sector/Sector.js +100 -17
  220. package/World/Sector/SectorHeightMap.js +2 -2
  221. package/World/Sector/SectorState.d.ts +16 -7
  222. package/World/Sector/SectorState.js +29 -15
  223. package/World/Types/WorldData.types.d.ts +2 -7
  224. package/World/Types/WorldStorage.interface.js +1 -0
  225. package/World/WorldRegister.d.ts +13 -9
  226. package/World/WorldRegister.js +24 -9
  227. package/World/WorldSpaces.d.ts +4 -0
  228. package/World/WorldSpaces.js +25 -12
  229. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
  230. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +10 -3
  231. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +19 -3
  232. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
  233. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
  234. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
  235. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
  236. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
  237. package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
  238. package/WorldSimulation/Internal/Classes/TickQueue.js +58 -0
  239. package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
  240. package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +8 -8
  241. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
  242. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
  243. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
  244. package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
  245. package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +38 -9
  246. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
  247. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
  248. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
  249. package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
  250. package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
  251. package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
  252. package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -24
  253. package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
  254. package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
  255. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
  256. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
  257. package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +7 -5
  258. package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +6 -5
  259. package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +29 -23
  260. package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
  261. package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
  262. package/package.json +1 -1
  263. package/Mesher/Functions/CompactMesh.d.ts +0 -2
  264. package/Mesher/Functions/CompactMesh.js +0 -42
  265. package/Mesher/Geomtry/GeometryNormals.d.ts +0 -10
  266. package/Mesher/Geomtry/GeometryNormals.js +0 -52
  267. package/Mesher/Geomtry/MeshData.types.d.ts +0 -13
  268. package/Mesher/Geomtry/MeshData.types.js +0 -6
  269. package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +0 -7
  270. package/Mesher/Geomtry/Tools/MesherDataTools.js +0 -12
  271. package/Mesher/Geomtry/Tools/index.d.ts +0 -1
  272. package/Mesher/Geomtry/Tools/index.js +0 -1
  273. package/Mesher/RenderedMaterials.d.ts +0 -6
  274. package/Mesher/Tools/VoxelMeshBVHBuilder.js +0 -216
  275. package/Models/Rules/VoxelModelManager.js +0 -82
  276. package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
  277. package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
  278. package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
  279. package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -34
  280. package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
  281. package/Textures/TextureAnimations.d.ts +0 -4
  282. package/Textures/TextureAnimations.js +0 -35
  283. package/Textures/TextureArray.d.ts +0 -47
  284. package/Textures/TextureArray.js +0 -202
  285. package/Textures/TextureBuilder.d.ts +0 -13
  286. package/Textures/TextureBuilder.js +0 -120
  287. package/Textures/TextureRegister.d.ts +0 -9
  288. package/Textures/TextureRegister.js +0 -28
  289. package/Tools/DataCursor.interface.d.ts +0 -5
  290. package/Tools/DataCursor.interface.js +0 -2
  291. package/Util/Binary/BitArray.js +0 -16
  292. package/World/Structs/WorldDataStructProperties.d.ts +0 -8
  293. package/World/Structs/WorldDataStructProperties.js +0 -9
  294. /package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +0 -0
  295. /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
  296. /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
  297. /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
  298. /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
  299. /package/{World/Storage/WorldStorage.interface.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
  300. /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
  301. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
  302. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
  303. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
  304. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
  305. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
  306. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
  307. /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
@@ -4,13 +4,14 @@ import { getInterpolationValue, shouldCauseFlip, } from "../../Common/Calc/CalcC
4
4
  import { VoxelRelativeCubeIndexPositionMap } from "../../../../Models/Indexing/VoxelRelativeCubeIndex";
5
5
  import { GetBoxGeometryNodeData } from "../../Common/BoxGeometryNode";
6
6
  import { VoxelLightData } from "../../../../Voxels/Cursor/VoxelLightData";
7
- import { VoxelGeometryBuilder } from "../../../Geomtry/VoxelGeometryBuilder";
7
+ import { addVoxelQuad, } from "../../../Geomtry/VoxelGeometryBuilder";
8
8
  import { VoxelModelConstructorRegister } from "../../../Models/VoxelModelConstructorRegister";
9
9
  const ArgIndexes = BoxVoxelGometryInputs.ArgIndexes;
10
10
  export class BoxVoxelGometryNode extends GeoemtryNode {
11
11
  quads;
12
12
  quadBounds = [];
13
13
  vertexWeights;
14
+ _wasAOShaded = false;
14
15
  lightData = new VoxelLightData();
15
16
  init() {
16
17
  this.faceCount = 6;
@@ -25,15 +26,15 @@ export class BoxVoxelGometryNode extends GeoemtryNode {
25
26
  const faceIndexes = this.geomtry.faceCullMap[trueFaceIndex];
26
27
  if (!faceIndexes)
27
28
  return true;
28
- const tool = this.builder;
29
+ const builder = this.builder;
29
30
  for (let positionIndex = 0; positionIndex < faceIndexes.length; positionIndex++) {
30
31
  const currentIndex = faceIndexes[positionIndex];
31
32
  const p = VoxelRelativeCubeIndexPositionMap[currentIndex];
32
- const hashed = this.builder.space.getHash(tool.nVoxel, tool.position.x + p[0], tool.position.y + p[1], tool.position.z + p[2]);
33
+ const hashed = this.builder.space.getHash(builder.nVoxel, builder.position.x + p[0], builder.position.y + p[1], builder.position.z + p[2]);
33
34
  if (this.builder.space.foundHash[hashed] < 2)
34
35
  continue;
36
+ const constructor = this.builder.space.getConstructor(hashed);
35
37
  const offsetBaseGometry = this.builder.space.getGeomtry(hashed);
36
- const offsetConditonalGeometry = this.builder.space.getConditionalGeomtry(hashed);
37
38
  if (offsetBaseGometry) {
38
39
  for (let i = 0; i < offsetBaseGometry.length; i++) {
39
40
  const geoId = offsetBaseGometry[i];
@@ -41,27 +42,24 @@ export class BoxVoxelGometryNode extends GeoemtryNode {
41
42
  continue;
42
43
  const faceIndex = this.geomtry.cullIndex.getValue(geoId, currentIndex, trueFaceIndex);
43
44
  if (faceIndex > -1 &&
44
- !this.builder
45
- .space.getConstructor(hashed)
46
- ?.isShapeStateFaceTransparent(this.builder.space.modCache[hashed], this.builder.space.stateCache[hashed], geoId, faceIndex)) {
45
+ !constructor.isShapeStateFaceTransparent(this.builder.space.modCache[hashed], this.builder.space.stateCache[hashed], geoId, faceIndex)) {
47
46
  return false;
48
47
  }
49
48
  }
50
49
  }
51
- if (!offsetConditonalGeometry)
52
- continue;
53
- for (let i = 0; i < offsetConditonalGeometry.length; i++) {
54
- const cond = offsetConditonalGeometry[i];
55
- for (let k = 0; k < cond.length; k++) {
56
- const geoId = cond[k];
57
- if (VoxelModelConstructorRegister.rulesless[geoId])
58
- continue;
59
- const faceIndex = this.geomtry.cullIndex.getValue(geoId, currentIndex, trueFaceIndex);
60
- if (faceIndex > -1 &&
61
- !this.builder
62
- .space.getConstructor(hashed)
63
- ?.isCondtionalStateFaceTransparent(this.builder.space.modCache[hashed], this.builder.space.stateCache[hashed], geoId, faceIndex))
64
- return false;
50
+ const offsetConditonalGeometry = this.builder.space.getConditionalGeomtry(hashed);
51
+ if (offsetConditonalGeometry) {
52
+ for (let i = 0; i < offsetConditonalGeometry.length; i++) {
53
+ const cond = offsetConditonalGeometry[i];
54
+ for (let k = 0; k < cond.length; k++) {
55
+ const geoId = cond[k];
56
+ if (VoxelModelConstructorRegister.rulesless[geoId])
57
+ continue;
58
+ const faceIndex = this.geomtry.cullIndex.getValue(geoId, currentIndex, trueFaceIndex);
59
+ if (faceIndex > -1 &&
60
+ !constructor.isCondtionalStateFaceTransparent(this.builder.space.modCache[hashed], this.builder.space.stateCache[hashed], geoId, faceIndex))
61
+ return false;
62
+ }
65
63
  }
66
64
  }
67
65
  }
@@ -99,21 +97,28 @@ export class BoxVoxelGometryNode extends GeoemtryNode {
99
97
  length = baseGeo.length;
100
98
  for (let geoIndex = 0; geoIndex < length; geoIndex++) {
101
99
  if (this.geomtry.aoIndex.getValue(baseGeo[geoIndex], currentIndex, trueVertexIndex)) {
102
- worldAO.vertices[v] = 1;
103
- shaded = true;
104
- break;
100
+ this._wasAOShaded = true;
101
+ worldAO.vertices[v]++;
102
+ if (worldAO.vertices[v] >= 3) {
103
+ shaded = true;
104
+ break;
105
+ }
105
106
  }
106
107
  }
107
108
  }
108
- if (!conditonalGeo)
109
+ if (!conditonalGeo || shaded)
109
110
  continue;
110
111
  length = conditonalGeo.length;
111
112
  for (let condtionsIndex = 0; condtionsIndex < length; condtionsIndex++) {
112
113
  const condiotnalength = conditonalGeo[condtionsIndex].length;
113
114
  for (let geoIndex = 0; geoIndex < condiotnalength; geoIndex++) {
114
115
  if (this.geomtry.aoIndex.getValue(conditonalGeo[condtionsIndex][geoIndex], currentIndex, trueVertexIndex)) {
115
- worldAO.vertices[v] = 1;
116
- break;
116
+ this._wasAOShaded = true;
117
+ worldAO.vertices[v]++;
118
+ if (worldAO.vertices[v] >= 3) {
119
+ shaded = true;
120
+ break;
121
+ }
117
122
  }
118
123
  }
119
124
  }
@@ -122,9 +127,12 @@ export class BoxVoxelGometryNode extends GeoemtryNode {
122
127
  }
123
128
  shouldFlip() {
124
129
  const worldAO = this.builder.vars.ao;
125
- const worldLight = this.builder.vars.light;
126
- if (shouldCauseFlip(worldAO.vertices[0], worldAO.vertices[1], worldAO.vertices[2], worldAO.vertices[3]))
130
+ if (shouldCauseFlip(worldAO.vertices[0], worldAO.vertices[1], worldAO.vertices[2], worldAO.vertices[3]) &&
131
+ this._wasAOShaded)
127
132
  return true;
133
+ if (this._wasAOShaded)
134
+ return false;
135
+ const worldLight = this.builder.vars.light;
128
136
  return (shouldCauseFlip(this.lightData.getS(worldLight.vertices[0]), this.lightData.getS(worldLight.vertices[1]), this.lightData.getS(worldLight.vertices[2]), this.lightData.getS(worldLight.vertices[3])) ||
129
137
  shouldCauseFlip(this.lightData.sumRGB(worldLight.vertices[0]), this.lightData.sumRGB(worldLight.vertices[1]), this.lightData.sumRGB(worldLight.vertices[2]), this.lightData.sumRGB(worldLight.vertices[3])));
130
138
  }
@@ -134,10 +142,10 @@ export class BoxVoxelGometryNode extends GeoemtryNode {
134
142
  for (let face = 0; face < 6; face++) {
135
143
  if (args[face][ArgIndexes.Enabled] && this.isExposed(face)) {
136
144
  added = true;
145
+ const quad = this.quads[face];
137
146
  tool.calculateFaceData(face);
138
147
  this.determineShading(face);
139
148
  const faceArgs = args[face];
140
- const quad = this.quads[face];
141
149
  quad.flip = this.shouldFlip() || faceArgs[ArgIndexes.Fliped];
142
150
  tool.vars.textureIndex = faceArgs[ArgIndexes.Texture];
143
151
  const uvs = faceArgs[ArgIndexes.UVs];
@@ -153,12 +161,13 @@ export class BoxVoxelGometryNode extends GeoemtryNode {
153
161
  //4
154
162
  quad.uvs.vertices[3].x = uvs[3][0];
155
163
  quad.uvs.vertices[3].y = uvs[3][1];
156
- VoxelGeometryBuilder.addQuad(tool, this.builder.origin, quad);
164
+ addVoxelQuad(tool, this.builder.origin, quad);
157
165
  tool.updateBounds(this.quadBounds[face]);
158
166
  }
159
167
  }
160
168
  this.builder.vars.ao.setAll(0);
161
169
  this.builder.vars.light.setAll(0);
170
+ this._wasAOShaded = false;
162
171
  return added;
163
172
  }
164
173
  }
@@ -1,5 +1,5 @@
1
1
  import { VoxelFaces } from "../../../../Math";
2
- import { VoxelGeometryBuilder } from "../../../Geomtry/VoxelGeometryBuilder";
2
+ import { addVoxelQuad } from "../../../Geomtry/VoxelGeometryBuilder";
3
3
  import { GeoemtryNode } from "../GeometryNode";
4
4
  import { getInterpolationValue, shouldCauseFlip, } from "../../Common/Calc/CalcConstants";
5
5
  import { VoxelRelativeCubeIndexPositionMap } from "../../../../Models/Indexing/VoxelRelativeCubeIndex";
@@ -148,7 +148,7 @@ export class QuadVoxelGometryNode extends GeoemtryNode {
148
148
  //4
149
149
  quad.uvs.vertices[3].x = uvs[3][0];
150
150
  quad.uvs.vertices[3].y = uvs[3][1];
151
- VoxelGeometryBuilder.addQuad(this.builder, this.builder.origin, quad);
151
+ addVoxelQuad(this.builder, this.builder.origin, quad);
152
152
  this.builder.updateBounds(this.quadBounds);
153
153
  this.builder.vars.light.setAll(0);
154
154
  this.builder.vars.ao.setAll(0);
@@ -1,4 +1,4 @@
1
- import { VoxelGeometryBuilder } from "../../../Geomtry/VoxelGeometryBuilder";
1
+ import { addVoxelQuad } from "../../../Geomtry/VoxelGeometryBuilder";
2
2
  import { BoxVoxelGometryInputs, } from "../../../../Models/Input/BoxVoxelGometryInputs";
3
3
  import { getInterpolationValue, shouldCauseFlip, } from "../../Common/Calc/CalcConstants";
4
4
  import { VoxelLightData } from "../../../../Voxels/Cursor/VoxelLightData";
@@ -64,7 +64,7 @@ export class RulelessBoxVoxelGeometryNode extends GeoemtryNode {
64
64
  //4
65
65
  quad.uvs.vertices[3].x = uvs[3][0];
66
66
  quad.uvs.vertices[3].y = uvs[3][1];
67
- VoxelGeometryBuilder.addQuad(tool, tool.position, quad);
67
+ addVoxelQuad(tool, tool.position, quad);
68
68
  this.builder.updateBounds(this.quadBounds[face]);
69
69
  }
70
70
  }
@@ -1,5 +1,5 @@
1
1
  import { VoxelFaces } from "../../../../Math";
2
- import { VoxelGeometryBuilder } from "../../../Geomtry/VoxelGeometryBuilder";
2
+ import { addVoxelQuad, } from "../../../Geomtry/VoxelGeometryBuilder";
3
3
  import { getInterpolationValue, shouldCauseFlip, } from "../../Common/Calc/CalcConstants";
4
4
  import { QuadVoxelGometryInputs, } from "../../../../Models/Input/QuadVoxelGometryInputs";
5
5
  import { GeoemtryNode } from "../GeometryNode";
@@ -68,7 +68,7 @@ export class RulelessQuadVoxelGeometryNode extends GeoemtryNode {
68
68
  //4
69
69
  quad.uvs.vertices[3].x = uvs[3][0];
70
70
  quad.uvs.vertices[3].y = uvs[3][1];
71
- VoxelGeometryBuilder.addQuad(tool, tool.position, quad);
71
+ addVoxelQuad(tool, tool.position, quad);
72
72
  this.builder.updateBounds(this.quadBounds);
73
73
  this.builder.vars.light.setAll(0);
74
74
  this.builder.vars.ao.setAll(0);
@@ -1,4 +1,4 @@
1
- import type { TextureId } from "../../Textures/Texture.types.js";
1
+ import type { TextureId } from "../../../Textures/Texture.types.js";
2
2
  export declare class OutlinedVoxelTool {
3
3
  static _currentTexts: number[];
4
4
  static setCurrentTextures(textures: number[]): void;
@@ -1,4 +1,4 @@
1
- import { VoxelFaces } from "../../Math/index.js";
1
+ import { VoxelFaces } from "../../../Math/index.js";
2
2
  /*
3
3
  0 -> normal direction
4
4
  1 -> top right
@@ -0,0 +1,6 @@
1
+ import { VoxelModelBuilder } from "./VoxelModelBuilder";
2
+ export declare class RenderedMaterials {
3
+ static meshersMap: Map<string, VoxelModelBuilder>;
4
+ static meshers: VoxelModelBuilder[];
5
+ static register(materials: string[]): void;
6
+ }
@@ -1,10 +1,10 @@
1
- import { VoxelMesherDataTool } from "./Tools/VoxelMesherDataTool";
1
+ import { VoxelModelBuilder } from "./VoxelModelBuilder";
2
2
  export class RenderedMaterials {
3
3
  static meshersMap = new Map();
4
4
  static meshers = [];
5
5
  static register(materials) {
6
6
  for (let i = 0; i < materials.length; i++) {
7
- const newTool = new VoxelMesherDataTool(materials[i], i);
7
+ const newTool = new VoxelModelBuilder(materials[i], i);
8
8
  this.meshersMap.set(materials[i], newTool);
9
9
  this.meshers[i] = newTool;
10
10
  }
@@ -1,4 +1,4 @@
1
- import { VoxelMesherDataTool } from "../../Mesher/Tools/VoxelMesherDataTool";
1
+ import { VoxelModelBuilder } from "./VoxelModelBuilder";
2
2
  import { CompiledVoxelModelInputData, CompiledVoxelModelData } from "../../Voxels/Types/VoxelModelCompiledData.types";
3
3
  import { StateSchema } from "../../Voxels/State/Schema/StateSchema";
4
4
  import { StateTreeReader } from "../../Voxels/State/StateTreeReader";
@@ -7,7 +7,7 @@ import { VoxelModelEffect } from "./VoxelModelEffect";
7
7
  import { CondtionalTreeReader } from "../../Voxels/State/CondiotnalTreeReader";
8
8
  export declare class VoxelConstructor {
9
9
  id: string;
10
- builder: VoxelMesherDataTool;
10
+ builder: VoxelModelBuilder;
11
11
  data: CompiledVoxelModelData;
12
12
  isModel: true;
13
13
  geometries: number[][];
@@ -18,10 +18,10 @@ export declare class VoxelConstructor {
18
18
  conditonalInputMap: any[];
19
19
  schema: StateSchema;
20
20
  effects: VoxelModelEffect;
21
- shapeStateTree: StateTreeReader;
21
+ stateTree: StateTreeReader;
22
22
  condtioanlShapeStateTree: CondtionalTreeReader;
23
- constructor(id: string, builder: VoxelMesherDataTool, data: CompiledVoxelModelData, voxleData: CompiledVoxelModelInputData);
24
- isShapeStateFaceTransparent(modState: number, shapeState: number, geoId: number, faceIndex: number): boolean;
25
- isCondtionalStateFaceTransparent(modState: number, shapeState: number, geoId: number, faceIndex: number): boolean;
23
+ constructor(id: string, builder: VoxelModelBuilder, data: CompiledVoxelModelData, voxleData: CompiledVoxelModelInputData);
24
+ isShapeStateFaceTransparent(modState: number, stateTree: number, geoId: number, faceIndex: number): boolean;
25
+ isCondtionalStateFaceTransparent(modState: number, state: number, geoId: number, faceIndex: number): boolean;
26
26
  process(): boolean;
27
27
  }
@@ -17,7 +17,7 @@ export class VoxelConstructor {
17
17
  conditonalInputMap;
18
18
  schema;
19
19
  effects;
20
- shapeStateTree;
20
+ stateTree;
21
21
  condtioanlShapeStateTree;
22
22
  constructor(id, builder, data, voxleData) {
23
23
  this.id = id;
@@ -27,17 +27,17 @@ export class VoxelConstructor {
27
27
  this.conditonalInputMap = voxleData.condiotnalGeometryInputMap;
28
28
  this.transparentIndex = new VoxelFaceTransparentResultsIndex(voxleData.transparentFaceIndex);
29
29
  this.schema = new StateSchema(data.schema);
30
- this.shapeStateTree = new StateTreeReader(this.schema, 0, data.shapeStateTree);
30
+ this.stateTree = new StateTreeReader(this.schema, 0, data.stateTree);
31
31
  this.condtioanlShapeStateTree = new CondtionalTreeReader(this.schema, data.condiotnalStatements, data.condiotnalStateTree);
32
32
  this.modSchema = new StateSchema(voxleData.modSchema);
33
33
  this.modTree = new StateTreeReader(this.modSchema, 0, voxleData.modStateTree);
34
34
  this.effects = new VoxelModelEffect(this);
35
35
  }
36
- isShapeStateFaceTransparent(modState, shapeState, geoId, faceIndex) {
37
- return (this.transparentIndex.getValue(modState, this.data.relativeGeometryByteIndexMap[this.data.shapeStateRelativeGeometryMap[shapeState][geoId]], faceIndex) == 1);
36
+ isShapeStateFaceTransparent(modState, stateTree, geoId, faceIndex) {
37
+ return (this.transparentIndex.getValue(modState, this.data.relativeGeometryByteIndexMap[this.data.stateRelativeGeometryMap[stateTree][geoId]], faceIndex) == 1);
38
38
  }
39
- isCondtionalStateFaceTransparent(modState, shapeState, geoId, faceIndex) {
40
- return (this.transparentIndex.getValue(modState, this.data.relativeGeometryByteIndexMap[this.data.condiotnalShapeStateRelativeGeometryMap[shapeState][geoId]], faceIndex) == 1);
39
+ isCondtionalStateFaceTransparent(modState, state, geoId, faceIndex) {
40
+ return (this.transparentIndex.getValue(modState, this.data.relativeGeometryByteIndexMap[this.data.condiotnalShapeStateRelativeGeometryMap[state][geoId]], faceIndex) == 1);
41
41
  }
42
42
  process() {
43
43
  let added = false;
@@ -46,8 +46,8 @@ export class VoxelConstructor {
46
46
  const treeState = builder.space.stateCache[hashed];
47
47
  const modState = builder.space.modCache[hashed];
48
48
  if (treeState > -1) {
49
- const geoLinks = this.data.shapeStateMap[treeState];
50
- const geometries = this.data.shapeStateGeometryMap[treeState];
49
+ const geoLinks = this.data.stateMap[treeState];
50
+ const geometries = this.data.stateGeometryMap[treeState];
51
51
  const geometriesLength = geoLinks.length;
52
52
  const inputs = this.baseInputMap[modState][treeState];
53
53
  for (let i = 0; i < geometriesLength; i++) {
@@ -1,11 +1,10 @@
1
- import { DataCursorInterface } from "../../Tools/DataCursor.interface";
1
+ import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
2
2
  import { Vec3Array, Vector3Like } from "@amodx/math";
3
3
  import { VoxelCursor } from "../../Voxels/Cursor/VoxelCursor";
4
4
  export declare class VoxelGeometryBuilderCacheSpace {
5
5
  bounds: Vector3Like;
6
6
  foundHash: Uint8Array;
7
7
  voxelCache: Uint16Array;
8
- lightCache: Int32Array;
9
8
  modCache: Int32Array;
10
9
  stateCache: Int32Array;
11
10
  conditonalStateCache: Int32Array;
@@ -16,9 +15,8 @@ export declare class VoxelGeometryBuilderCacheSpace {
16
15
  start(x: number, y: number, z: number): void;
17
16
  getIndex(x: number, y: number, z: number): number;
18
17
  getConstructor(index: number): import("./VoxelConstructor").VoxelConstructor | null;
19
- getGeomtry(index: number): false | number[];
20
- getConditionalGeomtry(index: number): false | number[][];
18
+ getGeomtry(index: number): number[] | null;
19
+ getConditionalGeomtry(index: number): number[][] | null;
21
20
  getHash(dataCursor: DataCursorInterface, x: number, y: number, z: number): number;
22
- getLight(dataCursor: DataCursorInterface, x: number, y: number, z: number): number;
23
21
  private hashState;
24
22
  }
@@ -5,7 +5,6 @@ export class VoxelGeometryBuilderCacheSpace {
5
5
  bounds;
6
6
  foundHash;
7
7
  voxelCache;
8
- lightCache;
9
8
  modCache;
10
9
  stateCache;
11
10
  conditonalStateCache;
@@ -16,7 +15,6 @@ export class VoxelGeometryBuilderCacheSpace {
16
15
  this.bounds = bounds;
17
16
  const volume = bounds.x * bounds.y * bounds.z;
18
17
  this.foundHash = new Uint8Array(volume);
19
- this.lightCache = new Int32Array(volume);
20
18
  this.voxelCache = new Uint16Array(volume);
21
19
  this.modCache = new Int32Array(volume);
22
20
  this.stateCache = new Int32Array(volume);
@@ -27,7 +25,6 @@ export class VoxelGeometryBuilderCacheSpace {
27
25
  this.offset[0] = x;
28
26
  this.offset[1] = y;
29
27
  this.offset[2] = z;
30
- this.lightCache.fill(-1);
31
28
  this.foundHash.fill(0);
32
29
  this.voxelCache.fill(0);
33
30
  this.modCache.fill(-1);
@@ -45,12 +42,12 @@ export class VoxelGeometryBuilderCacheSpace {
45
42
  }
46
43
  getGeomtry(index) {
47
44
  if (this.foundHash[index] < 2)
48
- return false;
49
- return VoxelModelConstructorRegister.constructorsPaltte[this.voxelCache[index]].data.shapeStateGeometryMap[this.stateCache[index]];
45
+ return null;
46
+ return VoxelModelConstructorRegister.constructorsPaltte[this.voxelCache[index]].data.stateGeometryMap[this.stateCache[index]];
50
47
  }
51
48
  getConditionalGeomtry(index) {
52
49
  if (this.foundHash[index] < 2)
53
- return false;
50
+ return null;
54
51
  return VoxelModelConstructorRegister.constructorsPaltte[this.voxelCache[index]].data.condiotnalShapeStateGeometryMap[this.conditonalStateCache[index]];
55
52
  }
56
53
  getHash(dataCursor, x, y, z) {
@@ -60,48 +57,28 @@ export class VoxelGeometryBuilderCacheSpace {
60
57
  }
61
58
  return hashed;
62
59
  }
63
- getLight(dataCursor, x, y, z) {
64
- const index = this.getIndex(x, y, z);
65
- if (this.lightCache[index] == -1) {
66
- this.lightCache[index] = 0;
67
- const voxel = dataCursor.getVoxel(x, y, z);
68
- if (voxel) {
69
- const light = voxel.getLight();
70
- if (light > 0) {
71
- this.lightCache[index] = light;
72
- }
73
- }
74
- }
75
- return this.lightCache[index];
76
- }
77
60
  hashState(dataCursor, index, x, y, z) {
78
61
  if (this.foundHash[index] == 1)
79
- return -1;
62
+ return;
80
63
  if (this.foundHash[index] == 2)
81
- return this.stateCache[index];
64
+ return;
82
65
  const voxel = dataCursor.getVoxel(x, y, z);
83
- if (voxel) {
84
- const light = voxel.getLight();
85
- if (light > 0) {
86
- this.lightCache[index] = light;
87
- }
88
- }
89
66
  if (!voxel || !voxel.isRenderable()) {
90
67
  this.foundHash[index] = 1;
91
- return -1;
68
+ return;
92
69
  }
93
70
  const voxelId = voxel.getId();
94
71
  const voxelConstructor = VoxelModelConstructorRegister.constructorsPaltte[voxelId];
95
72
  if (!voxelConstructor) {
96
73
  this.foundHash[index] = 1;
97
- return -1;
74
+ return;
98
75
  }
99
76
  this.voxelCache[index] = voxelId;
100
77
  this.foundHash[index] = 2;
101
78
  //no ao
102
79
  this.noCastAO[index] = voxel.isLightSource() || voxel.noAO() ? 1 : 0;
103
80
  //state
104
- const state = voxelConstructor.shapeStateTree.getState(voxel.getState());
81
+ const state = voxelConstructor.stateTree.getState(voxel.getState());
105
82
  this.stateCache[index] = state;
106
83
  //mod
107
84
  const mod = voxelConstructor.modTree.getState(voxel.getMod());
@@ -114,6 +91,5 @@ export class VoxelGeometryBuilderCacheSpace {
114
91
  voxelConstructor.schema.dataCursor = dataCursor;
115
92
  const conditonalState = voxelConstructor.condtioanlShapeStateTree.getState();
116
93
  this.conditonalStateCache[index] = conditonalState;
117
- return 1;
118
94
  }
119
95
  }
@@ -1,13 +1,12 @@
1
- import { MesherDataTool } from "../Geomtry/Tools/MesherDataTools";
2
1
  import { QuadScalarVertexData } from "../Geomtry/Primitives/QuadVertexData";
3
2
  import { VoxelFaces } from "../../Math";
4
3
  import { QuadVerticies } from "../Geomtry/Geometry.types";
5
4
  import { VoxelMesh } from "../Geomtry/VoxelMesh";
6
- import { VoxelMeshBVHBuilder } from "./VoxelMeshBVHBuilder";
5
+ import { VoxelMeshBVHBuilder } from "../Geomtry/VoxelMeshBVHBuilder";
7
6
  import { Vec3Array, Vector3Like, Vector4Like } from "@amodx/math";
8
7
  import { VoxelCursorInterface } from "../../Voxels/Cursor/VoxelCursor.interface.js";
9
- import { DataCursorInterface } from "../../Tools/DataCursor.interface.js";
10
- import { VoxelGeometryBuilderCacheSpace } from "../Models/VoxelGeometryBuilderCacheSpace";
8
+ import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface.js";
9
+ import { VoxelGeometryBuilderCacheSpace } from "./VoxelGeometryBuilderCacheSpace";
11
10
  declare class VoxelVars {
12
11
  faceFlipped: boolean;
13
12
  textureIndex: number;
@@ -18,7 +17,7 @@ declare class VoxelVars {
18
17
  level: QuadScalarVertexData;
19
18
  reset(): void;
20
19
  }
21
- export declare class VoxelMesherDataTool extends MesherDataTool {
20
+ export declare class VoxelModelBuilder {
22
21
  id: string;
23
22
  materialIndex: number;
24
23
  space: VoxelGeometryBuilderCacheSpace;
@@ -1,10 +1,9 @@
1
1
  //tools
2
- import { MesherDataTool } from "../Geomtry/Tools/MesherDataTools";
3
2
  //data
4
3
  import { QuadScalarVertexData } from "../Geomtry/Primitives/QuadVertexData";
5
4
  import { VoxelFaces, VoxelFacesArray } from "../../Math";
6
5
  import { QuadVerticies } from "../Geomtry/Geometry.types";
7
- import calculateFaceData from "../Models/Common/Calc/FaceDataCalc.js";
6
+ import calculateFaceData from "./Common/Calc/FaceDataCalc.js";
8
7
  import { VoxelMesh } from "../Geomtry/VoxelMesh";
9
8
  import { Vector3Like, Vector4Like } from "@amodx/math";
10
9
  class VoxelVars {
@@ -23,7 +22,7 @@ class VoxelVars {
23
22
  this.overlayTextures.z = 0;
24
23
  }
25
24
  }
26
- export class VoxelMesherDataTool extends MesherDataTool {
25
+ export class VoxelModelBuilder {
27
26
  id;
28
27
  materialIndex;
29
28
  space;
@@ -41,11 +40,10 @@ export class VoxelMesherDataTool extends MesherDataTool {
41
40
  lightData;
42
41
  effects;
43
42
  constructor(id, materialIndex) {
44
- super();
45
- this.id = id;
46
- this.materialIndex = materialIndex;
47
43
  // this.faceDataOverride.currentVoxel = this.voxel;
48
44
  // this.faceDataOverride.neighborVoxel = this.nVoxel;
45
+ this.id = id;
46
+ this.materialIndex = materialIndex;
49
47
  this.dataCalculated = [];
50
48
  for (const face of VoxelFacesArray) {
51
49
  this.dataCalculated[face] = false;
@@ -74,7 +72,6 @@ export class VoxelMesherDataTool extends MesherDataTool {
74
72
  this.lightData[face][QuadVerticies.BottomLeft] = 0;
75
73
  this.lightData[face][QuadVerticies.BottomRight] = 0;
76
74
  }
77
- this.startNewMesh(new VoxelMesh());
78
75
  }
79
76
  bounds = {
80
77
  min: [0, 0, 0],
@@ -89,7 +86,7 @@ export class VoxelMesherDataTool extends MesherDataTool {
89
86
  this.bounds.max[0] = -Infinity;
90
87
  this.bounds.max[1] = -Infinity;
91
88
  this.bounds.max[2] = -Infinity;
92
- this._boundsUpdate = true;
89
+ this._boundsUpdate = false;
93
90
  }
94
91
  endConstruction() {
95
92
  this.vars.reset();
@@ -1,4 +1,5 @@
1
1
  import { Vec3Array } from "@amodx/math";
2
+ export type SetSectionMeshTask = ArrayBuffer;
2
3
  export type CompactSubMesh = [
3
4
  materialId: string,
4
5
  vertexBuffer: Float32Array,
@@ -42,6 +42,10 @@ export const cube = {
42
42
  type: "int",
43
43
  default: 0,
44
44
  },
45
+ northTexTransparent: {
46
+ type: "boolean",
47
+ default: false,
48
+ },
45
49
  southTex: {
46
50
  type: "texture",
47
51
  },