@divinevoxel/vlox 0.0.75 → 0.0.77

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 (330) hide show
  1. package/Builder/RayProvider.d.ts +6 -0
  2. package/Builder/Tools/Brush/BrushTool.d.ts +55 -0
  3. package/Builder/Tools/Brush/BrushTool.js +352 -0
  4. package/Builder/Tools/BuilderToolBase.d.ts +39 -0
  5. package/Builder/Tools/BuilderToolBase.js +42 -0
  6. package/Builder/Tools/Hand/HandTool.d.ts +24 -0
  7. package/Builder/Tools/Hand/HandTool.js +73 -0
  8. package/Builder/Tools/Path/PahtTool.d.ts +34 -0
  9. package/Builder/Tools/Path/PahtTool.js +128 -0
  10. package/Builder/Tools/Sculpt/SculptTool.d.ts +34 -0
  11. package/Builder/Tools/Sculpt/SculptTool.js +102 -0
  12. package/Builder/Tools/Shape/ShapeTool.d.ts +32 -0
  13. package/Builder/Tools/Shape/ShapeTool.js +78 -0
  14. package/Builder/Tools/Template/TemplateTool.d.ts +35 -0
  15. package/Builder/Tools/Template/TemplateTool.js +73 -0
  16. package/Builder/Tools/Wand/WandTool.d.ts +30 -0
  17. package/Builder/Tools/Wand/WandTool.js +90 -0
  18. package/Builder/Tools/Wrench/WrenchTool.d.ts +47 -0
  19. package/Builder/Tools/Wrench/WrenchTool.js +184 -0
  20. package/Builder/Util/FreeBoxSelection.d.ts +12 -0
  21. package/Builder/Util/FreeBoxSelection.js +21 -0
  22. package/Builder/Util/FreePointSelection.d.ts +14 -0
  23. package/Builder/Util/FreePointSelection.js +39 -0
  24. package/Builder/Util/SurfaceBoxSelection.d.ts +12 -0
  25. package/Builder/Util/SurfaceBoxSelection.js +25 -0
  26. package/Builder/VoxelBuildSpace.d.ts +73 -0
  27. package/Builder/VoxelBuildSpace.js +224 -0
  28. package/Builder/World/InitTasks.d.ts +1 -0
  29. package/Builder/World/InitTasks.js +129 -0
  30. package/Builder/World/VoxelBuildSpaceWorld.d.ts +4 -0
  31. package/Builder/World/VoxelBuildSpaceWorld.js +10 -0
  32. package/Contexts/Render/DivineVoxelEngineRender.d.ts +5 -5
  33. package/Contexts/World/DivineVoxelEngineWorld.d.ts +5 -5
  34. package/Mesher/Geomtry/Proto/ProtoMesh.d.ts +18 -0
  35. package/Mesher/Geomtry/Proto/ProtoMesh.js +73 -0
  36. package/Mesher/Geomtry/{VoxelMeshBuffers.d.ts → Proto/ProtoMeshBuffer.d.ts} +2 -2
  37. package/Mesher/Geomtry/{VoxelMeshBuffers.js → Proto/ProtoMeshBuffer.js} +2 -2
  38. package/Mesher/Geomtry/Shapes/Box.d.ts +2 -9
  39. package/Mesher/Geomtry/Shapes/Box.js +7 -12
  40. package/Mesher/Geomtry/Transform/TransformBox.js +5 -2
  41. package/Mesher/InitMesher.js +4 -4
  42. package/Mesher/InitTask.js +2 -2
  43. package/Mesher/Items/Base/CompactItemMesh.d.ts +3 -0
  44. package/Mesher/Items/Base/CompactItemMesh.js +20 -0
  45. package/Mesher/Items/Geomtry/ItemGeometryBuilder.d.ts +5 -0
  46. package/Mesher/Items/Geomtry/ItemGeometryBuilder.js +131 -0
  47. package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.d.ts +48 -0
  48. package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.js +114 -0
  49. package/Mesher/Items/MeshTexture.d.ts +1 -0
  50. package/Mesher/Items/MeshTexture.js +214 -0
  51. package/Mesher/Items/MeshTextureO.js +277 -0
  52. package/Mesher/Items/Models/ItemModelBuilder.d.ts +27 -0
  53. package/Mesher/Items/Models/ItemModelBuilder.js +64 -0
  54. package/Mesher/Types/ItemMesh.types.d.ts +5 -0
  55. package/Mesher/Types/ItemMesh.types.js +12 -0
  56. package/Mesher/Types/Mesher.types.d.ts +15 -9
  57. package/Mesher/Types/Mesher.types.js +14 -0
  58. package/Mesher/Types/VoxelMesh.types.js +7 -6
  59. package/Mesher/Voxels/Base/CompactTemplateMesh.d.ts +3 -0
  60. package/Mesher/{Functions/CompactVoxelMesh.js → Voxels/Base/CompactTemplateMesh.js} +4 -40
  61. package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.d.ts +2 -2
  62. package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.d.ts +1 -1
  63. package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.js +11 -7
  64. package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.d.ts +1 -1
  65. package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.js +1 -1
  66. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.d.ts +2 -2
  67. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.js +1 -1
  68. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.d.ts +3 -3
  69. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.js +2 -2
  70. package/Mesher/Voxels/MeshTemplate.d.ts +3 -0
  71. package/Mesher/Voxels/MeshTemplate.js +81 -0
  72. package/Mesher/{Functions → Voxels}/MeshVoxel.d.ts +1 -1
  73. package/Mesher/{Functions → Voxels}/MeshVoxel.js +6 -4
  74. package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +3 -3
  75. package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.js +4 -4
  76. package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.d.ts +1 -1
  77. package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.js +2 -2
  78. package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.js +1 -1
  79. package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.d.ts +1 -1
  80. package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.d.ts +1 -1
  81. package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.js +1 -1
  82. package/Mesher/{Models → Voxels/Models}/Common/GetTexture.d.ts +3 -3
  83. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
  84. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.js +1 -1
  85. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +3 -3
  86. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.js +14 -16
  87. package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.d.ts +2 -2
  88. package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.js +1 -1
  89. package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.d.ts +2 -2
  90. package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.js +1 -1
  91. package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +2 -2
  92. package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +1 -1
  93. package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.d.ts +2 -2
  94. package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +24 -0
  95. package/Mesher/{Models → Voxels/Models}/Procedures/Default/ConsistentRotationTextureProcedure.js +2 -2
  96. package/Mesher/{Models → Voxels/Models}/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -5
  97. package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +205 -0
  98. package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +28 -0
  99. package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +109 -0
  100. package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.d.ts +3 -3
  101. package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.js +2 -0
  102. package/Mesher/{Models → Voxels/Models}/VoxelConstructor.d.ts +4 -4
  103. package/Mesher/{Models → Voxels/Models}/VoxelConstructor.js +3 -3
  104. package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
  105. package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.js +2 -2
  106. package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.d.ts +7 -7
  107. package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.js +6 -5
  108. package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.d.ts +4 -4
  109. package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.js +2 -2
  110. package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.d.ts +1 -1
  111. package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.js +1 -1
  112. package/Renderer/Classes/DVESectionMeshes.d.ts +1 -1
  113. package/Renderer/MeshManager.js +1 -1
  114. package/Settings/EngineSettings.types.d.ts +2 -1
  115. package/Settings/EngineSettings.types.js +3 -1
  116. package/Tasks/Paint/Common.js +14 -9
  117. package/Tasks/Paint/Erase/EraseVoxel.js +1 -1
  118. package/Tasks/Paint/Erase/EraseVoxelSelection.d.ts +4 -0
  119. package/Tasks/Paint/Erase/EraseVoxelSelection.js +33 -0
  120. package/Tasks/Paint/Erase/EraseVoxelTemplate.js +1 -2
  121. package/Tasks/Paint/Paint/PaintVoxelTemplate.js +1 -1
  122. package/Tasks/Propagation/Illumanation/RGBUpdate.js +1 -1
  123. package/Tasks/Tasks.types.d.ts +2 -0
  124. package/Tasks/TasksIds.d.ts +1 -0
  125. package/Tasks/TasksIds.js +1 -0
  126. package/Tasks/WorldGeneration/InitTasks.js +3 -1
  127. package/Templates/Archive/ArchivedVoxelTemplate.d.ts +6 -5
  128. package/Templates/Archive/ArchivedVoxelTemplate.js +56 -49
  129. package/Templates/Archive/Functions/CreateArchivedTemplate.js +4 -4
  130. package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +0 -1
  131. package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +0 -2
  132. package/Templates/Cursor/TemplateCursor.d.ts +6 -1
  133. package/Templates/Cursor/TemplateCursor.js +16 -3
  134. package/Templates/Cursor/TemplateProxy.d.ts +1 -0
  135. package/Templates/Cursor/TemplateProxy.js +9 -0
  136. package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
  137. package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
  138. package/Templates/Full/FullVoxelTemplate.d.ts +5 -4
  139. package/Templates/Full/FullVoxelTemplate.js +32 -17
  140. package/Templates/Functions/ExtrudeSelection.d.ts +5 -0
  141. package/Templates/Functions/ExtrudeSelection.js +44 -0
  142. package/Templates/Functions/FillSelection.d.ts +4 -0
  143. package/Templates/Functions/FillSelection.js +20 -0
  144. package/Templates/Functions/FlipTemplate.d.ts +2 -2
  145. package/Templates/Functions/FlipTemplate.js +8 -8
  146. package/Templates/Functions/RotateTemplate.d.ts +2 -2
  147. package/Templates/Path/VoxelPath.d.ts +4 -0
  148. package/Templates/Path/VoxelPath.js +18 -0
  149. package/Templates/Path/VoxelPath.types.d.ts +1 -0
  150. package/Templates/Selection/VoxelBFSSelection.d.ts +6 -6
  151. package/Templates/Selection/VoxelBFSSelection.js +29 -22
  152. package/Templates/Selection/VoxelBoundsSelection.d.ts +20 -0
  153. package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +38 -20
  154. package/Templates/Selection/VoxelPointSelection.d.ts +19 -0
  155. package/Templates/Selection/VoxelPointSelection.js +49 -0
  156. package/Templates/Selection/VoxelSelection.d.ts +18 -0
  157. package/Templates/Selection/VoxelSelection.js +1 -0
  158. package/Templates/Selection/VoxelSurfaceSelection.d.ts +8 -12
  159. package/Templates/Selection/VoxelSurfaceSelection.js +88 -84
  160. package/Templates/Selection/VoxelTemplateSelection.d.ts +13 -4
  161. package/Templates/Selection/VoxelTemplateSelection.js +27 -9
  162. package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +28 -0
  163. package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +77 -0
  164. package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +28 -0
  165. package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +77 -0
  166. package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +28 -0
  167. package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +77 -0
  168. package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +28 -0
  169. package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +92 -0
  170. package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +28 -0
  171. package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +76 -0
  172. package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +37 -0
  173. package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +137 -0
  174. package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +20 -0
  175. package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +61 -0
  176. package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +28 -0
  177. package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +76 -0
  178. package/Templates/Shapes/Selections/VoxelShapeSelection.d.ts +5 -0
  179. package/Templates/Shapes/Selections/VoxelShapeSelection.js +1 -0
  180. package/Templates/Shapes/VoxelShape.types.d.ts +2 -0
  181. package/Templates/Shapes/VoxelShape.types.js +8 -0
  182. package/Templates/Shapes/VoxelShapeTemplate.d.ts +37 -0
  183. package/Templates/Shapes/{BasicVoxelShapeTemplate.js → VoxelShapeTemplate.js} +43 -37
  184. package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +5 -12
  185. package/Templates/Shapes/VoxelShapeTemplate.types.js +5 -1
  186. package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
  187. package/Templates/VoxelTemplateRegister.js +60 -0
  188. package/Templates/VoxelTemplates.types.d.ts +3 -3
  189. package/Textures/Classes/CompiledTexture.d.ts +2 -0
  190. package/Textures/Classes/CompiledTexture.js +19 -1
  191. package/Textures/Classes/TextureAnimationTexture.d.ts +1 -1
  192. package/Textures/Functions/BuildTextureData.js +13 -0
  193. package/Textures/TextureManager.d.ts +1 -0
  194. package/Textures/TextureManager.js +11 -5
  195. package/Tools/Brush/Brush.d.ts +2 -0
  196. package/Tools/Brush/Brush.js +19 -0
  197. package/Tools/Tasks/TasksTool.d.ts +2 -1
  198. package/Tools/Tasks/TasksTool.js +2 -0
  199. package/Util/BinaryBuffer/Functions/BinaryBufferConvert.d.ts +1 -1
  200. package/Util/BinaryBuffer/Functions/BinaryBufferToTypedArray.d.ts +1 -1
  201. package/Util/LocationData.d.ts +1 -1
  202. package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
  203. package/Voxels/Cursor/VoxelCursor.interface.d.ts +2 -0
  204. package/Voxels/Cursor/VoxelCursor.interface.js +2 -0
  205. package/Voxels/Cursor/VoxelLightData.js +2 -2
  206. package/Voxels/Functions/BuildTagData.js +1 -1
  207. package/Voxels/Indexes/VoxelIndex.d.ts +1 -0
  208. package/Voxels/Indexes/VoxelIndex.js +11 -13
  209. package/Voxels/InitVoxelData.js +5 -14
  210. package/Voxels/Interaction/Functions/PickVoxel.d.ts +0 -5
  211. package/Voxels/Interaction/Functions/PickVoxel.js +64 -85
  212. package/Voxels/Interaction/Functions/PickVoxelWorld.js +21 -46
  213. package/Voxels/Interaction/VoxelPickResult.d.ts +1 -0
  214. package/Voxels/Interaction/VoxelPickResult.js +3 -0
  215. package/Voxels/Models/CompiledVoxelModel.types.d.ts +1 -1
  216. package/Voxels/Models/Defaults/CubeVoxelGeometry.js +11 -0
  217. package/Voxels/Models/Defaults/CubeVoxelModels.js +44 -99
  218. package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -3
  219. package/Voxels/Models/Defaults/PanelVoxelGeometry.js +2 -226
  220. package/Voxels/Models/Defaults/PanelVoxelModels.d.ts +1 -0
  221. package/Voxels/Models/Defaults/PanelVoxelModels.js +100 -258
  222. package/Voxels/Models/Defaults/StairVoxelModel.js +2 -2
  223. package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +4 -1
  224. package/Voxels/Models/Rules/Classes/GeomtryInput.js +26 -5
  225. package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +1 -1
  226. package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +23 -8
  227. package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +1 -1
  228. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +1 -1
  229. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +1 -1
  230. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +1 -1
  231. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +1 -1
  232. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +1 -1
  233. package/Voxels/Models/VoxelModel.types.d.ts +6 -1
  234. package/Voxels/State/Schema/BinarySchemaNode.d.ts +2 -1
  235. package/Voxels/State/Schema/BinarySchemaNode.js +5 -2
  236. package/Voxels/State/Schema/Conditions/SameVoxelConditions.js +2 -0
  237. package/Voxels/Types/PaintVoxelData.d.ts +13 -1
  238. package/Voxels/Types/PaintVoxelData.js +151 -14
  239. package/World/Archive/Functions/Shared/LightSegments.d.ts +1 -1
  240. package/World/Cursor/SectionCursor.d.ts +4 -0
  241. package/World/Cursor/SectionCursor.js +13 -16
  242. package/World/Cursor/SectorCursor.d.ts +4 -0
  243. package/World/Cursor/SectorCursor.js +13 -16
  244. package/World/Cursor/WorldCursor.d.ts +4 -0
  245. package/World/Cursor/WorldCursor.js +8 -0
  246. package/World/Sector/Sector.d.ts +1 -1
  247. package/World/Sector/SectorHeightMap.d.ts +6 -0
  248. package/World/Sector/SectorHeightMap.js +6 -0
  249. package/World/SnapShot/SectionSnapShotCursor.d.ts +3 -0
  250. package/World/SnapShot/SectionSnapShotCursor.js +6 -0
  251. package/World/WorldSpaces.js +3 -3
  252. package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +5 -1
  253. package/WorldSimulation/Dimensions/DimensionSimulation.js +12 -0
  254. package/WorldSimulation/Dimensions/Generator.d.ts +1 -0
  255. package/WorldSimulation/Dimensions/Generator.js +1 -0
  256. package/WorldSimulation/Dimensions/SimulationSector.d.ts +4 -1
  257. package/WorldSimulation/Dimensions/SimulationSector.js +71 -41
  258. package/WorldSimulation/Internal/WorldSimulationTasks.js +5 -2
  259. package/WorldSimulation/Procedures/BuildOnly.d.ts +10 -0
  260. package/WorldSimulation/Procedures/BuildOnly.js +55 -0
  261. package/WorldSimulation/Procedures/InitalLoad.js +3 -0
  262. package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +2 -0
  263. package/WorldSimulation/Tasks/SimulationTaskBase.js +11 -3
  264. package/WorldSimulation/Tasks/TaskSegment.d.ts +2 -1
  265. package/WorldSimulation/Tasks/TaskSegment.js +3 -1
  266. package/WorldSimulation/Tick/TickQueue.d.ts +2 -0
  267. package/WorldSimulation/Tick/TickQueue.js +26 -0
  268. package/WorldSimulation/Tools/SimulationBrush.d.ts +3 -0
  269. package/WorldSimulation/Tools/SimulationBrush.js +52 -0
  270. package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +3 -0
  271. package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -1
  272. package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +2 -0
  273. package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +6 -0
  274. package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +39 -14
  275. package/WorldSimulation/WorldSimulation.d.ts +10 -0
  276. package/WorldSimulation/WorldSimulation.js +41 -1
  277. package/package.json +1 -30
  278. package/Mesher/Functions/CompactVoxelMesh.d.ts +0 -3
  279. package/Mesher/Functions/MeshTexture.js +0 -278
  280. package/Mesher/Geomtry/VoxelMesh.d.ts +0 -12
  281. package/Mesher/Geomtry/VoxelMesh.js +0 -25
  282. package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +0 -25
  283. package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +0 -162
  284. package/Templates/Selection/VoxelBoxSelection.d.ts +0 -14
  285. package/Templates/Selection/VoxelSelecton.d.ts +0 -6
  286. package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -35
  287. package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -22
  288. package/Templates/Shapes/BoxVoxelTemplate.js +0 -75
  289. package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -22
  290. package/Templates/Shapes/ConeVoxelTemplate.js +0 -69
  291. package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -22
  292. package/Templates/Shapes/CylinderVoxelTemplate.js +0 -69
  293. package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -22
  294. package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -69
  295. package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -30
  296. package/Templates/Shapes/PyramidVoxelTemplate.js +0 -140
  297. package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -24
  298. package/Templates/Shapes/SphereVoxelTemplate.js +0 -97
  299. package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -22
  300. package/Templates/Shapes/TorusVoxelTemplate.js +0 -69
  301. package/Templates/VoxelTempateRegister.js +0 -30
  302. /package/{Mesher/Models/Nodes/Types/GeomtryNode.types.js → Builder/RayProvider.js} +0 -0
  303. /package/Mesher/{Functions/MeshTexture.d.ts → Items/MeshTextureO.d.ts} +0 -0
  304. /package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.js +0 -0
  305. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.d.ts +0 -0
  306. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.js +0 -0
  307. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
  308. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
  309. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.d.ts +0 -0
  310. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.js +0 -0
  311. /package/Mesher/{Functions → Voxels}/MeshSection.d.ts +0 -0
  312. /package/Mesher/{Functions → Voxels}/MeshSection.js +0 -0
  313. /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.d.ts +0 -0
  314. /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.js +0 -0
  315. /package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.d.ts +0 -0
  316. /package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.js +0 -0
  317. /package/Mesher/{Models → Voxels/Models}/Common/GetTexture.js +0 -0
  318. /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.d.ts +0 -0
  319. /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.js +0 -0
  320. /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.d.ts +0 -0
  321. /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.js +0 -0
  322. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.d.ts +0 -0
  323. /package/{Templates/Selection/VoxelSelecton.js → Mesher/Voxels/Models/Nodes/Types/GeomtryNode.types.js} +0 -0
  324. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.js +0 -0
  325. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.js +0 -0
  326. /package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.js +0 -0
  327. /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.js +0 -0
  328. /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.d.ts +0 -0
  329. /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.d.ts +0 -0
  330. /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.js +0 -0
