@divinevoxel/vlox 0.0.76 → 0.0.78

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 (315) hide show
  1. package/Builder/Tools/Brush/BrushTool.d.ts +16 -9
  2. package/Builder/Tools/Brush/BrushTool.js +258 -52
  3. package/Builder/Tools/BuilderToolBase.d.ts +36 -0
  4. package/Builder/Tools/BuilderToolBase.js +39 -0
  5. package/Builder/Tools/Hand/HandTool.d.ts +9 -7
  6. package/Builder/Tools/Hand/HandTool.js +40 -23
  7. package/Builder/Tools/Path/PahtTool.d.ts +12 -7
  8. package/Builder/Tools/Path/PahtTool.js +32 -21
  9. package/Builder/Tools/Sculpt/SculptTool.d.ts +34 -0
  10. package/Builder/Tools/Sculpt/SculptTool.js +102 -0
  11. package/Builder/Tools/Shape/ShapeTool.d.ts +32 -0
  12. package/Builder/Tools/Shape/ShapeTool.js +78 -0
  13. package/Builder/Tools/Template/TemplateTool.d.ts +35 -0
  14. package/Builder/Tools/Template/TemplateTool.js +73 -0
  15. package/Builder/Tools/Wand/WandTool.d.ts +9 -7
  16. package/Builder/Tools/Wand/WandTool.js +43 -20
  17. package/Builder/Tools/Wrench/WrenchTool.d.ts +7 -7
  18. package/Builder/Tools/Wrench/WrenchTool.js +22 -13
  19. package/Builder/Util/FreeBoxSelection.d.ts +12 -0
  20. package/Builder/Util/FreeBoxSelection.js +21 -0
  21. package/Builder/Util/FreePointSelection.d.ts +14 -0
  22. package/Builder/Util/FreePointSelection.js +39 -0
  23. package/Builder/Util/SurfaceBoxSelection.d.ts +12 -0
  24. package/Builder/{Tools/Box/BoxSelection.js → Util/SurfaceBoxSelection.js} +1 -3
  25. package/Builder/VoxelBuildSpace.d.ts +37 -25
  26. package/Builder/VoxelBuildSpace.js +99 -40
  27. package/Builder/World/InitTasks.js +17 -22
  28. package/Mesher/Geomtry/Proto/ProtoMesh.d.ts +18 -0
  29. package/Mesher/Geomtry/Proto/ProtoMesh.js +73 -0
  30. package/Mesher/Geomtry/{VoxelMeshBuffers.d.ts → Proto/ProtoMeshBuffer.d.ts} +2 -2
  31. package/Mesher/Geomtry/{VoxelMeshBuffers.js → Proto/ProtoMeshBuffer.js} +2 -2
  32. package/Mesher/Geomtry/Shapes/Box.d.ts +2 -9
  33. package/Mesher/Geomtry/Shapes/Box.js +7 -12
  34. package/Mesher/Geomtry/Transform/TransformBox.js +5 -2
  35. package/Mesher/InitMesher.js +4 -4
  36. package/Mesher/InitTask.js +2 -2
  37. package/Mesher/Items/Base/CompactItemMesh.d.ts +3 -0
  38. package/Mesher/Items/Base/CompactItemMesh.js +20 -0
  39. package/Mesher/Items/Geomtry/ItemGeometryBuilder.d.ts +5 -0
  40. package/Mesher/Items/Geomtry/ItemGeometryBuilder.js +131 -0
  41. package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.d.ts +48 -0
  42. package/Mesher/Items/Geomtry/ItemMeshVertexStructCursor.js +114 -0
  43. package/Mesher/Items/MeshTexture.d.ts +1 -0
  44. package/Mesher/Items/MeshTexture.js +214 -0
  45. package/Mesher/Items/MeshTextureO.js +277 -0
  46. package/Mesher/Items/Models/ItemModelBuilder.d.ts +27 -0
  47. package/Mesher/Items/Models/ItemModelBuilder.js +64 -0
  48. package/Mesher/Types/ItemMesh.types.d.ts +5 -0
  49. package/Mesher/Types/ItemMesh.types.js +12 -0
  50. package/Mesher/Types/Mesher.types.d.ts +15 -9
  51. package/Mesher/Types/Mesher.types.js +14 -0
  52. package/Mesher/Types/VoxelMesh.types.js +7 -6
  53. package/Mesher/Voxels/Base/CompactTemplateMesh.d.ts +3 -0
  54. package/Mesher/{Functions/CompactVoxelMesh.js → Voxels/Base/CompactTemplateMesh.js} +4 -40
  55. package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.d.ts +2 -2
  56. package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.d.ts +1 -1
  57. package/Mesher/{Functions → Voxels}/Base/MeshSectionBase.js +9 -8
  58. package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.d.ts +1 -1
  59. package/Mesher/{Geomtry → Voxels/Geomtry}/CompactedSectionVoxelMesh.js +1 -1
  60. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.d.ts +2 -2
  61. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelGeometryBuilder.js +1 -1
  62. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.d.ts +1 -1
  63. package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHBuilder.js +2 -2
  64. package/Mesher/Voxels/MeshTemplate.d.ts +3 -0
  65. package/Mesher/Voxels/MeshTemplate.js +81 -0
  66. package/Mesher/{Functions → Voxels}/MeshVoxel.d.ts +1 -1
  67. package/Mesher/{Functions → Voxels}/MeshVoxel.js +4 -4
  68. package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.d.ts +2 -2
  69. package/Mesher/{Models → Voxels/Models}/Common/Calc/CalcConstants.js +4 -4
  70. package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.d.ts +1 -1
  71. package/Mesher/{Models → Voxels/Models}/Common/Calc/FaceDataCalc.js +2 -2
  72. package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.js +1 -1
  73. package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.d.ts +1 -1
  74. package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.d.ts +1 -1
  75. package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulledFace.js +1 -1
  76. package/Mesher/{Models → Voxels/Models}/Common/GetTexture.d.ts +3 -3
  77. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.d.ts +1 -1
  78. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/FlowGradient.js +1 -1
  79. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +3 -3
  80. package/Mesher/{Models → Voxels/Models}/Nodes/Custom/Liquid/LiquidGeomtryNode.js +14 -16
  81. package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.d.ts +2 -2
  82. package/Mesher/{Models → Voxels/Models}/Nodes/Default/QuadVoxelGeometryNode.js +1 -1
  83. package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.d.ts +2 -2
  84. package/Mesher/{Models → Voxels/Models}/Nodes/Default/TriangleVoxelGeometryNode.js +1 -1
  85. package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +2 -2
  86. package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +1 -1
  87. package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.d.ts +2 -2
  88. package/Mesher/Voxels/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +24 -0
  89. package/Mesher/{Models → Voxels/Models}/Procedures/Default/ConsistentRotationTextureProcedure.js +2 -2
  90. package/Mesher/{Models → Voxels/Models}/Procedures/Default/OutlinedTextureProcedure.d.ts +4 -5
  91. package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +205 -0
  92. package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.d.ts +28 -0
  93. package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +109 -0
  94. package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.d.ts +3 -3
  95. package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.js +2 -0
  96. package/Mesher/{Models → Voxels/Models}/VoxelConstructor.d.ts +4 -4
  97. package/Mesher/{Models → Voxels/Models}/VoxelConstructor.js +3 -3
  98. package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
  99. package/Mesher/{Models → Voxels/Models}/VoxelGeometryBuilderCacheSpace.js +2 -2
  100. package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.d.ts +7 -7
  101. package/Mesher/{Models → Voxels/Models}/VoxelModelBuilder.js +6 -5
  102. package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.d.ts +4 -4
  103. package/Mesher/{Models → Voxels/Models}/VoxelModelConstructorRegister.js +2 -2
  104. package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.d.ts +1 -1
  105. package/Mesher/{Models → Voxels/Models}/VoxelModelEffect.js +1 -1
  106. package/Renderer/Classes/DVESectionMeshes.d.ts +1 -1
  107. package/Renderer/MeshManager.js +1 -1
  108. package/Settings/EngineSettings.types.d.ts +2 -1
  109. package/Settings/EngineSettings.types.js +3 -1
  110. package/Tasks/Paint/Common.js +14 -9
  111. package/Tasks/Paint/Erase/EraseVoxelSelection.d.ts +4 -0
  112. package/Tasks/Paint/Erase/EraseVoxelSelection.js +33 -0
  113. package/Tasks/Paint/Erase/EraseVoxelTemplate.js +1 -2
  114. package/Tasks/Paint/Paint/PaintVoxel.js +1 -1
  115. package/Tasks/Paint/Paint/PaintVoxelTemplate.js +1 -1
  116. package/Tasks/Propagation/Illumanation/RGBUpdate.js +1 -1
  117. package/Tasks/Tasks.types.d.ts +2 -0
  118. package/Tasks/TasksIds.d.ts +1 -0
  119. package/Tasks/TasksIds.js +1 -0
  120. package/Tasks/WorldGeneration/InitTasks.js +3 -1
  121. package/Templates/Archive/ArchivedVoxelTemplate.d.ts +5 -5
  122. package/Templates/Archive/ArchivedVoxelTemplate.js +52 -49
  123. package/Templates/Archive/Functions/CreateArchivedTemplate.js +0 -2
  124. package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +0 -1
  125. package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +0 -2
  126. package/Templates/Cursor/TemplateCursor.d.ts +6 -1
  127. package/Templates/Cursor/TemplateCursor.js +13 -2
  128. package/Templates/Cursor/TemplateProxy.js +1 -6
  129. package/Templates/Cursor/TemplateVoxelCursor.d.ts +1 -0
  130. package/Templates/Cursor/TemplateVoxelCursor.js +6 -0
  131. package/Templates/Full/FullVoxelTemplate.d.ts +4 -4
  132. package/Templates/Full/FullVoxelTemplate.js +29 -18
  133. package/Templates/Functions/ExtrudeSelection.d.ts +5 -0
  134. package/Templates/Functions/ExtrudeSelection.js +44 -0
  135. package/Templates/Functions/FillSelection.d.ts +4 -0
  136. package/Templates/Functions/FillSelection.js +20 -0
  137. package/Templates/Functions/FlipTemplate.d.ts +2 -2
  138. package/Templates/Functions/FlipTemplate.js +8 -8
  139. package/Templates/Functions/RotateTemplate.d.ts +2 -2
  140. package/Templates/Path/VoxelPath.js +2 -1
  141. package/Templates/Selection/VoxelBFSSelection.d.ts +3 -6
  142. package/Templates/Selection/VoxelBFSSelection.js +20 -24
  143. package/Templates/Selection/{VoxelBoxSelection.d.ts → VoxelBoundsSelection.d.ts} +9 -6
  144. package/Templates/Selection/{VoxelBoxSelection.js → VoxelBoundsSelection.js} +29 -22
  145. package/Templates/Selection/VoxelPointSelection.d.ts +8 -6
  146. package/Templates/Selection/VoxelPointSelection.js +25 -24
  147. package/Templates/Selection/VoxelSelection.d.ts +18 -0
  148. package/Templates/Selection/VoxelSurfaceSelection.d.ts +5 -12
  149. package/Templates/Selection/VoxelSurfaceSelection.js +76 -90
  150. package/Templates/Selection/VoxelTemplateSelection.d.ts +10 -4
  151. package/Templates/Selection/VoxelTemplateSelection.js +18 -10
  152. package/Templates/Shapes/Selections/BoxVoxelShapeSelection.d.ts +28 -0
  153. package/Templates/Shapes/Selections/BoxVoxelShapeSelection.js +77 -0
  154. package/Templates/Shapes/Selections/ConeVoxelShapeSelection.d.ts +28 -0
  155. package/Templates/Shapes/Selections/ConeVoxelShapeSelection.js +77 -0
  156. package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.d.ts +28 -0
  157. package/Templates/Shapes/Selections/CylinderVoxelShapeSelection.js +77 -0
  158. package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.d.ts +28 -0
  159. package/Templates/Shapes/Selections/EllipsoidVoxelShapeSelection.js +92 -0
  160. package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.d.ts +28 -0
  161. package/Templates/Shapes/Selections/OctahedronVoxelShapeSelection.js +76 -0
  162. package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.d.ts +37 -0
  163. package/Templates/Shapes/Selections/PyramidVoxelShapeSelection.js +137 -0
  164. package/Templates/Shapes/Selections/SphereVoxelShapeSelection.d.ts +20 -0
  165. package/Templates/Shapes/Selections/SphereVoxelShapeSelection.js +61 -0
  166. package/Templates/Shapes/Selections/TorusVoxelShapeSelection.d.ts +28 -0
  167. package/Templates/Shapes/Selections/TorusVoxelShapeSelection.js +76 -0
  168. package/Templates/Shapes/Selections/VoxelShapeSelection.d.ts +5 -0
  169. package/Templates/Shapes/Selections/VoxelShapeSelection.js +1 -0
  170. package/Templates/Shapes/VoxelShape.types.d.ts +2 -0
  171. package/Templates/Shapes/VoxelShape.types.js +8 -0
  172. package/Templates/Shapes/VoxelShapeTemplate.d.ts +37 -0
  173. package/Templates/Shapes/{BasicVoxelShapeTemplate.js → VoxelShapeTemplate.js} +43 -37
  174. package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +4 -13
  175. package/Templates/Shapes/VoxelShapeTemplate.types.js +0 -1
  176. package/Templates/{VoxelTempateRegister.d.ts → VoxelTemplateRegister.d.ts} +4 -0
  177. package/Templates/VoxelTemplateRegister.js +60 -0
  178. package/Templates/VoxelTemplates.types.d.ts +2 -3
  179. package/Textures/Classes/CompiledTexture.d.ts +2 -0
  180. package/Textures/Classes/CompiledTexture.js +19 -1
  181. package/Textures/Functions/BuildTextureData.js +13 -0
  182. package/Textures/TextureManager.d.ts +1 -0
  183. package/Textures/TextureManager.js +11 -5
  184. package/Tools/Brush/Brush.d.ts +2 -0
  185. package/Tools/Brush/Brush.js +19 -0
  186. package/Tools/Tasks/TasksTool.d.ts +2 -1
  187. package/Tools/Tasks/TasksTool.js +2 -0
  188. package/Voxels/Cursor/DataCursor.interface.d.ts +4 -0
  189. package/Voxels/Cursor/VoxelLightData.js +2 -2
  190. package/Voxels/Functions/BuildTagData.js +1 -1
  191. package/Voxels/Indexes/VoxelIndex.d.ts +1 -0
  192. package/Voxels/Indexes/VoxelIndex.js +11 -13
  193. package/Voxels/InitVoxelData.js +5 -14
  194. package/Voxels/Interaction/Functions/PickVoxel.d.ts +0 -5
  195. package/Voxels/Interaction/Functions/PickVoxel.js +64 -85
  196. package/Voxels/Interaction/Functions/PickVoxelWorld.js +6 -3
  197. package/Voxels/Models/CompiledVoxelModel.types.d.ts +1 -1
  198. package/Voxels/Models/Defaults/CubeVoxelGeometry.js +11 -0
  199. package/Voxels/Models/Defaults/CubeVoxelModels.js +44 -99
  200. package/Voxels/Models/Defaults/PanelVoxelGeometry.d.ts +1 -3
  201. package/Voxels/Models/Defaults/PanelVoxelGeometry.js +2 -226
  202. package/Voxels/Models/Defaults/PanelVoxelModels.d.ts +1 -0
  203. package/Voxels/Models/Defaults/PanelVoxelModels.js +100 -258
  204. package/Voxels/Models/Defaults/StairVoxelModel.js +2 -2
  205. package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +4 -1
  206. package/Voxels/Models/Rules/Classes/GeomtryInput.js +26 -5
  207. package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +1 -1
  208. package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +23 -8
  209. package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +1 -1
  210. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +1 -1
  211. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +1 -1
  212. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +1 -1
  213. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +1 -1
  214. package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +1 -1
  215. package/Voxels/Models/VoxelModel.types.d.ts +6 -1
  216. package/Voxels/Types/PaintVoxelData.d.ts +2 -0
  217. package/Voxels/Types/PaintVoxelData.js +51 -0
  218. package/World/Cursor/SectionCursor.d.ts +4 -0
  219. package/World/Cursor/SectionCursor.js +13 -16
  220. package/World/Cursor/SectorCursor.d.ts +4 -0
  221. package/World/Cursor/SectorCursor.js +13 -16
  222. package/World/Cursor/WorldCursor.d.ts +4 -0
  223. package/World/Cursor/WorldCursor.js +8 -0
  224. package/World/Sector/SectorHeightMap.d.ts +6 -0
  225. package/World/Sector/SectorHeightMap.js +6 -0
  226. package/World/SnapShot/SectionSnapShotCursor.d.ts +3 -0
  227. package/World/SnapShot/SectionSnapShotCursor.js +6 -0
  228. package/World/WorldSpaces.js +3 -3
  229. package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +5 -1
  230. package/WorldSimulation/Dimensions/DimensionSimulation.js +12 -0
  231. package/WorldSimulation/Dimensions/Generator.d.ts +1 -0
  232. package/WorldSimulation/Dimensions/Generator.js +1 -0
  233. package/WorldSimulation/Dimensions/SimulationSector.d.ts +3 -0
  234. package/WorldSimulation/Dimensions/SimulationSector.js +71 -41
  235. package/WorldSimulation/Internal/WorldSimulationTasks.js +5 -2
  236. package/WorldSimulation/Procedures/BuildOnly.d.ts +10 -0
  237. package/WorldSimulation/Procedures/BuildOnly.js +55 -0
  238. package/WorldSimulation/Procedures/InitalLoad.js +3 -0
  239. package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +2 -0
  240. package/WorldSimulation/Tasks/SimulationTaskBase.js +11 -3
  241. package/WorldSimulation/Tasks/TaskSegment.d.ts +2 -1
  242. package/WorldSimulation/Tasks/TaskSegment.js +3 -1
  243. package/WorldSimulation/Tick/TickQueue.d.ts +2 -0
  244. package/WorldSimulation/Tick/TickQueue.js +26 -0
  245. package/WorldSimulation/Tools/SimulationBrush.d.ts +3 -0
  246. package/WorldSimulation/Tools/SimulationBrush.js +52 -0
  247. package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +3 -0
  248. package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -1
  249. package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +2 -0
  250. package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +6 -0
  251. package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +39 -14
  252. package/WorldSimulation/WorldSimulation.d.ts +10 -0
  253. package/WorldSimulation/WorldSimulation.js +41 -1
  254. package/package.json +1 -30
  255. package/Builder/Tools/Box/BoxSelection.d.ts +0 -12
  256. package/Builder/Tools/Box/BoxTool.d.ts +0 -31
  257. package/Builder/Tools/Box/BoxTool.js +0 -91
  258. package/Builder/Tools/Box/BoxToolTemplate.d.ts +0 -13
  259. package/Builder/Tools/Box/BoxToolTemplate.js +0 -23
  260. package/Builder/VoxelBuilder.types.d.ts +0 -0
  261. package/Builder/VoxelBuilder.types.js +0 -1
  262. package/Mesher/Functions/CompactVoxelMesh.d.ts +0 -3
  263. package/Mesher/Functions/MeshTexture.js +0 -278
  264. package/Mesher/Geomtry/VoxelMesh.d.ts +0 -12
  265. package/Mesher/Geomtry/VoxelMesh.js +0 -25
  266. package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +0 -25
  267. package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +0 -162
  268. package/Templates/Selection/VoxelSelecton.d.ts +0 -9
  269. package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +0 -36
  270. package/Templates/Shapes/BoxVoxelTemplate.d.ts +0 -23
  271. package/Templates/Shapes/BoxVoxelTemplate.js +0 -83
  272. package/Templates/Shapes/ConeVoxelTemplate.d.ts +0 -23
  273. package/Templates/Shapes/ConeVoxelTemplate.js +0 -73
  274. package/Templates/Shapes/CylinderVoxelTemplate.d.ts +0 -23
  275. package/Templates/Shapes/CylinderVoxelTemplate.js +0 -73
  276. package/Templates/Shapes/EllipsoidVoxelTemplate.d.ts +0 -23
  277. package/Templates/Shapes/EllipsoidVoxelTemplate.js +0 -89
  278. package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +0 -23
  279. package/Templates/Shapes/OctahedronVoxelTemplate.js +0 -73
  280. package/Templates/Shapes/PyramidVoxelTemplate.d.ts +0 -31
  281. package/Templates/Shapes/PyramidVoxelTemplate.js +0 -148
  282. package/Templates/Shapes/SphereVoxelTemplate.d.ts +0 -15
  283. package/Templates/Shapes/SphereVoxelTemplate.js +0 -59
  284. package/Templates/Shapes/TorusVoxelTemplate.d.ts +0 -23
  285. package/Templates/Shapes/TorusVoxelTemplate.js +0 -73
  286. package/Templates/VoxelTempateRegister.js +0 -30
  287. /package/Mesher/{Functions/MeshTexture.d.ts → Items/MeshTextureO.d.ts} +0 -0
  288. /package/Mesher/{Functions → Voxels/Base}/CompactVoxelSectionMesh.js +0 -0
  289. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.d.ts +0 -0
  290. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshBVHStructCursor.js +0 -0
  291. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
  292. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
  293. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.d.ts +0 -0
  294. /package/Mesher/{Geomtry → Voxels/Geomtry}/VoxelShaderData.js +0 -0
  295. /package/Mesher/{Functions → Voxels}/MeshSection.d.ts +0 -0
  296. /package/Mesher/{Functions → Voxels}/MeshSection.js +0 -0
  297. /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.d.ts +0 -0
  298. /package/Mesher/{Functions → Voxels}/MeshSectionSnapShot.js +0 -0
  299. /package/Mesher/{Models → Voxels/Models}/Common/Faces/CullRulledFace.d.ts +0 -0
  300. /package/Mesher/{Models → Voxels/Models}/Common/Faces/ShadeRulelessFace.js +0 -0
  301. /package/Mesher/{Models → Voxels/Models}/Common/GetTexture.js +0 -0
  302. /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.d.ts +0 -0
  303. /package/Mesher/{Models → Voxels/Models}/Nodes/Custom/index.js +0 -0
  304. /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.d.ts +0 -0
  305. /package/Mesher/{Models → Voxels/Models}/Nodes/GeometryNode.js +0 -0
  306. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.d.ts +0 -0
  307. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/GeomtryNode.types.js +0 -0
  308. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/QuadVoxelGometryNodeTypes.js +0 -0
  309. /package/Mesher/{Models → Voxels/Models}/Nodes/Types/TriangleVoxelGometryNodeTypes.js +0 -0
  310. /package/Mesher/{Models → Voxels/Models}/Nodes/VoxelGeometryConstructor.js +0 -0
  311. /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedure.js +0 -0
  312. /package/Mesher/{Models → Voxels/Models}/Procedures/TextureProcedureRegister.d.ts +0 -0
  313. /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.d.ts +0 -0
  314. /package/Mesher/{Models → Voxels/Models}/RenderedMaterials.js +0 -0
  315. /package/Templates/Selection/{VoxelSelecton.js → VoxelSelection.js} +0 -0
