@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
@@ -0,0 +1,77 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ export class CylinderVoxelShapeSelection {
4
+ static Type = "cylinder-shape";
5
+ static CreateNew(data) {
6
+ return {
7
+ type: CylinderVoxelShapeSelection.Type,
8
+ origin: data.origin || Vector3Like.Create(),
9
+ bounds: data.bounds ||
10
+ Vector3Like.Create(data.width || 1, data.height || 1, data.depth || 1),
11
+ width: data.width || 1,
12
+ height: data.height || 1,
13
+ depth: data.depth || 1,
14
+ };
15
+ }
16
+ origin = Vector3Like.Create();
17
+ bounds = new BoundingBox();
18
+ _width = 1;
19
+ get width() {
20
+ return this._width;
21
+ }
22
+ set width(width) {
23
+ this._width = width;
24
+ this._updateBounds();
25
+ }
26
+ _height = 1;
27
+ get height() {
28
+ return this._height;
29
+ }
30
+ set height(height) {
31
+ this._height = height;
32
+ this._updateBounds();
33
+ }
34
+ _depth = 1;
35
+ get depth() {
36
+ return this._depth;
37
+ }
38
+ set depth(depth) {
39
+ this._depth = depth;
40
+ this._updateBounds();
41
+ }
42
+ _updateBounds() {
43
+ this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
44
+ }
45
+ isSelected(x, y, z) {
46
+ let rx = x - this.origin.x;
47
+ let ry = y - this.origin.y;
48
+ let rz = z - this.origin.z;
49
+ if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
50
+ return false;
51
+ return true;
52
+ }
53
+ clone() {
54
+ const newTemplate = new CylinderVoxelShapeSelection();
55
+ newTemplate.fromJSON(this.toJSON());
56
+ return newTemplate;
57
+ }
58
+ toJSON() {
59
+ return {
60
+ type: CylinderVoxelShapeSelection.Type,
61
+ origin: { ...this.origin },
62
+ bounds: { ...this.bounds.size },
63
+ width: this._width,
64
+ height: this._height,
65
+ depth: this._depth,
66
+ };
67
+ }
68
+ fromJSON(data) {
69
+ this.origin.x = data.origin.x;
70
+ this.origin.y = data.origin.y;
71
+ this.origin.z = data.origin.z;
72
+ this._width = data.width;
73
+ this._height = data.height;
74
+ this._depth = data.depth;
75
+ this._updateBounds();
76
+ }
77
+ }
@@ -0,0 +1,28 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
4
+ export interface EllipsoidVoxelShapeSelectionData extends IVoxelShapeSelectionData<"ellipsoid-shape"> {
5
+ radiusX: number;
6
+ radiusY: number;
7
+ radiusZ: number;
8
+ }
9
+ export declare class EllipsoidVoxelShapeSelection implements IVoxelShapeSelection<"ellipsoid-shape", EllipsoidVoxelShapeSelectionData> {
10
+ static readonly Type = "ellipsoid-shape";
11
+ static CreateNew(data: Partial<EllipsoidVoxelShapeSelectionData>): EllipsoidVoxelShapeSelectionData;
12
+ origin: Vector3Like;
13
+ bounds: BoundingBox;
14
+ private _radiusX;
15
+ get radiusX(): number;
16
+ set radiusX(radius: number);
17
+ private _radiusY;
18
+ get radiusY(): number;
19
+ set radiusY(radius: number);
20
+ private _radiusZ;
21
+ get radiusZ(): number;
22
+ set radiusZ(radius: number);
23
+ private _updateBounds;
24
+ isSelected(x: number, y: number, z: number): boolean;
25
+ clone(): EllipsoidVoxelShapeSelection;
26
+ toJSON(): EllipsoidVoxelShapeSelectionData;
27
+ fromJSON(data: EllipsoidVoxelShapeSelectionData): void;
28
+ }
@@ -0,0 +1,92 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ export class EllipsoidVoxelShapeSelection {
4
+ static Type = "ellipsoid-shape";
5
+ static CreateNew(data) {
6
+ return {
7
+ type: EllipsoidVoxelShapeSelection.Type,
8
+ origin: data.origin || Vector3Like.Create(),
9
+ bounds: data.bounds || Vector3Like.Create(),
10
+ radiusX: data.radiusX || 5,
11
+ radiusY: data.radiusY || 5,
12
+ radiusZ: data.radiusZ || 5,
13
+ };
14
+ }
15
+ origin = Vector3Like.Create();
16
+ bounds = new BoundingBox();
17
+ _radiusX = 0;
18
+ get radiusX() {
19
+ return this._radiusX;
20
+ }
21
+ set radiusX(radius) {
22
+ const oldRadius = this._radiusX;
23
+ this._radiusX = radius;
24
+ if (oldRadius != radius) {
25
+ this._updateBounds();
26
+ }
27
+ }
28
+ _radiusY = 0;
29
+ get radiusY() {
30
+ return this._radiusY;
31
+ }
32
+ set radiusY(radius) {
33
+ const oldRadius = this._radiusY;
34
+ this._radiusY = radius;
35
+ if (oldRadius != radius) {
36
+ this._updateBounds();
37
+ }
38
+ }
39
+ _radiusZ = 0;
40
+ get radiusZ() {
41
+ return this._radiusZ;
42
+ }
43
+ set radiusZ(radius) {
44
+ const oldRadius = this._radiusZ;
45
+ this._radiusZ = radius;
46
+ if (oldRadius != radius) {
47
+ this._updateBounds();
48
+ }
49
+ }
50
+ _updateBounds() {
51
+ this.bounds.setSize(Vector3Like.Create(this._radiusX * 2 + 1, this._radiusY * 2 + 1, this._radiusZ * 2 + 1));
52
+ }
53
+ isSelected(x, y, z) {
54
+ let rx = x - this.origin.x;
55
+ let ry = y - this.origin.y;
56
+ let rz = z - this.origin.z;
57
+ if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
58
+ return false;
59
+ const cx = Math.floor(this.bounds.size.x / 2);
60
+ const cy = Math.floor(this.bounds.size.y / 2);
61
+ const cz = Math.floor(this.bounds.size.z / 2);
62
+ const normX = (rx - cx) / this.radiusX;
63
+ const normY = (ry - cy) / this.radiusY;
64
+ const normZ = (rz - cz) / this.radiusZ;
65
+ const distance = Math.sqrt(normX * normX + normY * normY + normZ * normZ);
66
+ return distance <= 1;
67
+ }
68
+ clone() {
69
+ const newTemplate = new EllipsoidVoxelShapeSelection();
70
+ newTemplate.fromJSON(this.toJSON());
71
+ return newTemplate;
72
+ }
73
+ toJSON() {
74
+ return {
75
+ type: "ellipsoid-shape",
76
+ origin: { ...this.origin },
77
+ bounds: { ...this.bounds.size },
78
+ radiusX: this._radiusX,
79
+ radiusY: this._radiusY,
80
+ radiusZ: this._radiusZ,
81
+ };
82
+ }
83
+ fromJSON(data) {
84
+ this.origin.x = data.origin.x;
85
+ this.origin.y = data.origin.y;
86
+ this.origin.z = data.origin.z;
87
+ this._radiusX = data.radiusX;
88
+ this._radiusY = data.radiusY;
89
+ this._radiusZ = data.radiusZ;
90
+ this._updateBounds();
91
+ }
92
+ }
@@ -0,0 +1,28 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
4
+ export interface OctahedronVoxelShapeSelectionData extends IVoxelShapeSelectionData<"octahedron-shape"> {
5
+ width: number;
6
+ height: number;
7
+ depth: number;
8
+ }
9
+ export declare class OctahedronVoxelShapeSelection implements IVoxelShapeSelection<"octahedron-shape", OctahedronVoxelShapeSelectionData> {
10
+ static readonly Type = "octahedron-shape";
11
+ static CreateNew(data: Partial<OctahedronVoxelShapeSelectionData>): OctahedronVoxelShapeSelectionData;
12
+ origin: Vector3Like;
13
+ bounds: BoundingBox;
14
+ _width: number;
15
+ get width(): number;
16
+ set width(width: number);
17
+ _height: number;
18
+ get height(): number;
19
+ set height(height: number);
20
+ _depth: number;
21
+ get depth(): number;
22
+ set depth(depth: number);
23
+ private _updateBounds;
24
+ isSelected(x: number, y: number, z: number): boolean;
25
+ clone(): OctahedronVoxelShapeSelection;
26
+ toJSON(): OctahedronVoxelShapeSelectionData;
27
+ fromJSON(data: OctahedronVoxelShapeSelectionData): void;
28
+ }
@@ -0,0 +1,76 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ export class OctahedronVoxelShapeSelection {
4
+ static Type = "octahedron-shape";
5
+ static CreateNew(data) {
6
+ return {
7
+ type: OctahedronVoxelShapeSelection.Type,
8
+ origin: data.origin || Vector3Like.Create(),
9
+ bounds: data.bounds || Vector3Like.Create(),
10
+ width: data.width || 1,
11
+ height: data.height || 1,
12
+ depth: data.depth || 1,
13
+ };
14
+ }
15
+ origin = Vector3Like.Create();
16
+ bounds = new BoundingBox();
17
+ _width = 1;
18
+ get width() {
19
+ return this._width;
20
+ }
21
+ set width(width) {
22
+ this._width = width;
23
+ this._updateBounds();
24
+ }
25
+ _height = 1;
26
+ get height() {
27
+ return this._height;
28
+ }
29
+ set height(height) {
30
+ this._height = height;
31
+ this._updateBounds();
32
+ }
33
+ _depth = 1;
34
+ get depth() {
35
+ return this._depth;
36
+ }
37
+ set depth(depth) {
38
+ this._depth = depth;
39
+ this._updateBounds();
40
+ }
41
+ _updateBounds() {
42
+ this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
43
+ }
44
+ isSelected(x, y, z) {
45
+ let rx = x - this.origin.x;
46
+ let ry = y - this.origin.y;
47
+ let rz = z - this.origin.z;
48
+ if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
49
+ return false;
50
+ return true;
51
+ }
52
+ clone() {
53
+ const newTemplate = new OctahedronVoxelShapeSelection();
54
+ newTemplate.fromJSON(this.toJSON());
55
+ return newTemplate;
56
+ }
57
+ toJSON() {
58
+ return {
59
+ type: "octahedron-shape",
60
+ origin: { ...this.origin },
61
+ bounds: { ...this.bounds.size },
62
+ width: this._width,
63
+ height: this._height,
64
+ depth: this._depth,
65
+ };
66
+ }
67
+ fromJSON(data) {
68
+ this.origin.x = data.origin.x;
69
+ this.origin.y = data.origin.y;
70
+ this.origin.z = data.origin.z;
71
+ this._width = data.width;
72
+ this._height = data.height;
73
+ this._depth = data.depth;
74
+ this._updateBounds();
75
+ }
76
+ }
@@ -0,0 +1,37 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ import { VoxelShapeShapeDirections } from "../VoxelShape.types";
4
+ import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
5
+ export interface PyramidVoxelShapeSelectionData extends IVoxelShapeSelectionData<"pyramid-shape"> {
6
+ width: number;
7
+ height: number;
8
+ depth: number;
9
+ fallOff: number;
10
+ direction: VoxelShapeShapeDirections;
11
+ }
12
+ export declare class PyramidVoxelShapeSelection implements IVoxelShapeSelection<"pyramid-shape", PyramidVoxelShapeSelectionData> {
13
+ static readonly Type = "pyramid-shape";
14
+ static CreateNew(data: Partial<PyramidVoxelShapeSelectionData>): PyramidVoxelShapeSelectionData;
15
+ origin: Vector3Like;
16
+ bounds: BoundingBox;
17
+ private _fallOff;
18
+ get fallOff(): number;
19
+ set fallOff(fallOFf: number);
20
+ private _direction;
21
+ get direction(): VoxelShapeShapeDirections;
22
+ set direction(direction: VoxelShapeShapeDirections);
23
+ _width: number;
24
+ get width(): number;
25
+ set width(width: number);
26
+ _height: number;
27
+ get height(): number;
28
+ set height(height: number);
29
+ _depth: number;
30
+ get depth(): number;
31
+ set depth(depth: number);
32
+ private _updateBounds;
33
+ isSelected(x: number, y: number, z: number): boolean;
34
+ clone(): PyramidVoxelShapeSelection;
35
+ toJSON(): PyramidVoxelShapeSelectionData;
36
+ fromJSON(data: PyramidVoxelShapeSelectionData): void;
37
+ }
@@ -0,0 +1,137 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ export class PyramidVoxelShapeSelection {
4
+ static Type = "pyramid-shape";
5
+ static CreateNew(data) {
6
+ return {
7
+ type: PyramidVoxelShapeSelection.Type,
8
+ origin: data.origin || Vector3Like.Create(),
9
+ bounds: data.bounds || Vector3Like.Create(),
10
+ width: data.width || 6,
11
+ height: data.height || 6,
12
+ depth: data.depth || 6,
13
+ fallOff: data.fallOff || 1,
14
+ direction: data.direction || "+y",
15
+ };
16
+ }
17
+ origin = Vector3Like.Create();
18
+ bounds = new BoundingBox();
19
+ _fallOff = 0;
20
+ get fallOff() {
21
+ return this._fallOff;
22
+ }
23
+ set fallOff(fallOFf) {
24
+ this._fallOff = fallOFf;
25
+ }
26
+ _direction = "+y";
27
+ get direction() {
28
+ return this._direction;
29
+ }
30
+ set direction(direction) {
31
+ this._direction = direction;
32
+ }
33
+ _width = 1;
34
+ get width() {
35
+ return this._width;
36
+ }
37
+ set width(width) {
38
+ this._width = width;
39
+ this._updateBounds();
40
+ }
41
+ _height = 1;
42
+ get height() {
43
+ return this._height;
44
+ }
45
+ set height(height) {
46
+ this._height = height;
47
+ this._updateBounds();
48
+ }
49
+ _depth = 1;
50
+ get depth() {
51
+ return this._depth;
52
+ }
53
+ set depth(depth) {
54
+ this._depth = depth;
55
+ this._updateBounds();
56
+ }
57
+ _updateBounds() {
58
+ this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
59
+ }
60
+ isSelected(x, y, z) {
61
+ let rx = x - this.origin.x;
62
+ let ry = y - this.origin.y;
63
+ let rz = z - this.origin.z;
64
+ if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
65
+ return false;
66
+ switch (this.direction) {
67
+ case "+y": {
68
+ // Pyramid pointing up
69
+ const normalizedFallOff = ry * this.fallOff;
70
+ const minX = normalizedFallOff;
71
+ const minZ = normalizedFallOff;
72
+ const maxX = this.width - normalizedFallOff;
73
+ const maxZ = this.depth - normalizedFallOff;
74
+ if (rx >= minX && rz >= minZ && rx < maxX && rz < maxZ)
75
+ return true;
76
+ return false;
77
+ }
78
+ case "-y": {
79
+ // Pyramid pointing down
80
+ const normalizedFallOff = (this.height - 1 - ry) * this.fallOff;
81
+ const minX = normalizedFallOff;
82
+ const minZ = normalizedFallOff;
83
+ const maxX = this.width - normalizedFallOff;
84
+ const maxZ = this.depth - normalizedFallOff;
85
+ if (rx >= minX && rz >= minZ && rx < maxX && rz < maxZ)
86
+ return true;
87
+ return false;
88
+ }
89
+ case "+x": {
90
+ // Pyramid pointing right
91
+ return true;
92
+ }
93
+ case "-x": {
94
+ // Pyramid pointing left
95
+ return true;
96
+ }
97
+ case "+z": {
98
+ // Pyramid pointing forward
99
+ return true;
100
+ }
101
+ case "-z": {
102
+ // Pyramid pointing backward
103
+ return true;
104
+ }
105
+ default:
106
+ return false;
107
+ }
108
+ }
109
+ clone() {
110
+ const newTemplate = new PyramidVoxelShapeSelection();
111
+ newTemplate.fromJSON(this.toJSON());
112
+ return newTemplate;
113
+ }
114
+ toJSON() {
115
+ return {
116
+ type: "pyramid-shape",
117
+ origin: { ...this.origin },
118
+ bounds: { ...this.bounds.size },
119
+ fallOff: this._fallOff,
120
+ direction: this._direction,
121
+ width: this._width,
122
+ height: this._height,
123
+ depth: this._depth,
124
+ };
125
+ }
126
+ fromJSON(data) {
127
+ this.origin.x = data.origin.x;
128
+ this.origin.y = data.origin.y;
129
+ this.origin.z = data.origin.z;
130
+ this._width = data.width;
131
+ this._height = data.height;
132
+ this._depth = data.depth;
133
+ this._direction = data.direction;
134
+ this._fallOff = data.fallOff;
135
+ this._updateBounds();
136
+ }
137
+ }
@@ -0,0 +1,20 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
4
+ export interface SphereVoxelShapeSelectionData extends IVoxelShapeSelectionData<"sphere-shape"> {
5
+ radius: number;
6
+ }
7
+ export declare class SphereVoxelShapeSelection implements IVoxelShapeSelection<"sphere-shape", SphereVoxelShapeSelectionData> {
8
+ static readonly Type = "sphere-shape";
9
+ static CreateNew(data: Partial<SphereVoxelShapeSelectionData>): SphereVoxelShapeSelectionData;
10
+ origin: Vector3Like;
11
+ bounds: BoundingBox;
12
+ _radius: number;
13
+ get radius(): number;
14
+ set radius(radius: number);
15
+ private _updateBounds;
16
+ isSelected(x: number, y: number, z: number): boolean;
17
+ clone(): SphereVoxelShapeSelection;
18
+ toJSON(): SphereVoxelShapeSelectionData;
19
+ fromJSON(data: SphereVoxelShapeSelectionData): void;
20
+ }
@@ -0,0 +1,61 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ export class SphereVoxelShapeSelection {
4
+ static Type = "sphere-shape";
5
+ static CreateNew(data) {
6
+ return {
7
+ type: SphereVoxelShapeSelection.Type,
8
+ origin: data.origin || Vector3Like.Create(),
9
+ bounds: data.bounds || Vector3Like.Create(),
10
+ radius: data.radius || 2,
11
+ };
12
+ }
13
+ origin = Vector3Like.Create();
14
+ bounds = new BoundingBox();
15
+ _radius = 1;
16
+ get radius() {
17
+ return this._radius;
18
+ }
19
+ set radius(radius) {
20
+ this._radius = radius;
21
+ this._updateBounds();
22
+ }
23
+ _updateBounds() {
24
+ this.bounds.setSize(Vector3Like.Create(this._radius * 2 + 1, this._radius * 2 + 1, this._radius * 2 + 1));
25
+ }
26
+ isSelected(x, y, z) {
27
+ let rx = x - this.origin.x;
28
+ let ry = y - this.origin.y;
29
+ let rz = z - this.origin.z;
30
+ if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
31
+ return false;
32
+ const cx = Math.floor(this.bounds.size.x / 2);
33
+ const cy = Math.floor(this.bounds.size.y / 2);
34
+ const cz = Math.floor(this.bounds.size.z / 2);
35
+ const normX = (rx - cx) / this.radius;
36
+ const normY = (ry - cy) / this.radius;
37
+ const normZ = (rz - cz) / this.radius;
38
+ const distance = Math.sqrt(normX * normX + normY * normY + normZ * normZ);
39
+ return distance <= 1;
40
+ }
41
+ clone() {
42
+ const newTemplate = new SphereVoxelShapeSelection();
43
+ newTemplate.fromJSON(this.toJSON());
44
+ return newTemplate;
45
+ }
46
+ toJSON() {
47
+ return {
48
+ type: "sphere-shape",
49
+ origin: { ...this.origin },
50
+ bounds: { ...this.bounds.size },
51
+ radius: this._radius,
52
+ };
53
+ }
54
+ fromJSON(data) {
55
+ this.origin.x = data.origin.x;
56
+ this.origin.y = data.origin.y;
57
+ this.origin.z = data.origin.z;
58
+ this.radius = data.radius;
59
+ this._updateBounds();
60
+ }
61
+ }
@@ -0,0 +1,28 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ import { IVoxelShapeSelection, IVoxelShapeSelectionData } from "./VoxelShapeSelection";
4
+ export interface TorusVoxelShapeSelectionData extends IVoxelShapeSelectionData<"torus-shape"> {
5
+ width: number;
6
+ height: number;
7
+ depth: number;
8
+ }
9
+ export declare class TorusVoxelShapeSelection implements IVoxelShapeSelection<"torus-shape", TorusVoxelShapeSelectionData> {
10
+ static readonly Type = "torus-shape";
11
+ static CreateNew(data: Partial<TorusVoxelShapeSelectionData>): TorusVoxelShapeSelectionData;
12
+ origin: Vector3Like;
13
+ bounds: BoundingBox;
14
+ _width: number;
15
+ get width(): number;
16
+ set width(width: number);
17
+ _height: number;
18
+ get height(): number;
19
+ set height(height: number);
20
+ _depth: number;
21
+ get depth(): number;
22
+ set depth(depth: number);
23
+ private _updateBounds;
24
+ isSelected(x: number, y: number, z: number): boolean;
25
+ clone(): TorusVoxelShapeSelection;
26
+ toJSON(): TorusVoxelShapeSelectionData;
27
+ fromJSON(data: TorusVoxelShapeSelectionData): void;
28
+ }
@@ -0,0 +1,76 @@
1
+ import { Vector3Like } from "@amodx/math";
2
+ import { BoundingBox } from "@amodx/math/Geomtry/Bounds/BoundingBox";
3
+ export class TorusVoxelShapeSelection {
4
+ static Type = "torus-shape";
5
+ static CreateNew(data) {
6
+ return {
7
+ type: TorusVoxelShapeSelection.Type,
8
+ origin: data.origin || Vector3Like.Create(),
9
+ bounds: data.bounds || Vector3Like.Create(),
10
+ width: data.width || 1,
11
+ height: data.height || 1,
12
+ depth: data.depth || 1,
13
+ };
14
+ }
15
+ origin = Vector3Like.Create();
16
+ bounds = new BoundingBox();
17
+ _width = 1;
18
+ get width() {
19
+ return this._width;
20
+ }
21
+ set width(width) {
22
+ this._width = width;
23
+ this._updateBounds();
24
+ }
25
+ _height = 1;
26
+ get height() {
27
+ return this._height;
28
+ }
29
+ set height(height) {
30
+ this._height = height;
31
+ this._updateBounds();
32
+ }
33
+ _depth = 1;
34
+ get depth() {
35
+ return this._depth;
36
+ }
37
+ set depth(depth) {
38
+ this._depth = depth;
39
+ this._updateBounds();
40
+ }
41
+ _updateBounds() {
42
+ this.bounds.setSize(Vector3Like.Create(this._width, this._height, this._depth));
43
+ }
44
+ isSelected(x, y, z) {
45
+ let rx = x - this.origin.x;
46
+ let ry = y - this.origin.y;
47
+ let rz = z - this.origin.z;
48
+ if (!this.bounds.intersectsXYZ(rx + 0.5, ry + 0.5, rz + 0.5))
49
+ return false;
50
+ return true;
51
+ }
52
+ clone() {
53
+ const newTemplate = new TorusVoxelShapeSelection();
54
+ newTemplate.fromJSON(this.toJSON());
55
+ return newTemplate;
56
+ }
57
+ toJSON() {
58
+ return {
59
+ type: "torus-shape",
60
+ origin: { ...this.origin },
61
+ bounds: { ...this.bounds.size },
62
+ width: this._width,
63
+ height: this._height,
64
+ depth: this._depth,
65
+ };
66
+ }
67
+ fromJSON(data) {
68
+ this.origin.x = data.origin.x;
69
+ this.origin.y = data.origin.y;
70
+ this.origin.z = data.origin.z;
71
+ this._width = data.width;
72
+ this._height = data.height;
73
+ this._depth = data.depth;
74
+ this._updateBounds();
75
+ }
76
+ }
@@ -0,0 +1,5 @@
1
+ import { IVoxelSelection, IVoxelSelectionData } from "../../Selection/VoxelSelection";
2
+ export interface IVoxelShapeSelectionData<Type extends string> extends IVoxelSelectionData<Type> {
3
+ }
4
+ export interface IVoxelShapeSelection<Type extends string, Data extends IVoxelShapeSelectionData<Type>> extends IVoxelSelection<Type, Data> {
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type VoxelShapeShapeDirections = "+x" | "-x" | "+y" | "-y" | "+z" | "-z";
2
+ export declare const VoxelShapeShapeDirectionsArray: VoxelShapeShapeDirections[];
@@ -0,0 +1,8 @@
1
+ export const VoxelShapeShapeDirectionsArray = [
2
+ "+x",
3
+ "-x",
4
+ "+y",
5
+ "-y",
6
+ "+z",
7
+ "-z",
8
+ ];