@@ -1,14 +1,14 @@
1
1
  import { candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, candlesModel, carpetGeometry, carpetModel, chainGeometry, chainModel, fence, fenceEastWest, fenceNorthsouth, fencePost, leverGeometry, leverModel, } from "./Models/Defaults/Examples";
2
2
  import { cube, halfDownCube, eighthCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, halfSouthCube, halfWestCube, } from "./Models/Defaults/CubeVoxelGeometry";
3
3
  import { orientedCube, pillarCube, simpleCube, simpleNoCulledCube, simpleHalfCube, simpleTransparentCube, } from "./Models/Defaults/CubeVoxelModels";
4
- import { diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, thinPanelDown, thinPanelSouth, thinPanelWest, } from "./Models/Defaults/PanelVoxelGeometry";
4
+ import { diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, thinPanel, } from "./Models/Defaults/PanelVoxelGeometry";
5
5
  import { stair } from "./Models/Defaults/StairVoxelModel";
6
6
  import { liquidGeometry, liquidModel, } from "./Models/Defaults/LiquidVoxelModel";
7
7
  import { VoxelModelRuleBuilderRegister } from "./Models/Rules/VoxelModelRuleBuilderRegister";
8
8
  import { BuildStateData } from "./Functions/BuildStateData";
9
9
  import { BuildFinalInputs } from "./Models/Rules/Functions/BuildFinalInputs";