@@ -1,23 +0,0 @@
1
- import { IVoxelShapeTemplateData } from "./VoxelShapeTemplate.types";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export interface BoxVoxelTemplateData extends IVoxelShapeTemplateData<"box-shape"> {
4
- width: number;
5
- height: number;
6
- depth: number;
7
- }
8
- export declare class BoxVoxelTemplate extends BasicVoxelShapeTemplate<"box-shape", BoxVoxelTemplateData> {
9
- static CreateNew(data: Partial<BoxVoxelTemplateData>): BoxVoxelTemplateData;
10
- private _width;
11
- get width(): number;
12
- set width(width: number);
13
- private _height;
14
- get height(): number;
15
- set height(height: number);
16
- private _depth;
17
- get depth(): number;
18
- set depth(depth: number);
19
- constructor(data: BoxVoxelTemplateData);
20
- isIncluded(index: number): boolean;
21
- clone(): BoxVoxelTemplate;
22
- toJSON(): BoxVoxelTemplateData;
23
- }
@@ -1,83 +0,0 @@
1
- import { PaintVoxelData } from "../../Voxels";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export class BoxVoxelTemplate extends BasicVoxelShapeTemplate {
4
- static CreateNew(data) {
5
- return {
6
- ...BasicVoxelShapeTemplate.CreateBaseData("box-shape", {
7
- bounds: { x: data.width || 1, y: data.height || 1, z: data.depth || 1 },
8
- fillVoxel: data.fillVoxel || PaintVoxelData.Create(),
9
- pointVoxel: data.pointVoxel || PaintVoxelData.Create(),
10
- faceVoxel: data.faceVoxel || PaintVoxelData.Create(),
11
- edgeVoxel: data.edgeVoxel || PaintVoxelData.Create(),
12
- fillMode: data.fillMode || "full",
13
- }),
14
- width: data.width || 1,
15
- height: data.height || 1,
16
- depth: data.depth || 1,
17
- };
18
- }
19
- _width = 0;
20
- get width() {
21
- return this._width;
22
- }
23
- set width(width) {
24
- const oldWidth = this._width;
25
- this._width = width;
26
- if (oldWidth != width) {
27
- this.bounds.size.x = width;
28
- this._updateBounds();
29
- this.dispatch("updated", null);
30
- }
31
- }
32
- _height = 0;
33
- get height() {
34
- return this._height;
35
- }
36
- set height(height) {
37
- const oldWidth = this._height;
38
- this._height = height;
39
- if (oldWidth != height) {
40
- this.bounds.size.y = height;
41
- this._updateBounds();
42
- this.dispatch("updated", null);
43
- }
44
- }
45
- _depth = 0;
46
- get depth() {
47
- return this._depth;
48
- }
49
- set depth(depth) {
50
- const oldWidth = this._depth;
51
- this._depth = depth;
52
- if (oldWidth != depth) {
53
- this.bounds.size.z = depth;
54
- this._updateBounds();
55
- this.dispatch("updated", null);
56
- }
57
- }
58
- constructor(data) {
59
- super(data);
60
- this._width = data.width;
61
- this._height = data.height;
62
- this._depth = data.depth;
63
- this.bounds.size.x = data.width;
64
- this.bounds.size.y = data.height;
65
- this.bounds.size.z = data.depth;
66
- this._updateBounds();
67
- }
68
- isIncluded(index) {
69
- return true;
70
- }
71
- clone() {
72
- const newTemplate = new BoxVoxelTemplate(structuredClone(this.toJSON()));
73
- return newTemplate;
74
- }
75
- toJSON() {
76
- return {
77
- width: this.width,
78
- height: this.height,
79
- depth: this.depth,
80
- ...this.getBaseJSON(),
81
- };
82
- }
83
- }
@@ -1,23 +0,0 @@
1
- import { IVoxelShapeTemplateData } from "./VoxelShapeTemplate.types";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export interface ConeVoxelTemplateData extends IVoxelShapeTemplateData<"cone-shape"> {
4
- width: number;
5
- height: number;
6
- depth: number;
7
- }
8
- export declare class ConeVoxelTemplate extends BasicVoxelShapeTemplate<"cone-shape", ConeVoxelTemplateData> {
9
- static CreateNew(data: Partial<ConeVoxelTemplateData>): ConeVoxelTemplateData;
10
- private _width;
11
- get width(): number;
12
- set width(width: number);
13
- private _height;
14
- get height(): number;
15
- set height(height: number);
16
- private _depth;
17
- get depth(): number;
18
- set depth(depth: number);
19
- constructor(data: ConeVoxelTemplateData);
20
- isIncluded(index: number): boolean;
21
- clone(): ConeVoxelTemplate;
22
- toJSON(): ConeVoxelTemplateData;
23
- }
@@ -1,73 +0,0 @@
1
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
2
- export class ConeVoxelTemplate extends BasicVoxelShapeTemplate {
3
- static CreateNew(data) {
4
- return {
5
- ...BasicVoxelShapeTemplate.CreateBaseData("cone-shape", {
6
- bounds: { x: data.width || 1, y: data.height || 1, z: data.depth || 1 },
7
- }),
8
- width: data.width || 1,
9
- height: data.height || 1,
10
- depth: data.depth || 1,
11
- };
12
- }
13
- _width = 0;
14
- get width() {
15
- return this._width;
16
- }
17
- set width(width) {
18
- const oldWidth = this._width;
19
- this._width = width;
20
- if (oldWidth != width) {
21
- this.bounds.size.x = width;
22
- this._updateBounds();
23
- this.dispatch("updated", null);
24
- }
25
- }
26
- _height = 0;
27
- get height() {
28
- return this._height;
29
- }
30
- set height(height) {
31
- const oldWidth = this._height;
32
- this._height = height;
33
- if (oldWidth != height) {
34
- this.bounds.size.y = height;
35
- this._updateBounds();
36
- this.dispatch("updated", null);
37
- }
38
- }
39
- _depth = 0;
40
- get depth() {
41
- return this._depth;
42
- }
43
- set depth(depth) {
44
- const oldWidth = this._depth;
45
- this._depth = depth;
46
- if (oldWidth != depth) {
47
- this.bounds.size.z = depth;
48
- this._updateBounds();
49
- this.dispatch("updated", null);
50
- }
51
- }
52
- constructor(data) {
53
- super(data);
54
- this._width = data.width;
55
- this._height = data.height;
56
- this._depth = data.depth;
57
- }
58
- isIncluded(index) {
59
- return true;
60
- }
61
- clone() {
62
- const newTemplate = new ConeVoxelTemplate(structuredClone(this.toJSON()));
63
- return newTemplate;
64
- }
65
- toJSON() {
66
- return {
67
- width: this.width,
68
- height: this.height,
69
- depth: this.depth,
70
- ...this.getBaseJSON(),
71
- };
72
- }
73
- }
@@ -1,23 +0,0 @@
1
- import { IVoxelShapeTemplateData } from "./VoxelShapeTemplate.types";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export interface CylinderVoxelTemplateData extends IVoxelShapeTemplateData<"cylinder-shape"> {
4
- width: number;
5
- height: number;
6
- depth: number;
7
- }
8
- export declare class CylinderVoxelTemplate extends BasicVoxelShapeTemplate<"cylinder-shape", CylinderVoxelTemplateData> {
9
- static CreateNew(data: Partial<CylinderVoxelTemplateData>): CylinderVoxelTemplateData;
10
- private _width;
11
- get width(): number;
12
- set width(width: number);
13
- private _height;
14
- get height(): number;
15
- set height(height: number);
16
- private _depth;
17
- get depth(): number;
18
- set depth(depth: number);
19
- constructor(data: CylinderVoxelTemplateData);
20
- isIncluded(index: number): boolean;
21
- clone(): CylinderVoxelTemplate;
22
- toJSON(): CylinderVoxelTemplateData;
23
- }
@@ -1,73 +0,0 @@
1
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
2
- export class CylinderVoxelTemplate extends BasicVoxelShapeTemplate {
3
- static CreateNew(data) {
4
- return {
5
- ...BasicVoxelShapeTemplate.CreateBaseData("cylinder-shape", {
6
- bounds: { x: data.width || 1, y: data.height || 1, z: data.depth || 1 },
7
- }),
8
- width: data.width || 1,
9
- height: data.height || 1,
10
- depth: data.depth || 1,
11
- };
12
- }
13
- _width = 0;
14
- get width() {
15
- return this._width;
16
- }
17
- set width(width) {
18
- const oldWidth = this._width;
19
- this._width = width;
20
- if (oldWidth != width) {
21
- this.bounds.size.x = width;
22
- this._updateBounds();
23
- this.dispatch("updated", null);
24
- }
25
- }
26
- _height = 0;
27
- get height() {
28
- return this._height;
29
- }
30
- set height(height) {
31
- const oldWidth = this._height;
32
- this._height = height;
33
- if (oldWidth != height) {
34
- this.bounds.size.y = height;
35
- this._updateBounds();
36
- this.dispatch("updated", null);
37
- }
38
- }
39
- _depth = 0;
40
- get depth() {
41
- return this._depth;
42
- }
43
- set depth(depth) {
44
- const oldWidth = this._depth;
45
- this._depth = depth;
46
- if (oldWidth != depth) {
47
- this.bounds.size.z = depth;
48
- this._updateBounds();
49
- this.dispatch("updated", null);
50
- }
51
- }
52
- constructor(data) {
53
- super(data);
54
- this._width = data.width;
55
- this._height = data.height;
56
- this._depth = data.depth;
57
- }
58
- isIncluded(index) {
59
- return true;
60
- }
61
- clone() {
62
- const newTemplate = new CylinderVoxelTemplate(structuredClone(this.toJSON()));
63
- return newTemplate;
64
- }
65
- toJSON() {
66
- return {
67
- width: this.width,
68
- height: this.height,
69
- depth: this.depth,
70
- ...this.getBaseJSON(),
71
- };
72
- }
73
- }
@@ -1,23 +0,0 @@
1
- import { IVoxelShapeTemplateData } from "./VoxelShapeTemplate.types";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export interface SphereVoxelTemplateData extends IVoxelShapeTemplateData<"ellipsoid-shape"> {
4
- radiusX: number;
5
- radiusY: number;
6
- radiusZ: number;
7
- }
8
- export declare class EllipsoidVoxelTemplate extends BasicVoxelShapeTemplate<"ellipsoid-shape", SphereVoxelTemplateData> {
9
- static CreateNew(data: Partial<SphereVoxelTemplateData>): SphereVoxelTemplateData;
10
- private _radiusX;
11
- get radiusX(): number;
12
- set radiusX(radius: number);
13
- private _radiusY;
14
- get radiusY(): number;
15
- set radiusY(radius: number);
16
- private _radiusZ;
17
- get radiusZ(): number;
18
- set radiusZ(radius: number);
19
- constructor(data: SphereVoxelTemplateData);
20
- isIncluded(index: number): boolean;
21
- clone(): EllipsoidVoxelTemplate;
22
- toJSON(): SphereVoxelTemplateData;
23
- }
@@ -1,89 +0,0 @@
1
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
2
- export class EllipsoidVoxelTemplate extends BasicVoxelShapeTemplate {
3
- static CreateNew(data) {
4
- return {
5
- ...BasicVoxelShapeTemplate.CreateBaseData("ellipsoid-shape", {
6
- bounds: {
7
- x: (data.radiusX || 1) * 2 + 1,
8
- y: (data.radiusY || 1) * 2 + 1,
9
- z: (data.radiusZ || 1) * 2 + 1,
10
- },
11
- }),
12
- radiusX: data.radiusX || 1,
13
- radiusY: data.radiusY || 1,
14
- radiusZ: data.radiusZ || 1,
15
- };
16
- }
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.bounds.size.x = radius * 2 + 1;
26
- this._updateBounds();
27
- this.dispatch("updated", null);
28
- }
29
- }
30
- _radiusY = 0;
31
- get radiusY() {
32
- return this._radiusY;
33
- }
34
- set radiusY(radius) {
35
- const oldRadius = this._radiusY;
36
- this._radiusY = radius;
37
- if (oldRadius != radius) {
38
- this.bounds.size.y = radius * 2 + 1;
39
- this._updateBounds();
40
- this.dispatch("updated", null);
41
- }
42
- }
43
- _radiusZ = 0;
44
- get radiusZ() {
45
- return this._radiusZ;
46
- }
47
- set radiusZ(radius) {
48
- const oldRadius = this._radiusZ;
49
- this._radiusZ = radius;
50
- if (oldRadius != radius) {
51
- this.bounds.size.z = radius * 2 + 1;
52
- this._updateBounds();
53
- this.dispatch("updated", null);
54
- }
55
- }
56
- constructor(data) {
57
- super(data);
58
- this._radiusX = data.radiusX;
59
- this._radiusY = data.radiusY;
60
- this._radiusZ = data.radiusZ;
61
- this.bounds.size.x = this._radiusX * 2 + 1;
62
- this.bounds.size.y = this._radiusY * 2 + 1;
63
- this.bounds.size.z = this._radiusZ * 2 + 1;
64
- this._updateBounds();
65
- }
66
- isIncluded(index) {
67
- const [x, y, z] = this.index.getXYZ(index);
68
- const cx = Math.floor(this.bounds.size.x / 2);
69
- const cy = Math.floor(this.bounds.size.y / 2);
70
- const cz = Math.floor(this.bounds.size.z / 2);
71
- const normX = (x - cx) / this.radiusX;
72
- const normY = (y - cy) / this.radiusY;
73
- const normZ = (z - cz) / this.radiusZ;
74
- const distance = Math.sqrt(normX * normX + normY * normY + normZ * normZ);
75
- return distance <= 1;
76
- }
77
- clone() {
78
- const newTemplate = new EllipsoidVoxelTemplate(structuredClone(this.toJSON()));
79
- return newTemplate;
80
- }
81
- toJSON() {
82
- return {
83
- ...this.getBaseJSON(),
84
- radiusX: this.radiusX,
85
- radiusY: this.radiusY,
86
- radiusZ: this.radiusZ,
87
- };
88
- }
89
- }
@@ -1,23 +0,0 @@
1
- import { IVoxelShapeTemplateData } from "./VoxelShapeTemplate.types";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export interface OctahedronVoxelTemplateData extends IVoxelShapeTemplateData<"octahedron-shape"> {
4
- width: number;
5
- height: number;
6
- depth: number;
7
- }
8
- export declare class OctahedronVoxelTemplate extends BasicVoxelShapeTemplate<"octahedron-shape", OctahedronVoxelTemplateData> {
9
- static CreateNew(data: Partial<OctahedronVoxelTemplateData>): OctahedronVoxelTemplateData;
10
- private _width;
11
- get width(): number;
12
- set width(width: number);
13
- private _height;
14
- get height(): number;
15
- set height(height: number);
16
- private _depth;
17
- get depth(): number;
18
- set depth(depth: number);
19
- constructor(data: OctahedronVoxelTemplateData);
20
- isIncluded(index: number): boolean;
21
- clone(): OctahedronVoxelTemplate;
22
- toJSON(): OctahedronVoxelTemplateData;
23
- }
@@ -1,73 +0,0 @@
1
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
2
- export class OctahedronVoxelTemplate extends BasicVoxelShapeTemplate {
3
- static CreateNew(data) {
4
- return {
5
- ...BasicVoxelShapeTemplate.CreateBaseData("octahedron-shape", {
6
- bounds: { x: data.width || 1, y: data.height || 1, z: data.depth || 1 },
7
- }),
8
- width: data.width || 1,
9
- height: data.height || 1,
10
- depth: data.depth || 1,
11
- };
12
- }
13
- _width = 0;
14
- get width() {
15
- return this._width;
16
- }
17
- set width(width) {
18
- const oldWidth = this._width;
19
- this._width = width;
20
- if (oldWidth != width) {
21
- this.bounds.size.x = width;
22
- this._updateBounds();
23
- this.dispatch("updated", null);
24
- }
25
- }
26
- _height = 0;
27
- get height() {
28
- return this._height;
29
- }
30
- set height(height) {
31
- const oldWidth = this._height;
32
- this._height = height;
33
- if (oldWidth != height) {
34
- this.bounds.size.y = height;
35
- this._updateBounds();
36
- this.dispatch("updated", null);
37
- }
38
- }
39
- _depth = 0;
40
- get depth() {
41
- return this._depth;
42
- }
43
- set depth(depth) {
44
- const oldWidth = this._depth;
45
- this._depth = depth;
46
- if (oldWidth != depth) {
47
- this.bounds.size.z = depth;
48
- this._updateBounds();
49
- this.dispatch("updated", null);
50
- }
51
- }
52
- constructor(data) {
53
- super(data);
54
- this._width = data.width;
55
- this._height = data.height;
56
- this._depth = data.depth;
57
- }
58
- isIncluded(index) {
59
- return true;
60
- }
61
- clone() {
62
- const newTemplate = new OctahedronVoxelTemplate(structuredClone(this.toJSON()));
63
- return newTemplate;
64
- }
65
- toJSON() {
66
- return {
67
- width: this.width,
68
- height: this.height,
69
- depth: this.depth,
70
- ...this.getBaseJSON(),
71
- };
72
- }
73
- }
@@ -1,31 +0,0 @@
1
- import { IVoxelShapeTemplateData, VoxelShapeTemplateShapeDirections } from "./VoxelShapeTemplate.types";
2
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
3
- export interface PyramidVoxelTemplateData extends IVoxelShapeTemplateData<"pyramid-shape"> {
4
- width: number;
5
- height: number;
6
- depth: number;
7
- direction: VoxelShapeTemplateShapeDirections;
8
- fallOff: number;
9
- }
10
- export declare class PyramidVoxelTemplate extends BasicVoxelShapeTemplate<"pyramid-shape", PyramidVoxelTemplateData> {
11
- static CreateNew(data: Partial<PyramidVoxelTemplateData>): PyramidVoxelTemplateData;
12
- private _fallOff;
13
- get fallOff(): number;
14
- set fallOff(fallOFf: number);
15
- private _direction;
16
- get direction(): VoxelShapeTemplateShapeDirections;
17
- set direction(direction: VoxelShapeTemplateShapeDirections);
18
- private _width;
19
- get width(): number;
20
- set width(width: number);
21
- private _height;
22
- get height(): number;
23
- set height(height: number);
24
- private _depth;
25
- get depth(): number;
26
- set depth(depth: number);
27
- constructor(data: PyramidVoxelTemplateData);
28
- isIncluded(index: number): boolean;
29
- clone(): PyramidVoxelTemplate;
30
- toJSON(): PyramidVoxelTemplateData;
31
- }
@@ -1,148 +0,0 @@
1
- import { BasicVoxelShapeTemplate } from "./BasicVoxelShapeTemplate";
2
- export class PyramidVoxelTemplate extends BasicVoxelShapeTemplate {
3
- static CreateNew(data) {
4
- return {
5
- ...BasicVoxelShapeTemplate.CreateBaseData("pyramid-shape", {
6
- bounds: { x: data.width || 1, y: data.height || 1, z: data.depth || 1 },
7
- }),
8
- width: data.width || 12,
9
- height: data.height || 12,
10
- depth: data.depth || 12,
11
- direction: data.direction || "+y",
12
- fallOff: data.fallOff || 1,
13
- };
14
- }
15
- _fallOff = 0;
16
- get fallOff() {
17
- return this._fallOff;
18
- }
19
- set fallOff(fallOFf) {
20
- const oldDirection = this._fallOff;
21
- this._fallOff = fallOFf;
22
- if (oldDirection != fallOFf) {
23
- this.dispatch("updated", null);
24
- }
25
- }
26
- _direction = "+y";
27
- get direction() {
28
- return this._direction;
29
- }
30
- set direction(direction) {
31
- const oldDirection = this._direction;
32
- this._direction = direction;
33
- if (oldDirection != direction) {
34
- this.dispatch("updated", null);
35
- }
36
- }
37
- _width = 0;
38
- get width() {
39
- return this._width;
40
- }
41
- set width(width) {
42
- const oldWidth = this._width;
43
- this._width = width;
44
- if (oldWidth != width) {
45
- this.bounds.size.x = width;
46
- this._updateBounds();
47
- this.dispatch("updated", null);
48
- }
49
- }
50
- _height = 0;
51
- get height() {
52
- return this._height;
53
- }
54
- set height(height) {
55
- const oldWidth = this._height;
56
- this._height = height;
57
- if (oldWidth != height) {
58
- this.bounds.size.y = height;
59
- this._updateBounds();
60
- this.dispatch("updated", null);
61
- }
62
- }
63
- _depth = 0;
64
- get depth() {
65
- return this._depth;
66
- }
67
- set depth(depth) {
68
- const oldWidth = this._depth;
69
- this._depth = depth;
70
- if (oldWidth != depth) {
71
- this.bounds.size.z = depth;
72
- this._updateBounds();
73
- this.dispatch("updated", null);
74
- }
75
- }
76
- constructor(data) {
77
- super(data);
78
- this._fallOff = data.fallOff;
79
- this._direction = data.direction;
80
- this._width = data.width;
81
- this._height = data.height;
82
- this._depth = data.depth;
83
- this.bounds.size.x = this._width;
84
- this.bounds.size.y = this._height;
85
- this.bounds.size.z = this._depth;
86
- this._updateBounds();
87
- }
88
- isIncluded(index) {
89
- const [x, y, z] = this.index.getXYZ(index);
90
- switch (this.direction) {
91
- case "+y": // Pyramid pointing up
92
- {
93
- const normalizedFallOff = y * this.fallOff;
94
- const minX = normalizedFallOff;
95
- const minZ = normalizedFallOff;
96
- const maxX = this.width - normalizedFallOff;
97
- const maxZ = this.depth - normalizedFallOff;
98
- if (x >= minX && z >= minZ && x < maxX && z < maxZ)
99
- return true;
100
- return false;
101
- }
102
- break;
103
- case "-y": {
104
- // Pyramid pointing down
105
- const normalizedFallOff = (this.height - 1 - y) * this.fallOff;
106
- const minX = normalizedFallOff;
107
- const minZ = normalizedFallOff;
108
- const maxX = this.width - normalizedFallOff;
109
- const maxZ = this.depth - normalizedFallOff;
110
- if (x >= minX && z >= minZ && x < maxX && z < maxZ)
111
- return true;
112
- return false;
113
- }
114
- case "+x": {
115
- // Pyramid pointing right
116
- return true;
117
- }
118
- case "-x": {
119
- // Pyramid pointing left
120
- return true;
121
- }
122
- case "+z": {
123
- // Pyramid pointing forward
124
- return true;
125
- }
126
- case "-z": {
127
- // Pyramid pointing backward
128
- return true;
129
- }
130
- default:
131
- return false;
132
- }
133
- }
134
- clone() {
135
- const newTemplate = new PyramidVoxelTemplate(structuredClone(this.toJSON()));
136
- return newTemplate;
137
- }
138
- toJSON() {
139
- return {
140
- width: this.width,
141
- height: this.height,
142
- depth: this.depth,
143
- direction: this.direction,
144
- fallOff: this.fallOff,
145
- ...this.getBaseJSON(),
146
- };
147
- }
148
- }