10
10
  import { SchemaRegister } from "../Voxels/State/SchemaRegister";
11
- import { simpleCrossedPannel, simpleThinPannel, } from "./Models/Defaults/PanelVoxelModels";
11
+ import { simpleCrossedPannel, simpleThinPannel, simpleTransparentThinPannel, } from "./Models/Defaults/PanelVoxelModels";
12
12
  import { VoxelIndex } from "../Voxels/Indexes/VoxelIndex";
13
13
  import { CacheManager } from "../Cache/CacheManager";
14
14
  import { VoxelLightData } from "./Cursor/VoxelLightData";
@@ -21,8 +21,8 @@ import { BuildRules } from "./Models/Rules/Functions/BuildRules";
21
21
  import { VoxelTagsRegister } from "./Data/VoxelTagsRegister";
22
22
  import { farmGeomtry, farmModels } from "./Models/Defaults/FarmVoxelModels";
23
23
  function RegisterModels(data) {
24
- VoxelModelRuleBuilderRegister.registerGeometry(cube, halfDownCube, halfSouthCube, halfWestCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, eighthCube, thinPanelDown, thinPanelSouth, thinPanelWest, diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, fencePost, fenceEastWest, fenceNorthsouth, chainGeometry, carpetGeometry, candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, liquidGeometry, ...leverGeometry, ...farmGeomtry, ...(data.geometry || []));
25
- VoxelModelRuleBuilderRegister.registerModels(simpleCube, simpleTransparentCube, simpleNoCulledCube, orientedCube, simpleHalfCube, pillarCube, simpleThinPannel, stair, simpleCrossedPannel, chainModel, carpetModel, candlesModel, leverModel, fence, liquidModel, ...farmModels, ...(data.models || []));
24
+ VoxelModelRuleBuilderRegister.registerGeometry(cube, halfDownCube, halfSouthCube, halfWestCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, eighthCube, thinPanel, diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, fencePost, fenceEastWest, fenceNorthsouth, chainGeometry, carpetGeometry, candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, liquidGeometry, ...leverGeometry, ...farmGeomtry, ...(data.geometry || []));
25
+ VoxelModelRuleBuilderRegister.registerModels(simpleCube, simpleTransparentCube, simpleNoCulledCube, orientedCube, simpleHalfCube, pillarCube, simpleThinPannel, simpleTransparentThinPannel, stair, simpleCrossedPannel, chainModel, carpetModel, candlesModel, leverModel, fence, liquidModel, ...farmModels, ...(data.models || []));
26
26
  }
27
27
  function GetModelData(data) {
28
28
  if (CacheManager.cacheLoadEnabled && CacheManager.cachedData) {
@@ -149,16 +149,6 @@ export function InitVoxelData(data) {
149
149
  dve_flow_rate: 0,
150
150
  },
151
151
  },
152
- {
153
- id: "dve_glow",
154
- properties: {
155
- dve_parent_substance: "dve_solid",
156
- dve_is_solid: true,
157
- dve_is_liquid: false,
158
- dve_is_transparent: false,
159
- dve_flow_rate: 0,
160
- },
161
- },
162
152
  {
163
153
  id: "dve_translucent",
164
154
  properties: {
@@ -237,6 +227,7 @@ export function InitVoxelData(data) {
237
227
  substances,
238
228
  materials,
239
229
  });
230
+ console.warn("FINAL", structuredClone(voxelData), voxelData.data.tags.filter((_) => _["dve_substance"] == "dve_glow"));
240
231
  let models = GetModelData(data);
241
232
  BuildPaletteData({ models });
242
233
  voxelData.data.palette = VoxelPalettesRegister.voxels;
@@ -1,9 +1,4 @@
1
1
  import { Vec3Array } from "@amodx/math";
2
2
  import { DataCursorInterface } from "../../Cursor/DataCursor.interface";
3
3
  import { VoxelPickResult } from "../VoxelPickResult";
4
- /**
5
- * # PickVoxel
6
- * Used to a pick a voxel from any data cursor interface.
7
- * The function assumes the data that is loaded into the cursor is available
8
- */
9
4
  export default function PickVoxel(cursor: DataCursorInterface, rayStart: Vec3Array, rayDirection: Vec3Array, rayLength: number): VoxelPickResult | null;
@@ -1,94 +1,73 @@
1
- import { Vec3ArrayLike, Vector3Like } from "@amodx/math";
1
+ import { Vector3Like } from "@amodx/math";
2
2
  import { VoxelPickResult } from "../VoxelPickResult";
3
3
  import { closestUnitNormal, closestVoxelFace, } from "../../../Math/UtilFunctions";
4
- const step = (val) => (val > 0 ? 1 : val < 0 ? -1 : 0);
5
- const calculateNormal = (intersectPoint, voxelMin, voxelMax) => {
6
- const epsilon = 1e-4;
7
- let normal = [0, 0, 0];
8
- if (Math.abs(intersectPoint[0] - voxelMin[0]) < epsilon)
9
- normal = [1, 0, 0];
10
- else if (Math.abs(intersectPoint[0] - voxelMax[0]) < epsilon)
11
- normal = [-1, 0, 0];
12
- else if (Math.abs(intersectPoint[1] - voxelMin[1]) < epsilon)
13
- normal = [0, 1, 0];
14
- else if (Math.abs(intersectPoint[1] - voxelMax[1]) < epsilon)
15
- normal = [0, -1, 0];
16
- else if (Math.abs(intersectPoint[2] - voxelMin[2]) < epsilon)
17
- normal = [0, 0, 1];
18
- else if (Math.abs(intersectPoint[2] - voxelMax[2]) < epsilon)
19
- normal = [0, 0, -1];
20
- return normal;
21
- };
22
- /**
23
- * # PickVoxel
24
- * Used to a pick a voxel from any data cursor interface.
25
- * The function assumes the data that is loaded into the cursor is available
26
- */
4
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
5
+ const epsilon = 1e-5;
6
+ const bounds = new BoundingBox();
27
7
  export default function PickVoxel(cursor, rayStart, rayDirection, rayLength) {
28
- const invDir = [
29
- 1 / rayDirection[0],
30
- 1 / rayDirection[1],
31
- 1 / rayDirection[2],
32
- ];
33
- const voxelSize = 1.0;
34
- const tDelta = [
35
- Math.abs(invDir[0]) * voxelSize,
36
- Math.abs(invDir[1]) * voxelSize,
37
- Math.abs(invDir[2]) * voxelSize,
38
- ];
39
- const tMax = [
40
- (Math.floor(rayStart[0]) - rayStart[0] + (rayDirection[0] > 0 ? 1 : 0)) *
41
- invDir[0],
42
- (Math.floor(rayStart[1]) - rayStart[1] + (rayDirection[1] > 0 ? 1 : 0)) *
43
- invDir[1],
44
- (Math.floor(rayStart[2]) - rayStart[2] + (rayDirection[2] > 0 ? 1 : 0)) *
45
- invDir[2],
46
- ];
47
- const pos = [
48
- Math.floor(rayStart[0]),
49
- Math.floor(rayStart[1]),
50
- Math.floor(rayStart[2]),
51
- ];
52
- const stepDir = [
53
- step(rayDirection[0]),
54
- step(rayDirection[1]),
55
- step(rayDirection[2]),
56
- ];
57
- for (let i = 0; i < rayLength; i++) {
58
- const [tx, ty, tz] = tMax;
59
- let axis = 0;
60
- if (tx < ty) {
61
- if (tx < tz)
62
- axis = 0;
63
- else
64
- axis = 2;
8
+ const rayDir = Vector3Like.Create(...rayDirection);
9
+ const rayOrigin = Vector3Like.Create(...rayStart);
10
+ const offset = cursor.volumePosition
11
+ ? cursor.volumePosition
12
+ : Vector3Like.Create();
13
+ bounds.setMinMax(Vector3Like.Add(cursor.volumeBounds.min, offset), Vector3Like.Add(cursor.volumeBounds.max, offset));
14
+ const safeDirection = Vector3Like.Create(Math.abs(rayDir.x) < epsilon ? epsilon : rayDir.x, Math.abs(rayDir.y) < epsilon ? epsilon : rayDir.y, Math.abs(rayDir.z) < epsilon ? epsilon : rayDir.z);
15
+ const invDir = Vector3Like.Divide(Vector3Like.Create(1, 1, 1), safeDirection);
16
+ const tDelta = Vector3Like.Create(Math.abs(invDir.x), Math.abs(invDir.y), Math.abs(invDir.z));
17
+ const tEnter = bounds.rayIntersection(rayOrigin, safeDirection);
18
+ if (!isFinite(tEnter)) {
19
+ return null;
20
+ }
21
+ let traveled = Math.max(tEnter - 0.5, 0.0);
22
+ const pos = Vector3Like.Add(rayOrigin, Vector3Like.MultiplyScalar(rayDir, traveled));
23
+ const voxel = Vector3Like.FloorInPlace(Vector3Like.Clone(pos));
24
+ const step = Vector3Like.Create(rayDir.x >= 0.0 ? 1 : -1, rayDir.y >= 0.0 ? 1 : -1, rayDir.z >= 0.0 ? 1 : -1);
25
+ const tMax = Vector3Like.Create((rayDir.x >= 0 ? voxel.x + 1 - pos.x : pos.x - voxel.x) * tDelta.x +
26
+ traveled, (rayDir.y >= 0 ? voxel.y + 1 - pos.y : pos.y - voxel.y) * tDelta.y +
27
+ traveled, (rayDir.z >= 0 ? voxel.z + 1 - pos.z : pos.z - voxel.z) * tDelta.z +
28
+ traveled);
29
+ const normal = Vector3Like.Create();
30
+ const maxDist = rayLength;
31
+ while (true) {
32
+ let cursorX = voxel.x;
33
+ let cursorY = voxel.y;
34
+ let cursorZ = voxel.z;
35
+ if (cursor.inBounds(cursorX, cursorY, cursorZ)) {
36
+ const voxel = cursor.getVoxel(cursorX, cursorY, cursorZ);
37
+ if (voxel && voxel.isRenderable()) {
38
+ const urd = Vector3Like.FromArray(closestUnitNormal(rayDir));
39
+ const n = Vector3Like.Clone(normal);
40
+ const pos = Vector3Like.Create(cursorX, cursorY, cursorZ);
41
+ const un = Vector3Like.FromArray(closestUnitNormal(n));
42
+ return new VoxelPickResult(rayOrigin, rayDir, rayLength, voxel.getRaw(), Vector3Like.Clone(pos), n, traveled, Vector3Like.Add(pos, normal), Vector3Like.FromArray(closestUnitNormal(rayDir)), closestVoxelFace(urd), Vector3Like.FromArray(closestUnitNormal(n)), closestVoxelFace(un), 0);
43
+ }
44
+ }
45
+ if (tMax.x < tMax.y && tMax.x < tMax.z) {
46
+ traveled = tMax.x;
47
+ tMax.x += tDelta.x;
48
+ voxel.x += step.x;
49
+ normal.x = -step.x;
50
+ normal.y = 0;
51
+ normal.z = 0;
52
+ }
53
+ else if (tMax.y < tMax.z) {
54
+ traveled = tMax.y;
55
+ tMax.y += tDelta.y;
56
+ voxel.y += step.y;
57
+ normal.x = 0;
58
+ normal.y = -step.y;
59
+ normal.z = 0;
65
60
  }
66
61
  else {
67
- if (ty < tz)
68
- axis = 1;
69
- else
70
- axis = 2;
62
+ traveled = tMax.z;
63
+ tMax.z += tDelta.z;
64
+ voxel.z += step.z;
65
+ normal.x = 0;
66
+ normal.y = 0;
67
+ normal.z = -step.z;
71
68
  }
72
- pos[axis] += stepDir[axis];
73
- tMax[axis] += tDelta[axis];
74
- if (!cursor.inBounds(...pos))
75
- continue;
76
- const voxel = cursor.getVoxel(...pos);
77
- if (voxel && voxel.isRenderable()) {
78
- const normal = calculateNormal([
79
- rayStart[0] + rayDirection[0] * tMax[axis],
80
- rayStart[1] + rayDirection[1] * tMax[axis],
81
- rayStart[2] + rayDirection[2] * tMax[axis],
82
- ], [pos[0] * voxelSize, pos[1] * voxelSize, pos[2] * voxelSize], [
83
- pos[0] * voxelSize + voxelSize,
84
- pos[1] * voxelSize + voxelSize,
85
- pos[2] * voxelSize + voxelSize,
86
- ]);
87
- const rd = Vector3Like.Create(...rayDirection);
88
- const urd = Vector3Like.FromArray(closestUnitNormal(rd));
89
- const n = Vector3Like.Create(...normal);
90
- const un = Vector3Like.FromArray(closestUnitNormal(n));
91
- return new VoxelPickResult(Vector3Like.Create(...rayStart), rd, rayLength, voxel.getRaw(), Vector3Like.Create(...pos), n, tMax[axis], Vector3Like.Create(...Vec3ArrayLike.Add(pos, normal)), Vector3Like.FromArray(closestUnitNormal(rd)), closestVoxelFace(urd), Vector3Like.FromArray(closestUnitNormal(n)), closestVoxelFace(un), 0);
69
+ if (traveled - tEnter > maxDist) {
70
+ break;
92
71
  }
93
72
  }
94
73
  return null;
@@ -1,9 +1,9 @@
1
1
  import { Vector3Like } from "@amodx/math";
2
2
  import PickVoxel from "./PickVoxel";
3
- import { Axes } from "@amodx/math/Vectors/Axes";
4
3
  import { WorldSpaces } from "../../../World/WorldSpaces";
5
4
  import { WorldRegister } from "../../../World/WorldRegister";
6
5
  import { SectorCursor } from "../../../World/Cursor/SectorCursor";
6
+ const epsilon = 1e-5;
7
7
  /**# PickVoxelWorld
8
8
  * Will pick the voxel world and make sure each sector is available before picking it.
9
9
  *
@@ -12,55 +12,30 @@ import { SectorCursor } from "../../../World/Cursor/SectorCursor";
12
12
  export default async function PickVoxelWorld(cursor, rayStart, rayDirection, rayLength) {
13
13
  let t = 0;
14
14
  const d = 8;
15
- const rayPosition = Vector3Like.Create(...rayStart);
16
- const rd = Vector3Like.Create(...rayDirection);
17
- const rayRight = Vector3Like.Cross(rd, Axes.UpReadOnly());
18
- const rayUp = Vector3Like.Cross(rayRight, rd);
19
- const cubeSize = 16.0;
20
- const halfSize = cubeSize / 2.0;
21
- const rayDirectionScaled = Vector3Like.MultiplyScalar(rd, halfSize);
22
- const rayRightScaled = Vector3Like.MultiplyScalar(rayRight, halfSize);
23
- const rayUpScaled = Vector3Like.MultiplyScalar(rayUp, halfSize);
24
- const finalRayCubeDirection = Vector3Like.Subtract(Vector3Like.Subtract(rayDirectionScaled, rayRightScaled), rayUpScaled);
25
- const finalMin = Vector3Like.Create();
26
- const finalMax = Vector3Like.Create();
27
- const { x: sectorSizeX, y: sectorSizeY, z: sectorSizeZ, } = WorldSpaces.sector.bounds;
15
+ const rayDir = Vector3Like.Create(...rayDirection);
16
+ const rayPosition = Vector3Like.Create();
28
17
  const visited = new Set();
29
18
  const sectorCursor = new SectorCursor();
19
+ const safeDirection = Vector3Like.Create(Math.abs(rayDir.x) < epsilon ? epsilon : rayDir.x, Math.abs(rayDir.y) < epsilon ? epsilon : rayDir.y, Math.abs(rayDir.z) < epsilon ? epsilon : rayDir.z);
30
20
  while (t < rayLength) {
31
- rayPosition.x = rayStart[0] + t * rayDirection[0];
32
- rayPosition.y = rayStart[1] + t * rayDirection[1];
33
- rayPosition.z = rayStart[2] + t * rayDirection[2];
21
+ rayPosition.x = rayStart[0] + t * safeDirection.x;
22
+ rayPosition.y = rayStart[1] + t * safeDirection.y;
23
+ rayPosition.z = rayStart[2] + t * safeDirection.z;
34
24
  t += d;
35
- const min = WorldSpaces.sector.getPosition(...Vector3Like.ToArray(Vector3Like.Subtract(rayPosition, finalRayCubeDirection)));
36
- const max = WorldSpaces.sector.getPosition(...Vector3Like.ToArray(Vector3Like.Add(rayPosition, finalRayCubeDirection)));
37
- max.x < min.x ? (finalMin.x = max.x) : (finalMin.x = min.x);
38
- max.y < min.y ? (finalMin.y = max.y) : (finalMin.y = min.y);
39
- max.z < min.z ? (finalMin.z = max.z) : (finalMin.z = min.z);
40
- min.x > max.x ? (finalMax.x = min.x) : (finalMax.x = max.x);
41
- min.y > max.y ? (finalMax.y = min.y) : (finalMax.y = max.y);
42
- min.z > max.z ? (finalMax.z = min.z) : (finalMax.z = max.z);
43
- const { x: sx, y: sy, z: sz } = finalMin;
44
- const { x: ex, y: ey, z: ez } = finalMax;
45
- for (let x = sx - sectorSizeX; x < ex + sectorSizeX; x += sectorSizeX) {
46
- for (let z = sz - sectorSizeZ; z < ez + sectorSizeZ; z += sectorSizeZ) {
47
- for (let y = sy - sectorSizeY; y < ey + sectorSizeY; y += sectorSizeY) {
48
- if (!WorldSpaces.world.inBounds(x, y, z))
49
- continue;
50
- const sector = WorldRegister.sectors.get(cursor.dimension, x, y, z);
51
- if (!sector)
52
- continue;
53
- if (visited.has(sector))
54
- continue;
55
- visited.add(sector);
56
- await sector.waitTillCheckedIn();
57
- sectorCursor.loadSector(cursor.dimension, x, y, z);
58
- const result = PickVoxel(sectorCursor, rayStart, rayDirection, rayLength);
59
- if (result !== null)
60
- return result;
61
- }
62
- }
63
- }
25
+ const { x, y, z } = WorldSpaces.sector.transformPosition(rayPosition);
26
+ if (!WorldSpaces.world.inBounds(x, y, z))
27
+ continue;
28
+ const sector = WorldRegister.sectors.get(cursor.dimension, x, y, z);
29
+ if (!sector)
30
+ continue;
31
+ if (visited.has(sector))
32
+ continue;
33
+ visited.add(sector);
34
+ await sector.waitTillCheckedIn();
35
+ sectorCursor.loadSector(cursor.dimension, x, y, z);
36
+ const result = PickVoxel(sectorCursor, rayStart, rayDirection, rayLength);
37
+ if (result !== null)
38
+ return result;
64
39
  }
65
40
  return null;
66
41
  }
@@ -46,5 +46,6 @@ export declare class VoxelPickResult implements VoxelPickResultData {
46
46
  voxel: VoxelCursor;
47
47
  static FromJSON(data: VoxelPickResultData): VoxelPickResult;
48
48
  constructor(rayOrigin: Vector3Like, rayDirection: Vector3Like, rayLength: number, voxelData: RawVoxelData, position: Vector3Like, normal: Vector3Like, distance: number, normalPosition: Vector3Like, unitRayDirection: Vector3Like, unitRayVoxelFace: VoxelFaces, unitNormal: Vector3Like, unitNormalFace: VoxelFaces, delta: number);
49
+ clone(): VoxelPickResult;
49
50
  toJSON(): VoxelPickResultData;
50
51
  }
@@ -35,6 +35,9 @@ export class VoxelPickResult {
35
35
  this.voxel.setRaw(voxelData);
36
36
  this.voxel.loadIn();
37
37
  }
38
+ clone() {
39
+ return VoxelPickResult.FromJSON(this.toJSON());
40
+ }
38
41
  toJSON() {
39
42
  return {
40
43
  rayOrigin: { ...this.rayOrigin },
@@ -3,7 +3,7 @@ import { CulledOcclusionFaceIndexData } from "../Models/Indexing/CulledOcclusion
3
3
  import { VoxelStateSchemaData, StateLogicStatement } from "../State/State.types";
4
4
  import { CullingProcedureData } from "../Models/VoxelModel.types";
5
5
  import { VoxelEffectSyncData } from "../Effects/VoxelEffects.types";
6
- import { CompiledGeomtryNodes } from "../../Mesher/Models/Nodes/Types/GeomtryNode.types";
6
+ import { CompiledGeomtryNodes } from "../../Mesher/Voxels/Models/Nodes/Types/GeomtryNode.types";
7
7
  export type CompiledVoxelGeometrySyncData = {
8
8
  id: string;
9
9
  cullingProcedure: CullingProcedureData;
@@ -1,6 +1,17 @@
1
1
  export const cube = {
2
2
  id: "dve_cube",
3
3
  arguments: {
4
+ allTexs: {
5
+ type: "arg-list",
6
+ arguments: [
7
+ "upTex",
8
+ "downTex",
9
+ "northTex",
10
+ "southTex",
11
+ "eastTex",
12
+ "westTex",
13
+ ],
14
+ },
4
15
  upTex: {
5
16
  type: "texture",
6
17
  },
@@ -765,68 +765,13 @@ export const simpleHalfCube = {
765
765
  };
766
766
  export const pillarCube = {
767
767
  id: "dve_pillar_cube",
768
- relationsSchema: [
769
- {
770
- name: "same-down",
771
- conditions: [
772
- {
773
- type: "same-voxel",
774
- direction: [0, -1, 0],
775
- },
776
- ],
777
- },
778
- {
779
- name: "same-up",
780
- conditions: [
781
- {
782
- type: "same-voxel",
783
- direction: [0, 1, 0],
784
- },
785
- ],
786
- },
787
- {
788
- name: "same-east",
789
- conditions: [
790
- {
791
- type: "same-voxel",
792
- direction: [1, 0, 0],
793
- },
794
- ],
795
- },
796
- {
797
- name: "same-west",
798
- conditions: [
799
- {
800
- type: "same-voxel",
801
- direction: [-1, 0, 0],
802
- },
803
- ],
804
- },
805
- {
806
- name: "same-north",
807
- conditions: [
808
- {
809
- type: "same-voxel",
810
- direction: [0, 0, 1],
811
- },
812
- ],
813
- },
814
- {
815
- name: "same-south",
816
- conditions: [
817
- {
818
- type: "same-voxel",
819
- direction: [0, 0, -1],
820
- },
821
- ],
822
- },
823
- ],
768
+ relationsSchema: [],
824
769
  stateSchema: [
825
770
  {
826
771
  name: "direction",
827
772
  bitIndex: 0,
828
773
  bitSize: 2,
829
- values: ["down-up", "south-north", "west-east"],
774
+ values: ["up-down", "north-south", "east-west"],
830
775
  },
831
776
  ],
832
777
  arguments: {
@@ -854,65 +799,65 @@ export const pillarCube = {
854
799
  dve_placing_strategy: "*",
855
800
  },
856
801
  stateNodes: {
857
- "direction=down-up,same-down=false,same-up=false": [
802
+ "direction=up-down": [
858
803
  {
859
804
  geometryId: "dve_cube",
860
805
  inputs: {
861
- upTex: "@upTex",
862
- downTex: "@downTex",
863
- northTex: "@sideDisconnectedTex",
864
- southTex: "@sideDisconnectedTex",
865
- eastTex: "@sideDisconnectedTex",
866
- westTex: "@sideDisconnectedTex",
806
+ allTexs: {
807
+ type: "pillar",
808
+ texture: "@sideDisconnectedTex",
809
+ textureRecrod: {
810
+ sideConnectedTex: "@sideConnectedTex",
811
+ sideDisconnectedTex: "@sideDisconnectedTex",
812
+ sideUpTex: "@sideUpTex",
813
+ sideDownTex: "@sideDownTex",
814
+ upTex: "@upTex",
815
+ downTex: "@downTex",
816
+ },
817
+ direction: "up-down",
818
+ },
867
819
  },
868
820
  },
869
821
  ],
870
- "direction=down-up,same-down=true,same-up=false": [
822
+ "direction=east-west": [
871
823
  {
872
824
  geometryId: "dve_cube",
873
825
  inputs: {
874
- upTex: "@upTex",
875
- downTex: "@downTex",
876
- northTex: "@sideUpTex",
877
- southTex: "@sideUpTex",
878
- eastTex: "@sideUpTex",
879
- westTex: "@sideUpTex",
826
+ allTexs: {
827
+ type: "pillar",
828
+ texture: "@sideDisconnectedTex",
829
+ textureRecrod: {
830
+ sideConnectedTex: "@sideConnectedTex",
831
+ sideDisconnectedTex: "@sideDisconnectedTex",
832
+ sideUpTex: "@sideUpTex",
833
+ sideDownTex: "@sideDownTex",
834
+ upTex: "@upTex",
835
+ downTex: "@downTex",
836
+ },
837
+ direction: "east-west",
838
+ },
880
839
  },
881
840
  },
882
841
  ],
883
- "direction=down-up,same-down=false,same-up=true": [
842
+ "direction=north-south": [
884
843
  {
885
844
  geometryId: "dve_cube",
886
845
  inputs: {
887
- upTex: "@upTex",
888
- downTex: "@downTex",
889
- northTex: "@sideDownTex",
890
- southTex: "@sideDownTex",
891
- eastTex: "@sideDownTex",
892
- westTex: "@sideDownTex",
893
- },
894
- },
895
- ],
896
- "direction=down-up,same-down=true,same-up=true": [
897
- {
898
- geometryId: "dve_cube",
899
- inputs: {
900
- upTex: "@upTex",
901
- downTex: "@downTex",
902
- northTex: "@sideConnectedTex",
903
- southTex: "@sideConnectedTex",
904
- eastTex: "@sideConnectedTex",
905
- westTex: "@sideConnectedTex",
846
+ allTexs: {
847
+ type: "pillar",
848
+ texture: "@sideDisconnectedTex",
849
+ textureRecrod: {
850
+ sideConnectedTex: "@sideConnectedTex",
851
+ sideDisconnectedTex: "@sideDisconnectedTex",
852
+ sideUpTex: "@sideUpTex",
853
+ sideDownTex: "@sideDownTex",
854
+ upTex: "@upTex",
855
+ downTex: "@downTex",
856
+ },
857
+ direction: "north-south",
858
+ },
906
859
  },
907
860
  },
908
861
  ],
909
- "direction=south-north,same-south=false,same-north=false": [],
910
- "direction=south-north,same-south=true,same-north=false": [],
911
- "direction=south-north,same-south=false,same-north=true": [],
912
- "direction=south-north,same-south=true,same-north=true": [],
913
- "direction=west-east,same-west=false,same-east=false": [],
914
- "direction=west-east,same-west=true,same-east=false": [],
915
- "direction=west-east,same-west=false,same-east=true": [],
916
- "direction=west-east,same-west=true,same-east=true": [],
917
862
  },
918
863
  };
@@ -1,6 +1,4 @@
1
1
  import { VoxelGeometryData } from "../VoxelModel.types";
2
2
  export declare const diagonalFlatPanelWestEast: VoxelGeometryData;
3
3
  export declare const diagonalFlatPanelEastWest: VoxelGeometryData;
4
- export declare const thinPanelDown: VoxelGeometryData;
5
- export declare const thinPanelSouth: VoxelGeometryData;
6
- export declare const thinPanelWest: VoxelGeometryData;
4
+ export declare const thinPanel: VoxelGeometryData;