@divinevoxel/vlox 0.0.74 → 0.0.76
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.
- package/Builder/RayProvider.d.ts +6 -0
- package/Builder/Tools/Box/BoxSelection.d.ts +12 -0
- package/Builder/Tools/Box/BoxSelection.js +27 -0
- package/Builder/Tools/Box/BoxTool.d.ts +31 -0
- package/Builder/Tools/Box/BoxTool.js +91 -0
- package/Builder/Tools/Box/BoxToolTemplate.d.ts +13 -0
- package/Builder/Tools/Box/BoxToolTemplate.js +23 -0
- package/Builder/Tools/Brush/BrushTool.d.ts +48 -0
- package/Builder/Tools/Brush/BrushTool.js +146 -0
- package/Builder/Tools/BuilderToolBase.d.ts +3 -0
- package/Builder/Tools/BuilderToolBase.js +3 -0
- package/Builder/Tools/Hand/HandTool.d.ts +22 -0
- package/Builder/Tools/Hand/HandTool.js +56 -0
- package/Builder/Tools/Path/PahtTool.d.ts +29 -0
- package/Builder/Tools/Path/PahtTool.js +117 -0
- package/Builder/Tools/Wand/WandTool.d.ts +28 -0
- package/Builder/Tools/Wand/WandTool.js +67 -0
- package/Builder/Tools/Wrench/WrenchTool.d.ts +47 -0
- package/Builder/Tools/Wrench/WrenchTool.js +175 -0
- package/Builder/VoxelBuildSpace.d.ts +61 -0
- package/Builder/VoxelBuildSpace.js +165 -0
- package/Builder/VoxelBuilder.types.d.ts +0 -0
- package/Builder/VoxelBuilder.types.js +1 -0
- package/Builder/World/InitTasks.d.ts +1 -0
- package/Builder/World/InitTasks.js +134 -0
- package/Builder/World/VoxelBuildSpaceWorld.d.ts +4 -0
- package/Builder/World/VoxelBuildSpaceWorld.js +10 -0
- package/Cache/Cache.types.d.ts +1 -1
- package/Contexts/Base/Remote/InitDataSync.js +3 -3
- package/Contexts/Base/Remote/InitWorldDataSync.d.ts +2 -1
- package/Contexts/Base/Remote/InitWorldDataSync.js +13 -2
- package/Contexts/Generator/DivineVoxelEngineGenerator.d.ts +9 -0
- package/Contexts/Generator/DivineVoxelEngineGenerator.js +14 -0
- package/Contexts/{Constructor/ConstrcutorTheads.d.ts → Generator/GeneratorThreads.d.ts} +2 -2
- package/Contexts/{Constructor/ConstrcutorTheads.js → Generator/GeneratorThreads.js} +2 -2
- package/Contexts/Generator/index.d.ts +1 -0
- package/Contexts/Generator/index.js +1 -0
- package/Contexts/Mesher/DivineVoxelEngineMesher.d.ts +9 -0
- package/Contexts/Mesher/DivineVoxelEngineMesher.js +14 -0
- package/Contexts/Mesher/MesherTheads.d.ts +7 -0
- package/Contexts/Mesher/MesherTheads.js +14 -0
- package/Contexts/Mesher/index.d.ts +1 -0
- package/Contexts/Mesher/index.js +1 -0
- package/Contexts/Nexus/NexusTheads.js +1 -1
- package/Contexts/Render/DVERenderThreads.d.ts +2 -1
- package/Contexts/Render/DVERenderThreads.js +4 -2
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +14 -4
- package/Contexts/Render/DivineVoxelEngineRender.js +9 -4
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +12 -3
- package/Contexts/World/WorldThreads.d.ts +2 -1
- package/Contexts/World/WorldThreads.js +4 -2
- package/Init/StartGenerator.d.ts +2 -0
- package/Init/StartGenerator.js +45 -0
- package/Init/StartMesher.d.ts +2 -0
- package/Init/StartMesher.js +41 -0
- package/Init/StartNexus.js +4 -2
- package/Init/StartRenderer.d.ts +4 -1
- package/Init/StartRenderer.js +59 -14
- package/Init/StartWorld.js +2 -1
- package/LICENSE.md +2 -1
- package/Math/CardinalNeighbors.d.ts +43 -3
- package/Math/CardinalNeighbors.js +54 -8
- package/Math/Indexing.d.ts +1 -0
- package/Math/Location.d.ts +10 -0
- package/Math/UtilFunctions.d.ts +4 -0
- package/Math/UtilFunctions.js +52 -0
- package/Math/index.d.ts +1 -10
- package/Math/index.js +1 -0
- package/Mesher/Functions/Base/MeshSectionBase.d.ts +5 -0
- package/Mesher/Functions/Base/MeshSectionBase.js +108 -0
- package/Mesher/Functions/CompactVoxelSectionMesh.js +4 -10
- package/Mesher/Functions/MeshSection.js +3 -107
- package/Mesher/Functions/MeshSectionSnapShot.d.ts +3 -0
- package/Mesher/Functions/MeshSectionSnapShot.js +14 -0
- package/Mesher/Functions/MeshTexture.js +8 -4
- package/Mesher/Functions/MeshVoxel.js +12 -4
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +5 -2
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +12 -7
- package/Mesher/Geomtry/Functions/GetBounds.d.ts +2 -0
- package/Mesher/{Models/Common/BoundsFunctions.js → Geomtry/Functions/GetBounds.js} +13 -13
- package/Mesher/Geomtry/Geometry.types.d.ts +14 -0
- package/Mesher/Geomtry/Geometry.types.js +11 -0
- package/Mesher/Geomtry/Primitives/Quad.d.ts +7 -15
- package/Mesher/Geomtry/Primitives/Quad.js +36 -91
- package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +4 -14
- package/Mesher/Geomtry/Primitives/QuadVertexData.js +17 -57
- package/Mesher/Geomtry/Primitives/Triangle.d.ts +65 -0
- package/Mesher/Geomtry/Primitives/Triangle.js +148 -0
- package/Mesher/Geomtry/Primitives/TriangleVertexData.d.ts +58 -0
- package/Mesher/Geomtry/Primitives/TriangleVertexData.js +263 -0
- package/Mesher/Geomtry/Primitives/index.d.ts +2 -0
- package/Mesher/Geomtry/Primitives/index.js +2 -0
- package/Mesher/Geomtry/Shapes/Box.d.ts +20 -0
- package/Mesher/Geomtry/Shapes/Box.js +69 -0
- package/Mesher/Geomtry/Transform/TransformBox.d.ts +3 -0
- package/{Models/Shared/Transform.js → Mesher/Geomtry/Transform/TransformBox.js} +9 -124
- package/Mesher/Geomtry/Transform/TransformQuad.d.ts +3 -0
- package/Mesher/Geomtry/Transform/TransformQuad.js +113 -0
- package/Mesher/Geomtry/Transform/TransformTriangle.d.ts +3 -0
- package/Mesher/Geomtry/Transform/TransformTriangle.js +112 -0
- package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +3 -4
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +128 -112
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +3 -3
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +1 -1
- package/Mesher/Geomtry/VoxelMeshVertexStructCursor.d.ts +9 -3
- package/Mesher/Geomtry/VoxelMeshVertexStructCursor.js +26 -3
- package/Mesher/Geomtry/VoxelShaderData.d.ts +4 -1
- package/Mesher/Geomtry/VoxelShaderData.js +25 -10
- package/Mesher/InitMesher.d.ts +1 -1
- package/Mesher/InitMesher.js +6 -0
- package/Mesher/InitTask.js +17 -6
- package/Mesher/Models/Common/Calc/CalcConstants.d.ts +2 -6
- package/Mesher/Models/Common/Calc/CalcConstants.js +2 -76
- package/Mesher/Models/Common/Faces/CullRulledFace.d.ts +2 -0
- package/Mesher/Models/Common/Faces/CullRulledFace.js +60 -0
- package/Mesher/Models/Common/Faces/ShadeRulelessFace.d.ts +4 -0
- package/Mesher/Models/Common/Faces/ShadeRulelessFace.js +12 -0
- package/Mesher/Models/Common/Faces/ShadeRulledFace.d.ts +4 -0
- package/Mesher/Models/Common/Faces/ShadeRulledFace.js +58 -0
- package/Mesher/Models/Common/GetTexture.d.ts +6 -0
- package/Mesher/Models/Common/GetTexture.js +12 -0
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +2 -3
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +124 -48
- package/Mesher/Models/Nodes/Default/QuadVoxelGeometryNode.d.ts +13 -0
- package/Mesher/Models/Nodes/Default/QuadVoxelGeometryNode.js +55 -0
- package/Mesher/Models/Nodes/Default/TriangleVoxelGeometryNode.d.ts +13 -0
- package/Mesher/Models/Nodes/Default/TriangleVoxelGeometryNode.js +52 -0
- package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -8
- package/Mesher/Models/Nodes/GeometryNode.js +1 -7
- package/Mesher/Models/Nodes/Types/GeomtryNode.types.d.ts +7 -0
- package/Mesher/Models/Nodes/Types/GeomtryNode.types.js +1 -0
- package/Mesher/Models/Nodes/Types/QuadVoxelGometryNodeTypes.d.ts +29 -0
- package/{Models/Input/QuadVoxelGometryInputs.js → Mesher/Models/Nodes/Types/QuadVoxelGometryNodeTypes.js} +4 -8
- package/Mesher/Models/Nodes/Types/TriangleVoxelGometryNodeTypes.d.ts +28 -0
- package/Mesher/Models/Nodes/Types/TriangleVoxelGometryNodeTypes.js +24 -0
- package/Mesher/Models/Nodes/VoxelGeometryConstructor.d.ts +4 -8
- package/Mesher/Models/Nodes/VoxelGeometryConstructor.js +16 -52
- package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.d.ts +25 -0
- package/Mesher/Models/Procedures/Default/ConsistentRotationTextureProcedure.js +44 -0
- package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.d.ts +28 -0
- package/Mesher/Models/Procedures/Default/OutlinedTextureProcedure.js +162 -0
- package/Mesher/Models/Procedures/TextureProcedure.d.ts +16 -0
- package/Mesher/Models/Procedures/TextureProcedure.js +2 -0
- package/Mesher/Models/Procedures/TextureProcedureRegister.d.ts +6 -0
- package/Mesher/Models/Procedures/TextureProcedureRegister.js +16 -0
- package/Mesher/Models/VoxelConstructor.d.ts +1 -5
- package/Mesher/Models/VoxelConstructor.js +1 -11
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +2 -2
- package/Mesher/Models/VoxelModelBuilder.d.ts +0 -1
- package/Mesher/Models/VoxelModelBuilder.js +1 -2
- package/Mesher/Models/VoxelModelConstructorRegister.d.ts +8 -2
- package/Mesher/Models/VoxelModelConstructorRegister.js +6 -8
- package/Renderer/Classes/SectionMesh.d.ts +2 -3
- package/Renderer/Classes/SectionMesh.js +13 -10
- package/Renderer/Classes/SectorMesh.d.ts +5 -5
- package/Renderer/Classes/SectorMesh.js +17 -6
- package/Renderer/InitTasks.d.ts +1 -2
- package/Renderer/InitTasks.js +4 -10
- package/Renderer/MeshManager.d.ts +6 -1
- package/Renderer/MeshManager.js +11 -14
- package/Renderer/MeshRegister.d.ts +6 -4
- package/Renderer/MeshRegister.js +34 -43
- package/Settings/EngineSettings.js +3 -0
- package/Settings/EngineSettings.types.d.ts +7 -1
- package/Settings/EngineSettings.types.js +5 -1
- package/Stats/EngineStats.d.ts +19 -0
- package/Stats/EngineStats.js +27 -0
- package/Tasks/Paint/Common.d.ts +7 -0
- package/Tasks/Paint/Common.js +200 -0
- package/Tasks/Paint/Erase/EraseVoxel.d.ts +3 -0
- package/Tasks/Paint/Erase/EraseVoxel.js +31 -0
- package/Tasks/Paint/Erase/EraseVoxelPath.d.ts +4 -0
- package/Tasks/Paint/Erase/EraseVoxelPath.js +80 -0
- package/Tasks/Paint/Erase/EraseVoxelTemplate.d.ts +4 -0
- package/Tasks/Paint/Erase/EraseVoxelTemplate.js +34 -0
- package/Tasks/Paint/InitTasks.js +16 -0
- package/Tasks/Paint/Paint/PaintVoxel.d.ts +4 -0
- package/Tasks/Paint/Paint/PaintVoxel.js +29 -0
- package/Tasks/Paint/Paint/PaintVoxelPath.d.ts +4 -0
- package/Tasks/Paint/Paint/PaintVoxelPath.js +78 -0
- package/Tasks/Paint/Paint/PaintVoxelTemplate.d.ts +4 -0
- package/Tasks/Paint/Paint/PaintVoxelTemplate.js +36 -0
- package/Tasks/Propagation/Flow/FlowUpdate.js +1 -1
- package/Tasks/Propagation/Flow/WorldFlow.js +2 -2
- package/Tasks/Propagation/Illumanation/CommonFunctions.d.ts +6 -6
- package/Tasks/Propagation/Illumanation/CommonFunctions.js +6 -7
- package/Tasks/Propagation/Illumanation/RGBUpdate.js +9 -9
- package/Tasks/Propagation/Illumanation/SunUpdate.js +8 -7
- package/Tasks/Propagation/Illumanation/WorldSun.js +11 -9
- package/Tasks/Propagation/InitTasks.js +16 -28
- package/Tasks/Propagation/Power/PowerUpdate.js +10 -10
- package/Tasks/Tasks.types.d.ts +25 -9
- package/Tasks/TasksIds.d.ts +13 -20
- package/Tasks/TasksIds.js +13 -20
- package/Tasks/VoxelUpdateTask.d.ts +6 -5
- package/Tasks/VoxelUpdateTask.js +53 -37
- package/Tasks/WorldGeneration/InitTasks.d.ts +4 -1
- package/Tasks/WorldGeneration/InitTasks.js +6 -3
- package/Tasks/WorldGeneration/WorldGen.types.d.ts +2 -3
- package/Tasks/WorldGeneration/WorldGenBrush.js +6 -7
- package/Tasks/WorldGeneration/WorldGenRegister.d.ts +3 -1
- package/Tasks/WorldGeneration/WorldGenRegister.js +13 -3
- package/Tasks/WorldGeneration/WorldGeneration.d.ts +2 -2
- package/Tasks/WorldGeneration/WorldGeneration.js +22 -3
- package/Templates/Archive/ArchivedVoxelTemplate.d.ts +38 -0
- package/Templates/Archive/ArchivedVoxelTemplate.js +128 -0
- package/Templates/Archive/ArchivedVoxelTemplate.types.d.ts +45 -0
- package/Templates/Archive/ArchivedVoxelTemplate.types.js +1 -0
- package/Templates/Archive/Functions/CreateArchivedTemplate.d.ts +11 -0
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +186 -0
- package/Templates/Archive/Functions/ExportArchiedTemplateJSON.d.ts +2 -0
- package/Templates/Archive/Functions/ExportArchiedTemplateJSON.js +44 -0
- package/Templates/Archive/Functions/ImportArchivedTemplateJSON.d.ts +2 -0
- package/Templates/Archive/Functions/ImportArchivedTemplateJSON.js +37 -0
- package/Templates/Cursor/TemplateCursor.d.ts +5 -3
- package/Templates/Cursor/TemplateCursor.js +11 -5
- package/Templates/Cursor/TemplateProxy.d.ts +11 -0
- package/Templates/Cursor/TemplateProxy.js +36 -0
- package/Templates/Cursor/TemplateVoxelCursor.d.ts +5 -7
- package/Templates/Cursor/TemplateVoxelCursor.js +7 -13
- package/Templates/Full/FullVoxelTemplate.d.ts +28 -0
- package/Templates/Full/FullVoxelTemplate.js +112 -0
- package/Templates/Full/FullVoxelTemplate.types.d.ts +5 -0
- package/Templates/Full/FullVoxelTemplate.types.js +1 -0
- package/Templates/Full/Functions/CreateFullTemplate.d.ts +3 -0
- package/Templates/Full/Functions/CreateFullTemplate.js +27 -0
- package/Templates/Functions/FlipTemplate.d.ts +2 -2
- package/Templates/Functions/FlipTemplate.js +1 -9
- package/Templates/Functions/RotateTemplate.d.ts +2 -2
- package/Templates/Functions/RotateTemplate.js +2 -10
- package/Templates/Functions/index.d.ts +1 -1
- package/Templates/Functions/index.js +1 -1
- package/Templates/Path/VoxelPath.d.ts +38 -0
- package/Templates/Path/VoxelPath.js +144 -0
- package/Templates/Path/VoxelPath.types.d.ts +11 -0
- package/Templates/Path/VoxelPath.types.js +1 -0
- package/Templates/Selection/VoxelBFSSelection.d.ts +23 -0
- package/Templates/Selection/VoxelBFSSelection.js +141 -0
- package/Templates/Selection/VoxelBoxSelection.d.ts +17 -0
- package/Templates/Selection/VoxelBoxSelection.js +116 -0
- package/Templates/Selection/VoxelPointSelection.d.ts +17 -0
- package/Templates/Selection/VoxelPointSelection.js +48 -0
- package/Templates/Selection/VoxelSelecton.d.ts +9 -0
- package/Templates/Selection/VoxelSelecton.js +1 -0
- package/Templates/Selection/VoxelSurfaceSelection.d.ts +30 -0
- package/Templates/Selection/VoxelSurfaceSelection.js +224 -0
- package/Templates/Selection/VoxelTemplateSelection.d.ts +13 -0
- package/Templates/Selection/VoxelTemplateSelection.js +36 -0
- package/Templates/Shapes/BasicVoxelShapeTemplate.d.ts +36 -0
- package/Templates/Shapes/BasicVoxelShapeTemplate.js +126 -0
- package/Templates/Shapes/BoxVoxelTemplate.d.ts +23 -0
- package/Templates/Shapes/BoxVoxelTemplate.js +83 -0
- package/Templates/Shapes/ConeVoxelTemplate.d.ts +23 -0
- package/Templates/Shapes/ConeVoxelTemplate.js +73 -0
- package/Templates/Shapes/CylinderVoxelTemplate.d.ts +23 -0
- package/Templates/Shapes/CylinderVoxelTemplate.js +73 -0
- package/Templates/Shapes/EllipsoidVoxelTemplate.d.ts +23 -0
- package/Templates/Shapes/EllipsoidVoxelTemplate.js +89 -0
- package/Templates/Shapes/OctahedronVoxelTemplate.d.ts +23 -0
- package/Templates/Shapes/OctahedronVoxelTemplate.js +73 -0
- package/Templates/Shapes/PyramidVoxelTemplate.d.ts +31 -0
- package/Templates/Shapes/PyramidVoxelTemplate.js +148 -0
- package/Templates/Shapes/SphereVoxelTemplate.d.ts +15 -0
- package/Templates/Shapes/SphereVoxelTemplate.js +59 -0
- package/Templates/Shapes/TorusVoxelTemplate.d.ts +23 -0
- package/Templates/Shapes/TorusVoxelTemplate.js +73 -0
- package/Templates/Shapes/VoxelShapeTemplate.types.d.ts +27 -0
- package/Templates/Shapes/VoxelShapeTemplate.types.js +6 -0
- package/Templates/VoxelTempateRegister.d.ts +6 -0
- package/Templates/VoxelTempateRegister.js +30 -0
- package/Templates/VoxelTemplates.types.d.ts +24 -26
- package/Templates/index.d.ts +1 -1
- package/Templates/index.js +1 -1
- package/Textures/Classes/CompiledTexture.d.ts +3 -0
- package/Textures/Classes/CompiledTexture.js +3 -0
- package/Textures/Classes/CompiledTextureAnimation.d.ts +1 -1
- package/Textures/Classes/CompiledTextureAnimation.js +8 -2
- package/Textures/Classes/TextureAnimationTexture.d.ts +1 -1
- package/Textures/Functions/BuildTextureData.d.ts +2 -1
- package/Textures/Functions/BuildTextureData.js +86 -17
- package/Textures/Texture.types.d.ts +5 -1
- package/Textures/TextureManager.d.ts +2 -1
- package/Textures/TextureManager.js +5 -2
- package/Tools/Brush/AdvancedBrushTool.d.ts +1 -5
- package/Tools/Brush/AdvancedBrushTool.js +2 -30
- package/Tools/Brush/Brush.d.ts +8 -2
- package/Tools/Brush/Brush.js +61 -36
- package/Tools/Tasks/TasksTool.d.ts +49 -20
- package/Tools/Tasks/TasksTool.js +87 -23
- package/Util/Binary/BinaryArrays.d.ts +2 -0
- package/Util/Binary/BinaryArrays.js +15 -0
- package/Util/Binary/BinaryFunctions.d.ts +3 -0
- package/Util/Binary/BinaryFunctions.js +18 -0
- package/Util/BinaryBuffer/BinaryBuffer.d.ts +30 -0
- package/Util/BinaryBuffer/BinaryBuffer.js +78 -0
- package/Util/BinaryBuffer/BinaryBuffer.types.d.ts +37 -0
- package/Util/BinaryBuffer/BinaryBuffer.types.js +28 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferConvert.d.ts +5 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferConvert.js +60 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferJSON.d.ts +3 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferJSON.js +64 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferRead.d.ts +3 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferRead.js +26 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferToTypedArray.d.ts +2 -0
- package/Util/BinaryBuffer/Functions/BinaryBufferToTypedArray.js +43 -0
- package/Util/BinaryBuffer/index.d.ts +2 -0
- package/Util/BinaryBuffer/index.js +2 -0
- package/Util/LocationData.d.ts +3 -0
- package/Util/LocationData.js +16 -0
- package/Util/PriorityQueue.d.ts +18 -0
- package/Util/PriorityQueue.js +62 -0
- package/Util/TickInterval.d.ts +16 -0
- package/Util/TickInterval.js +49 -0
- package/Util/TypedEventTarget.d.ts +1 -0
- package/Util/TypedEventTarget.js +3 -0
- package/Util/Util.types.d.ts +4 -0
- package/Util/WorkItemProgress.d.ts +23 -0
- package/Util/WorkItemProgress.js +52 -0
- package/Voxels/Archive/VoxelArchive.types.d.ts +43 -0
- package/Voxels/Archive/VoxelArchive.types.js +6 -0
- package/Voxels/Archive/VoxelPaletteArchiveReader.d.ts +11 -0
- package/Voxels/Archive/VoxelPaletteArchiveReader.js +73 -0
- package/Voxels/Archive/VoxelPaletteArechive.d.ts +15 -0
- package/Voxels/Archive/VoxelPaletteArechive.js +81 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +1 -0
- package/Voxels/Cursor/VoxelCursor.d.ts +6 -7
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +25 -24
- package/Voxels/Cursor/VoxelCursor.interface.js +93 -96
- package/Voxels/Cursor/VoxelCursor.js +22 -12
- package/Voxels/Cursor/VoxelLightData.d.ts +2 -0
- package/Voxels/Cursor/VoxelLightData.js +2 -0
- package/Voxels/Data/VoxelPalettesRegister.d.ts +11 -1
- package/Voxels/Data/VoxelPalettesRegister.js +17 -1
- package/Voxels/Data/VoxelPropertiesRegister.d.ts +4 -0
- package/Voxels/Data/VoxelPropertiesRegister.js +3 -0
- package/Voxels/Data/VoxelTag.types.d.ts +7 -1
- package/Voxels/Data/VoxelTag.types.js +3 -0
- package/Voxels/Data/VoxelTagsRegister.js +4 -1
- package/Voxels/Functions/BuildPaletteData.d.ts +6 -0
- package/Voxels/Functions/BuildPaletteData.js +87 -0
- package/Voxels/Functions/BuildStateData.d.ts +4 -6
- package/Voxels/Functions/BuildStateData.js +26 -80
- package/Voxels/Functions/{BuildTagAndPaletteData.d.ts → BuildTagData.d.ts} +2 -2
- package/Voxels/Functions/{BuildTagAndPaletteData.js → BuildTagData.js} +23 -2
- package/Voxels/Indexes/VoxelIndex.d.ts +1 -1
- package/Voxels/Indexes/VoxelIndex.js +5 -4
- package/Voxels/InitVoxelData.d.ts +1 -1
- package/Voxels/InitVoxelData.js +39 -41
- package/Voxels/Interaction/Functions/PickVoxel.d.ts +9 -0
- package/Voxels/Interaction/Functions/PickVoxel.js +95 -0
- package/Voxels/Interaction/Functions/PickVoxelWorld.d.ts +8 -0
- package/Voxels/Interaction/Functions/PickVoxelWorld.js +38 -0
- package/Voxels/Interaction/Placing/VoxelPlacingStrategy.d.ts +9 -0
- package/Voxels/Interaction/Placing/VoxelPlacingStrategy.js +58 -0
- package/Voxels/Interaction/Placing/VoxelPlacingStrategy.types.d.ts +15 -0
- package/Voxels/Interaction/Placing/VoxelPlacingStrategy.types.js +1 -0
- package/Voxels/Interaction/Placing/VoxelPlacingStrategyRegister.d.ts +7 -0
- package/Voxels/Interaction/Placing/VoxelPlacingStrategyRegister.js +13 -0
- package/Voxels/Interaction/VoxelPickResult.d.ts +51 -0
- package/Voxels/Interaction/VoxelPickResult.js +58 -0
- package/Voxels/Logic/Classes/Types/VoxelLogicPoweredType.d.ts +8 -0
- package/Voxels/Logic/Classes/Types/VoxelLogicPoweredType.js +13 -0
- package/Voxels/Logic/Classes/Types/VoxelLogicStateType.d.ts +9 -0
- package/Voxels/Logic/Classes/Types/VoxelLogicStateType.js +23 -0
- package/Voxels/Logic/Classes/VoxelLogic.d.ts +7 -4
- package/Voxels/Logic/Classes/VoxelLogic.js +25 -27
- package/Voxels/Logic/Classes/VoxelLogicType.d.ts +11 -1
- package/Voxels/Logic/Classes/VoxelLogicType.js +6 -0
- package/Voxels/Logic/VoxelLogic.types.d.ts +5 -3
- package/Voxels/Logic/VoxelLogicRegister.d.ts +4 -3
- package/Voxels/Logic/VoxelLogicRegister.js +12 -4
- package/Voxels/Models/CompiledVoxelModel.types.d.ts +46 -0
- package/Voxels/Models/CompiledVoxelModel.types.js +1 -0
- package/{Models → Voxels/Models}/Defaults/CubeVoxelGeometry.js +0 -30
- package/{Models → Voxels/Models}/Defaults/CubeVoxelModels.d.ts +2 -0
- package/{Models → Voxels/Models}/Defaults/CubeVoxelModels.js +187 -71
- package/{Models → Voxels/Models/Defaults}/Examples.d.ts +1 -1
- package/{Models → Voxels/Models/Defaults}/Examples.js +50 -147
- package/Voxels/Models/Defaults/FarmVoxelModels.d.ts +3 -0
- package/Voxels/Models/Defaults/FarmVoxelModels.js +349 -0
- package/{Models → Voxels/Models}/Defaults/LiquidVoxelModel.js +3 -1
- package/{Models → Voxels/Models}/Defaults/PanelVoxelGeometry.js +2 -92
- package/{Models → Voxels/Models}/Defaults/PanelVoxelModels.d.ts +1 -0
- package/{Models → Voxels/Models}/Defaults/PanelVoxelModels.js +52 -180
- package/{Models → Voxels/Models}/Defaults/StairVoxelModel.js +59 -149
- package/Voxels/Models/Indexing/AOOcclusionFaceIndex.d.ts +12 -0
- package/Voxels/Models/Indexing/AOOcclusionFaceIndex.js +28 -0
- package/Voxels/Models/Indexing/CulledOcclusionFaceIndex.d.ts +12 -0
- package/Voxels/Models/Indexing/CulledOcclusionFaceIndex.js +27 -0
- package/Voxels/Models/Rules/Classes/GeomtryInput.d.ts +13 -0
- package/Voxels/Models/Rules/Classes/GeomtryInput.js +64 -0
- package/Voxels/Models/Rules/Classes/OcclusionFace.d.ts +10 -0
- package/Voxels/Models/Rules/Classes/OcclusionFace.js +5 -0
- package/Voxels/Models/Rules/Classes/OcclusionFaceRegister.d.ts +18 -0
- package/Voxels/Models/Rules/Classes/OcclusionFaceRegister.js +33 -0
- package/Voxels/Models/Rules/Classes/OcclusionQuadFace.d.ts +14 -0
- package/Voxels/Models/Rules/Classes/OcclusionQuadFace.js +118 -0
- package/Voxels/Models/Rules/Classes/OcclusionTriangleFace.d.ts +14 -0
- package/Voxels/Models/Rules/Classes/OcclusionTriangleFace.js +114 -0
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.d.ts +22 -0
- package/Voxels/Models/Rules/Classes/VoxelRulesGeometry.js +15 -0
- package/{Models → Voxels/Models}/Rules/Classes/VoxelRulesModel.d.ts +3 -2
- package/{Models → Voxels/Models}/Rules/Functions/BuildFinalInputs.d.ts +0 -2
- package/Voxels/Models/Rules/Functions/BuildFinalInputs.js +72 -0
- package/Voxels/Models/Rules/Functions/BuildRules.d.ts +7 -0
- package/Voxels/Models/Rules/Functions/BuildRules.js +217 -0
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.d.ts +4 -0
- package/Voxels/Models/Rules/Functions/Compile/CompileGeomtryNodes.js +39 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CalcFunctions.d.ts +8 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CalcFunctions.js +106 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.d.ts +5 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileBoxGeometryNode.js +14 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.d.ts +6 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileQuadGeometryNode.js +92 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.d.ts +6 -0
- package/Voxels/Models/Rules/Functions/Compile/Nodes/CompileTriangleGeometryNode.js +115 -0
- package/{Models → Voxels/Models}/Rules/VoxelModelRuleBuilderRegister.d.ts +1 -1
- package/{Models → Voxels/Models}/Rules/VoxelModelRuleBuilderRegister.js +27 -3
- package/{Models → Voxels/Models}/VoxelModel.types.d.ts +56 -45
- package/Voxels/Models/VoxelModel.types.js +1 -0
- package/Voxels/State/Schema/BinarySchema.d.ts +5 -3
- package/Voxels/State/Schema/BinarySchema.js +23 -8
- package/Voxels/State/Schema/BinarySchemaNode.d.ts +4 -3
- package/Voxels/State/Schema/BinarySchemaNode.js +9 -6
- package/Voxels/State/Schema/Conditions/SameVoxelConditions.js +2 -0
- package/Voxels/State/Schema/ShapeStateRelationsNode.d.ts +3 -3
- package/Voxels/State/Schema/ShapeStateRelationsNode.js +2 -2
- package/Voxels/State/Schema/StateSchema.d.ts +2 -2
- package/Voxels/State/Schema/StateSchema.js +5 -7
- package/Voxels/State/SchemaRegister.d.ts +8 -6
- package/Voxels/State/SchemaRegister.js +33 -21
- package/Voxels/State/State.types.d.ts +19 -23
- package/Voxels/Types/PaintVoxelData.d.ts +27 -0
- package/Voxels/Types/PaintVoxelData.js +159 -0
- package/Voxels/Types/Voxel.types.d.ts +12 -25
- package/Voxels/Types/Voxel.types.js +1 -23
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -74
- package/Voxels/index.d.ts +1 -0
- package/Voxels/index.js +1 -0
- package/World/Archive/Classes/ArchiveClasses.d.ts +7 -30
- package/World/Archive/Classes/ArchiveClasses.js +8 -33
- package/World/Archive/Classes/ImportedSection.d.ts +4 -13
- package/World/Archive/Classes/ImportedSection.js +78 -216
- package/World/Archive/Classes/ImportedSector.d.ts +7 -9
- package/World/Archive/Classes/ImportedSector.js +18 -65
- package/World/Archive/Functions/Area/ArchiveArea.d.ts +8 -0
- package/World/Archive/Functions/Area/ArchiveArea.js +65 -0
- package/World/Archive/Functions/{ArchiveArea.d.ts → Area/ImportArea.d.ts} +1 -8
- package/World/Archive/Functions/Area/ImportArea.js +59 -0
- package/World/Archive/Functions/JSON/ExportArchivedAreaJSON.d.ts +2 -0
- package/World/Archive/Functions/JSON/ExportArchivedAreaJSON.js +100 -0
- package/World/Archive/Functions/JSON/ImportArchivedAreaJSON.d.ts +2 -0
- package/World/Archive/Functions/JSON/ImportArchivedAreaJSON.js +100 -0
- package/World/Archive/Functions/Sector/ArchiveSector.d.ts +7 -0
- package/World/Archive/Functions/Sector/ArchiveSector.js +209 -0
- package/World/Archive/Functions/Sector/CreateArchivedSection.d.ts +3 -0
- package/World/Archive/Functions/Sector/CreateArchivedSection.js +147 -0
- package/World/Archive/Functions/{ImportSector.d.ts → Sector/ImportSector.d.ts} +2 -2
- package/World/Archive/Functions/Sector/ImportSector.js +32 -0
- package/World/Archive/Functions/Sector/RemoveDuplicateSections.d.ts +2 -0
- package/World/Archive/Functions/Sector/RemoveDuplicateSections.js +137 -0
- package/World/Archive/Functions/Shared/BaseData.d.ts +2 -0
- package/World/Archive/Functions/Shared/BaseData.js +14 -0
- package/World/Archive/Functions/Shared/IntToString.d.ts +1 -0
- package/World/Archive/Functions/Shared/IntToString.js +13 -0
- package/World/Archive/Functions/{Shared.d.ts → Shared/LightSegments.d.ts} +2 -3
- package/World/Archive/Functions/{Shared.js → Shared/LightSegments.js} +2 -15
- package/World/Archive/Functions/Shared/index.d.ts +3 -0
- package/World/Archive/Functions/Shared/index.js +3 -0
- package/World/Archive/Functions/index.d.ts +3 -3
- package/World/Archive/Functions/index.js +3 -3
- package/World/Archive/InitTasks.js +21 -30
- package/World/Archive/Types/Archive.types.d.ts +45 -0
- package/World/Archive/Types/Archive.types.js +1 -0
- package/World/Archive/Types/ArchiveArea.types.d.ts +38 -0
- package/World/Archive/Types/ArchiveArea.types.js +1 -0
- package/World/Archive/Types/ArchiveJSON.types.d.ts +52 -0
- package/World/Archive/Types/ArchiveJSON.types.js +1 -0
- package/World/Archive/Types/ArchivedSector.types.d.ts +43 -0
- package/World/Archive/Types/ArchivedSector.types.js +1 -0
- package/World/Archive/Types/index.d.ts +4 -0
- package/World/Archive/Types/index.js +4 -0
- package/World/Archive/index.d.ts +1 -1
- package/World/Archive/index.js +1 -1
- package/World/Cursor/SectionCursor.d.ts +4 -3
- package/World/Cursor/SectionCursor.js +13 -11
- package/World/Cursor/SectorCursor.d.ts +4 -2
- package/World/Cursor/SectorCursor.js +11 -1
- package/World/Cursor/WorldCursor.d.ts +1 -0
- package/World/Cursor/WorldCursor.js +8 -5
- package/World/Cursor/WorldVoxelCursor.d.ts +1 -3
- package/World/Cursor/WorldVoxelCursor.js +6 -26
- package/World/InitTasks.js +52 -40
- package/World/Lock/Function/LockSectors.d.ts +2 -0
- package/World/Lock/Function/LockSectors.js +28 -0
- package/World/Lock/Function/UnLockSectors.d.ts +2 -0
- package/World/Lock/Function/UnLockSectors.js +28 -0
- package/World/Lock/WorldLock.d.ts +1 -2
- package/World/Lock/WorldLock.js +3 -1
- package/World/Section/Section.d.ts +16 -21
- package/World/Section/Section.js +67 -143
- package/World/Section/SectionState.d.ts +6 -2
- package/World/Section/SectionState.js +9 -4
- package/World/Sector/Sector.d.ts +22 -8
- package/World/Sector/Sector.js +86 -67
- package/World/Sector/SectorHeightMap.d.ts +1 -1
- package/World/Sector/SectorHeightMap.js +6 -6
- package/World/Sector/SectorState.d.ts +2 -1
- package/World/Sector/SectorState.js +1 -0
- package/World/SnapShot/SectionSnapShot.d.ts +19 -0
- package/World/SnapShot/SectionSnapShot.js +72 -0
- package/World/SnapShot/SectionSnapShotCursor.d.ts +23 -0
- package/World/SnapShot/SectionSnapShotCursor.js +107 -0
- package/World/SnapShot/SnapShots.d.ts +11 -0
- package/World/SnapShot/SnapShots.js +24 -0
- package/World/Types/WorldDataSyncIds.d.ts +2 -0
- package/World/Types/WorldDataSyncIds.js +2 -0
- package/World/WorldRegister.d.ts +19 -7
- package/World/WorldRegister.js +47 -23
- package/World/WorldSpaces.d.ts +20 -0
- package/World/WorldSpaces.js +33 -0
- package/WorldSimulation/Dimensions/DimensionSegment.d.ts +38 -0
- package/WorldSimulation/Dimensions/DimensionSegment.js +120 -0
- package/WorldSimulation/Dimensions/DimensionSimulation.d.ts +26 -0
- package/WorldSimulation/Dimensions/DimensionSimulation.js +95 -0
- package/WorldSimulation/{Internal/Classes → Dimensions}/Generator.d.ts +5 -9
- package/WorldSimulation/{Internal/Classes → Dimensions}/Generator.js +10 -21
- package/WorldSimulation/{Internal/Classes → Dimensions}/SectorState.d.ts +4 -0
- package/WorldSimulation/Dimensions/SectorState.js +56 -0
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +30 -0
- package/WorldSimulation/Dimensions/SimulationSector.js +214 -0
- package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +1 -1
- package/WorldSimulation/Internal/WorldSimulationDimensions.js +4 -3
- package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +14 -9
- package/WorldSimulation/Internal/WorldSimulationTasks.js +132 -61
- package/WorldSimulation/Internal/runActiveSectorUpdate.d.ts +1 -0
- package/WorldSimulation/Internal/runActiveSectorUpdate.js +106 -0
- package/WorldSimulation/Procedures/InitalLoad.d.ts +1 -1
- package/WorldSimulation/Procedures/InitalLoad.js +6 -4
- package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +19 -0
- package/WorldSimulation/Tasks/SimulationTaskBase.js +50 -0
- package/WorldSimulation/Tasks/TaskRegister.d.ts +7 -0
- package/WorldSimulation/{Internal → Tasks}/TaskRegister.js +3 -3
- package/WorldSimulation/Tasks/TaskSegment.d.ts +20 -0
- package/WorldSimulation/Tasks/TaskSegment.js +83 -0
- package/WorldSimulation/Tick/TickQueue.d.ts +9 -0
- package/WorldSimulation/Tick/TickQueue.js +31 -0
- package/WorldSimulation/Tools/SimulationBrush.d.ts +25 -0
- package/WorldSimulation/Tools/SimulationBrush.js +203 -0
- package/WorldSimulation/Voxels/Behaviors/Types/CropVoxelBehavior.d.ts +1 -0
- package/WorldSimulation/Voxels/Behaviors/Types/CropVoxelBehavior.js +23 -0
- package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.d.ts +1 -0
- package/WorldSimulation/Voxels/Behaviors/Types/DefaultVoxelBehavior.js +10 -0
- package/WorldSimulation/Voxels/Behaviors/Types/FarmlandVoxelBehavior.d.ts +1 -0
- package/WorldSimulation/Voxels/Behaviors/Types/FarmlandVoxelBehavior.js +73 -0
- package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.d.ts +1 -0
- package/WorldSimulation/Voxels/Behaviors/Types/LiquidVoxelBehavior.js +21 -0
- package/WorldSimulation/Voxels/Behaviors/Types/index.d.ts +4 -0
- package/WorldSimulation/Voxels/Behaviors/Types/index.js +4 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.d.ts +18 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviors.js +30 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviorsRegister.d.ts +6 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelBehaviorsRegister.js +25 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelUpdate.d.ts +10 -0
- package/WorldSimulation/Voxels/Behaviors/VoxelUpdate.js +1 -0
- package/WorldSimulation/Voxels/Behaviors/index.d.ts +4 -0
- package/WorldSimulation/Voxels/Behaviors/index.js +4 -0
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.d.ts +1 -0
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +163 -0
- package/WorldSimulation/Voxels/Ticks/Types/index.d.ts +1 -0
- package/WorldSimulation/Voxels/Ticks/Types/index.js +1 -0
- package/WorldSimulation/Voxels/Ticks/VoxelTickUpdate.d.ts +8 -0
- package/WorldSimulation/Voxels/Ticks/VoxelTickUpdate.js +14 -0
- package/WorldSimulation/Voxels/Ticks/VoxelTickUpdateRegister.d.ts +6 -0
- package/WorldSimulation/Voxels/Ticks/VoxelTickUpdateRegister.js +13 -0
- package/WorldSimulation/Voxels/Ticks/VoxelTickUpdateType.d.ts +12 -0
- package/WorldSimulation/Voxels/Ticks/VoxelTickUpdateType.js +10 -0
- package/WorldSimulation/Voxels/Ticks/index.d.ts +4 -0
- package/WorldSimulation/Voxels/Ticks/index.js +4 -0
- package/WorldSimulation/WorldSimulation.d.ts +5 -4
- package/WorldSimulation/WorldSimulation.js +31 -35
- package/package.json +2 -2
- package/Contexts/Constructor/DivineVoxelEngineConstructor.d.ts +0 -10
- package/Contexts/Constructor/DivineVoxelEngineConstructor.js +0 -14
- package/Contexts/Constructor/index.d.ts +0 -1
- package/Contexts/Constructor/index.js +0 -1
- package/Init/StartConstructor.d.ts +0 -2
- package/Init/StartConstructor.js +0 -59
- package/Mesher/Models/Common/BoundsFunctions.d.ts +0 -2
- package/Mesher/Models/Common/BoxGeometryNode.d.ts +0 -10
- package/Mesher/Models/Common/BoxGeometryNode.js +0 -80
- package/Mesher/Models/Common/QuadGeometryNode.d.ts +0 -11
- package/Mesher/Models/Common/QuadGeometryNode.js +0 -51
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +0 -24
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +0 -173
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.d.ts +0 -19
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +0 -157
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.d.ts +0 -22
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +0 -75
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.d.ts +0 -18
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +0 -77
- package/Mesher/Models/Protocols/OutlinedVoxelTool.d.ts +0 -6
- package/Mesher/Models/Protocols/OutlinedVoxelTool.js +0 -233
- package/Models/Indexing/VoxelAOResultsIndex.d.ts +0 -12
- package/Models/Indexing/VoxelAOResultsIndex.js +0 -26
- package/Models/Indexing/VoxelFaceCullResultsIndex.d.ts +0 -12
- package/Models/Indexing/VoxelFaceCullResultsIndex.js +0 -26
- package/Models/Indexing/VoxelFaceTransparentResultsIndex.d.ts +0 -11
- package/Models/Indexing/VoxelFaceTransparentResultsIndex.js +0 -15
- package/Models/Input/BoxVoxelGometryInputs.d.ts +0 -25
- package/Models/Input/BoxVoxelGometryInputs.js +0 -36
- package/Models/Input/QuadVoxelGometryInputs.d.ts +0 -24
- package/Models/Rules/Classes/OcclusionFace.d.ts +0 -65
- package/Models/Rules/Classes/OcclusionFace.js +0 -492
- package/Models/Rules/Classes/VoxelRulesGeometry.d.ts +0 -15
- package/Models/Rules/Classes/VoxelRulesGeometry.js +0 -29
- package/Models/Rules/Functions/BuildFinalInputs.js +0 -93
- package/Models/Rules/Functions/BuildGeomtryInputs.d.ts +0 -6
- package/Models/Rules/Functions/BuildGeomtryInputs.js +0 -251
- package/Models/Rules/Functions/BuildRules.d.ts +0 -8
- package/Models/Rules/Functions/BuildRules.js +0 -187
- package/Models/Rules/Functions/GetOcclusionFaces.d.ts +0 -4
- package/Models/Rules/Functions/GetOcclusionFaces.js +0 -112
- package/Models/Shared/Transform.d.ts +0 -4
- package/Tasks/Logic/InitTasks.js +0 -10
- package/Tasks/Logic/VoxelLogicUpdate.d.ts +0 -3
- package/Tasks/Logic/VoxelLogicUpdate.js +0 -71
- package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +0 -4
- package/Tasks/Propagation/Explosion/ExplosionManager.js +0 -116
- package/Tasks/Update/Common.d.ts +0 -3
- package/Tasks/Update/Common.js +0 -41
- package/Tasks/Update/EreaseUpdate.d.ts +0 -3
- package/Tasks/Update/EreaseUpdate.js +0 -66
- package/Tasks/Update/InitTasks.d.ts +0 -5
- package/Tasks/Update/InitTasks.js +0 -25
- package/Tasks/Update/PaintUpdate.d.ts +0 -3
- package/Tasks/Update/PaintUpdate.js +0 -89
- package/Tasks/Update/VoxelUpdate.d.ts +0 -3
- package/Tasks/Update/VoxelUpdate.js +0 -35
- package/Templates/FullVoxelTemplate.d.ts +0 -14
- package/Templates/FullVoxelTemplate.js +0 -61
- package/Templates/Functions/CreateTemplate.d.ts +0 -3
- package/Templates/Functions/CreateTemplate.js +0 -134
- package/Templates/VoxelTemplate.d.ts +0 -34
- package/Templates/VoxelTemplate.js +0 -135
- package/Util/Binary/BinaryBuffer.d.ts +0 -35
- package/Util/Binary/BinaryBuffer.js +0 -136
- package/Util/Binary/Palettes.d.ts +0 -5
- package/Util/Binary/Palettes.js +0 -46
- package/Util/LocationVisitedMap.d.ts +0 -9
- package/Util/LocationVisitedMap.js +0 -18
- package/Util/VisistedMap.d.ts +0 -10
- package/Util/VisistedMap.js +0 -29
- package/Voxels/Data/VoxelTagStates.d.ts +0 -22
- package/Voxels/Data/VoxelTagStates.js +0 -47
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +0 -5
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +0 -6
- package/World/Archive/Archive.types.d.ts +0 -182
- package/World/Archive/Functions/ArchiveArea.js +0 -341
- package/World/Archive/Functions/ArchiveSector.d.ts +0 -7
- package/World/Archive/Functions/ArchiveSector.js +0 -431
- package/World/Archive/Functions/CreateArchivedSection.d.ts +0 -3
- package/World/Archive/Functions/CreateArchivedSection.js +0 -207
- package/World/Archive/Functions/ImportSector.js +0 -57
- package/World/Archive/Functions/RemoveDuplicates.d.ts +0 -3
- package/World/Archive/Functions/RemoveDuplicates.js +0 -92
- package/WorldSimulation/Internal/Classes/DimensionSegment.d.ts +0 -37
- package/WorldSimulation/Internal/Classes/DimensionSegment.js +0 -67
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +0 -5
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +0 -6
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +0 -5
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +0 -6
- package/WorldSimulation/Internal/Classes/SectorState.js +0 -20
- package/WorldSimulation/Internal/Classes/SectorVisistedMap.d.ts +0 -9
- package/WorldSimulation/Internal/Classes/SectorVisistedMap.js +0 -24
- package/WorldSimulation/Internal/Classes/TickQueue.d.ts +0 -12
- package/WorldSimulation/Internal/Classes/TickQueue.js +0 -58
- package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +0 -15
- package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js +0 -62
- package/WorldSimulation/Internal/Functions/cullSectors.d.ts +0 -2
- package/WorldSimulation/Internal/Functions/cullSectors.js +0 -111
- package/WorldSimulation/Internal/Functions/getSectorState.d.ts +0 -4
- package/WorldSimulation/Internal/Functions/getSectorState.js +0 -39
- package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +0 -2
- package/WorldSimulation/Internal/Functions/runTickUpdate.js +0 -80
- package/WorldSimulation/Internal/Functions/runWorldUpdate.d.ts +0 -2
- package/WorldSimulation/Internal/Functions/runWorldUpdate.js +0 -69
- package/WorldSimulation/Internal/TaskRegister.d.ts +0 -7
- /package/{Models/VoxelModel.types.js → Builder/RayProvider.js} +0 -0
- /package/{World/Archive/Archive.types.js → Math/Location.js} +0 -0
- /package/Tasks/{Logic → Paint}/InitTasks.d.ts +0 -0
- /package/Util/{Binary/BinaryTree.d.ts → FlatBinaryTreeIndex.d.ts} +0 -0
- /package/Util/{Binary/BinaryTree.js → FlatBinaryTreeIndex.js} +0 -0
- /package/{Models → Voxels/Models}/Defaults/CubeVoxelGeometry.d.ts +0 -0
- /package/{Models → Voxels/Models}/Defaults/LiquidVoxelModel.d.ts +0 -0
- /package/{Models → Voxels/Models}/Defaults/PanelVoxelGeometry.d.ts +0 -0
- /package/{Models → Voxels/Models}/Defaults/StairVoxelModel.d.ts +0 -0
- /package/{Models → Voxels/Models}/Indexing/VoxelRelativeCubeIndex.d.ts +0 -0
- /package/{Models → Voxels/Models}/Indexing/VoxelRelativeCubeIndex.js +0 -0
- /package/{Models → Voxels/Models}/Rules/Classes/VoxelRulesModel.js +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Matrix2x2Like, Vec2ArrayLike, Vec3ArrayLike, Vector3Like, } from "@amodx/math";
|
|
2
|
+
import { TriangleVector2VertexData, TriangleVector3VertexData, } from "./TriangleVertexData";
|
|
3
|
+
import { GetBounds } from "../Functions/GetBounds";
|
|
4
|
+
// You would import the triangle-based vertex-data classes here, e.g.:
|
|
5
|
+
// import { TriVector3VertexData, TriVector2VertexData } from "./TriVertexData";
|
|
6
|
+
// or however you have named them and placed them in your codebase.
|
|
7
|
+
//
|
|
8
|
+
// For example:
|
|
9
|
+
// import { TriUVData, TriVertexVec3Data } from "../Geometry.types";
|
|
10
|
+
/**
|
|
11
|
+
* Example "TriUVData" type for clarity:
|
|
12
|
+
* export type TriUVData = [Vec2Array, Vec2Array, Vec2Array];
|
|
13
|
+
*
|
|
14
|
+
* Example "TriVertexVec3Data" type:
|
|
15
|
+
* export type TriVertexVec3Data = [Vec3Array, Vec3Array, Vec3Array];
|
|
16
|
+
*/
|
|
17
|
+
export class Triangle {
|
|
18
|
+
/**
|
|
19
|
+
* A simple set of "full" UVs for a triangle, in whichever ordering convention you prefer.
|
|
20
|
+
* Adapt this to your own standard. Below is just a quick example:
|
|
21
|
+
*/
|
|
22
|
+
static FullUVs = Object.freeze([
|
|
23
|
+
[0, 0], // p1
|
|
24
|
+
[1, 0], // p2
|
|
25
|
+
[0, 1], // p3
|
|
26
|
+
]);
|
|
27
|
+
/**
|
|
28
|
+
* Rotate triangle UVs about a pivot, defaulting to [0.5, 0.5] if you wish (or you can adapt).
|
|
29
|
+
* This example matches the style of the Quad rotation.
|
|
30
|
+
*/
|
|
31
|
+
static RotateUvs(uvs, rotation) {
|
|
32
|
+
const rotationMatrix = Matrix2x2Like.Rotation(rotation);
|
|
33
|
+
const pivot = [0.5, 0.5];
|
|
34
|
+
return [
|
|
35
|
+
Vec2ArrayLike.RotateAroundPivot(rotationMatrix, uvs[0], pivot),
|
|
36
|
+
Vec2ArrayLike.RotateAroundPivot(rotationMatrix, uvs[1], pivot),
|
|
37
|
+
Vec2ArrayLike.RotateAroundPivot(rotationMatrix, uvs[2], pivot),
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Factory method for creating a Tri instance.
|
|
42
|
+
*/
|
|
43
|
+
static Create(positions, uvs, doubleSided) {
|
|
44
|
+
return new Triangle({ positions, uvs, doubleSided });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Computes a right-handed normal for a triangle given three points p1, p2, p3.
|
|
48
|
+
* The cross product is (p2 - p1) x (p3 - p1).
|
|
49
|
+
* This returns a single normal, but we place it in a triple for each vertex
|
|
50
|
+
* in case you want distinct normal per vertex.
|
|
51
|
+
*/
|
|
52
|
+
static GetNormalRightHanded(p1, p2, p3) {
|
|
53
|
+
const v1 = Vec3ArrayLike.Subtract(p2, p1);
|
|
54
|
+
const v2 = Vec3ArrayLike.Subtract(p3, p1);
|
|
55
|
+
const normal = Vec3ArrayLike.Normalize(Vec3ArrayLike.Cross(v1, v2));
|
|
56
|
+
// By default, each vertex gets the same face-normal (flat shading).
|
|
57
|
+
return [normal, normal, normal];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Computes a left-handed normal for a triangle. This is simply flipping the sign
|
|
61
|
+
* of the right-handed normal (or reversing the cross).
|
|
62
|
+
*/
|
|
63
|
+
static GetNormalLeftHanded(p1, p2, p3) {
|
|
64
|
+
const v1 = Vec3ArrayLike.Subtract(p2, p1);
|
|
65
|
+
const v2 = Vec3ArrayLike.Subtract(p3, p1);
|
|
66
|
+
// Multiply by -1 for a left-handed version
|
|
67
|
+
const normal = Vec3ArrayLike.MultiplyScalar(Vec3ArrayLike.Normalize(Vec3ArrayLike.Cross(v1, v2)), -1);
|
|
68
|
+
return [normal, normal, normal];
|
|
69
|
+
}
|
|
70
|
+
// If you need an equivalent "OrderTriVertices" or any other specialized
|
|
71
|
+
// re-ordering method, you can add it here. For many triangle uses, you
|
|
72
|
+
// might not need a sorting or "direction" function as in the Quad.
|
|
73
|
+
// Replace these with your own triangle-based vertex-data classes:
|
|
74
|
+
// e.g. TriVector3VertexData, TriVector2VertexData, etc.
|
|
75
|
+
positions /*: TriVector3VertexData*/;
|
|
76
|
+
normals /*: TriVector3VertexData*/;
|
|
77
|
+
uvs /*: TriVector2VertexData*/;
|
|
78
|
+
doubleSided = false;
|
|
79
|
+
bounds = [
|
|
80
|
+
[0, 0, 0],
|
|
81
|
+
[0, 0, 0],
|
|
82
|
+
];
|
|
83
|
+
constructor(data) {
|
|
84
|
+
// Replace these with your Tri* vertex data:
|
|
85
|
+
// (The code below assumes you have classes like TriVector3VertexData, TriVector2VertexData
|
|
86
|
+
// that behave similarly to your Quad-based classes.)
|
|
87
|
+
this.positions = new TriangleVector3VertexData();
|
|
88
|
+
this.normals = new TriangleVector3VertexData();
|
|
89
|
+
this.uvs = new TriangleVector2VertexData();
|
|
90
|
+
if (data.positions)
|
|
91
|
+
this.setPositions(data.positions);
|
|
92
|
+
if (data.uvs)
|
|
93
|
+
this.setUVs(data.uvs);
|
|
94
|
+
if (data.doubleSided)
|
|
95
|
+
this.doubleSided = data.doubleSided;
|
|
96
|
+
}
|
|
97
|
+
setUVs([uv1, uv2, uv3]) {
|
|
98
|
+
this.uvs.vertices[0].x = uv1[0];
|
|
99
|
+
this.uvs.vertices[0].y = uv1[1];
|
|
100
|
+
this.uvs.vertices[0].x = uv1[0];
|
|
101
|
+
this.uvs.vertices[0].y = uv1[1];
|
|
102
|
+
// e.g. this.uvs.set(Vector2Like.FromArray(uv1), Vector2Like.FromArray(uv2), Vector2Like.FromArray(uv3));
|
|
103
|
+
// Adapt to however your TriVector2VertexData sets 3 corners.
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Scales all positions of the triangle by the given x, y, z factors.
|
|
108
|
+
*/
|
|
109
|
+
scale(x, y, z) {
|
|
110
|
+
const scale = Vector3Like.Create(x, y, z);
|
|
111
|
+
for (const position of this.positions) {
|
|
112
|
+
Vector3Like.MultiplyInPlace(position, scale);
|
|
113
|
+
}
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Translates all positions by (x, y, z).
|
|
118
|
+
*/
|
|
119
|
+
transform(x, y, z) {
|
|
120
|
+
const shift = Vector3Like.Create(x, y, z);
|
|
121
|
+
for (const position of this.positions) {
|
|
122
|
+
Vector3Like.AddInPlace(position, shift);
|
|
123
|
+
}
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Sets positions, computing a left-handed normal by default (matching your Quad).
|
|
128
|
+
* Adapt if you need right-handed or detect it automatically.
|
|
129
|
+
*/
|
|
130
|
+
setPositions(positions) {
|
|
131
|
+
// Compute normals
|
|
132
|
+
const [n1, n2, n3] = Triangle.GetNormalLeftHanded(...positions);
|
|
133
|
+
this.positions.set(Vector3Like.FromArray(positions[0]), Vector3Like.FromArray(positions[1]), Vector3Like.FromArray(positions[2]));
|
|
134
|
+
this.normals.set(Vector3Like.FromArray(n1), Vector3Like.FromArray(n2), Vector3Like.FromArray(n3));
|
|
135
|
+
this.bounds = GetBounds(...this.positions);
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Clones the triangle, copying position and UV data.
|
|
140
|
+
*/
|
|
141
|
+
clone() {
|
|
142
|
+
const cloned = Triangle.Create(this.positions.toVec3Array(), this.uvs.toVec2Array(), this.doubleSided);
|
|
143
|
+
// if needed, set those data explicitly:
|
|
144
|
+
// cloned.positions.setFromTriData(this.positions);
|
|
145
|
+
// cloned.uvs.setFromTriData(this.uvs);
|
|
146
|
+
return cloned;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Vector3Like, Vector2Like, Vec3Array, Vec2Array } from "@amodx/math";
|
|
2
|
+
import { TriangleVerticies } from "../Geometry.types";
|
|
3
|
+
type TriangleDataType<Data> = [Data, Data, Data];
|
|
4
|
+
export declare class TriangleVertexData<Data> {
|
|
5
|
+
vertices: TriangleDataType<Data>;
|
|
6
|
+
constructor(vertices: TriangleDataType<Data>);
|
|
7
|
+
toArray(): Data[];
|
|
8
|
+
setVertex(vertex: TriangleVerticies, value: Data): void;
|
|
9
|
+
getVertex(vertex: TriangleVerticies): Data;
|
|
10
|
+
setAll(value: Data): void;
|
|
11
|
+
set(v1: Data, v2: Data, v3: Data): void;
|
|
12
|
+
isEqualTo(v1: Data, v2: Data, v3: Data): boolean;
|
|
13
|
+
isAllEqualTo(value: Data): boolean;
|
|
14
|
+
[Symbol.iterator](): Iterator<Data>;
|
|
15
|
+
clone(): TriangleVertexData<Data>;
|
|
16
|
+
}
|
|
17
|
+
export declare class TriangleVector3VertexData extends TriangleVertexData<Vector3Like> {
|
|
18
|
+
vertices: TriangleDataType<Vector3Like>;
|
|
19
|
+
constructor(vertices?: TriangleDataType<Vector3Like>);
|
|
20
|
+
setFromQuadData(vertexData: TriangleVertexData<Vector3Like>): void;
|
|
21
|
+
addToVertex(vertex: TriangleVerticies, value: Vector3Like): void;
|
|
22
|
+
subtractFromVertex(vertex: TriangleVerticies, value: Vector3Like): void;
|
|
23
|
+
addAll(value: Vector3Like): void;
|
|
24
|
+
subtractAll(value: Vector3Like): void;
|
|
25
|
+
isEqualTo(v1: Vector3Like, v2: Vector3Like, v3: Vector3Like): boolean;
|
|
26
|
+
isAllEqualTo(v1: Vector3Like): boolean;
|
|
27
|
+
clone(): TriangleVector3VertexData;
|
|
28
|
+
toVec3Array(): [Vec3Array, Vec3Array, Vec3Array];
|
|
29
|
+
}
|
|
30
|
+
export declare class TriangleVector2VertexData extends TriangleVertexData<Vector2Like> {
|
|
31
|
+
vertices: TriangleDataType<Vector2Like>;
|
|
32
|
+
constructor(vertices?: TriangleDataType<Vector2Like>);
|
|
33
|
+
setFromQuadData(vertexData: TriangleVertexData<Vector3Like>): void;
|
|
34
|
+
addToVertex(vertex: TriangleVerticies, value: Vector2Like): void;
|
|
35
|
+
subtractFromVertex(vertex: TriangleVerticies, value: Vector2Like): void;
|
|
36
|
+
addAll(value: Vector2Like): void;
|
|
37
|
+
subtractAll(value: Vector2Like): void;
|
|
38
|
+
isEqualTo(v1: Vector2Like, v2: Vector2Like, v3: Vector2Like): boolean;
|
|
39
|
+
isAllEqualTo(v1: Vector2Like): boolean;
|
|
40
|
+
toVec2Array(): [Vec2Array, Vec2Array, Vec2Array];
|
|
41
|
+
clone(): TriangleVector2VertexData;
|
|
42
|
+
}
|
|
43
|
+
export declare class TriangleScalarVertexData extends TriangleVertexData<number> {
|
|
44
|
+
vertices: TriangleDataType<number>;
|
|
45
|
+
constructor(vertices?: TriangleDataType<number>);
|
|
46
|
+
setFromQuadData(vertexData: TriangleVertexData<number>): void;
|
|
47
|
+
subtractFromVertex(vertex: TriangleVerticies, value: number): void;
|
|
48
|
+
addAll(value: number): void;
|
|
49
|
+
add(v1: number, v2: number, v3: number, v4: number): void;
|
|
50
|
+
subtractAll(value: number): void;
|
|
51
|
+
subtract(v1: number, v2: number, v3: number, v4: number): void;
|
|
52
|
+
isGreaterThan(v1: number, v2: number, v3: number, v4: number): boolean;
|
|
53
|
+
isAllGreaterThan(value: number): boolean;
|
|
54
|
+
isLessThan(v1: number, v2: number, v3: number, v4: number): boolean;
|
|
55
|
+
isAllLessThan(value: number): boolean;
|
|
56
|
+
clone(): TriangleScalarVertexData;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { Vector3Like, Vector2Like } from "@amodx/math";
|
|
2
|
+
import { TriangleVerticies } from "../Geometry.types";
|
|
3
|
+
export class TriangleVertexData {
|
|
4
|
+
vertices;
|
|
5
|
+
constructor(vertices) {
|
|
6
|
+
this.vertices = vertices;
|
|
7
|
+
}
|
|
8
|
+
toArray() {
|
|
9
|
+
return [
|
|
10
|
+
this.vertices[TriangleVerticies.One],
|
|
11
|
+
this.vertices[TriangleVerticies.Two],
|
|
12
|
+
this.vertices[TriangleVerticies.Three],
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
setVertex(vertex, value) {
|
|
16
|
+
this.vertices[vertex] = value;
|
|
17
|
+
}
|
|
18
|
+
getVertex(vertex) {
|
|
19
|
+
return this.vertices[vertex];
|
|
20
|
+
}
|
|
21
|
+
setAll(value) {
|
|
22
|
+
this.vertices[TriangleVerticies.One] = value;
|
|
23
|
+
this.vertices[TriangleVerticies.Two] = value;
|
|
24
|
+
this.vertices[TriangleVerticies.Three] = value;
|
|
25
|
+
}
|
|
26
|
+
set(v1, v2, v3) {
|
|
27
|
+
this.vertices[TriangleVerticies.One] = v1;
|
|
28
|
+
this.vertices[TriangleVerticies.Two] = v2;
|
|
29
|
+
this.vertices[TriangleVerticies.Three] = v3;
|
|
30
|
+
}
|
|
31
|
+
isEqualTo(v1, v2, v3) {
|
|
32
|
+
if (this.vertices[TriangleVerticies.One] != v1)
|
|
33
|
+
return false;
|
|
34
|
+
if (this.vertices[TriangleVerticies.Two] != v2)
|
|
35
|
+
return false;
|
|
36
|
+
if (this.vertices[TriangleVerticies.Three] != v3)
|
|
37
|
+
return false;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
isAllEqualTo(value) {
|
|
41
|
+
if (this.vertices[TriangleVerticies.One] != value)
|
|
42
|
+
return false;
|
|
43
|
+
if (this.vertices[TriangleVerticies.Two] != value)
|
|
44
|
+
return false;
|
|
45
|
+
if (this.vertices[TriangleVerticies.Three] != value)
|
|
46
|
+
return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
[Symbol.iterator]() {
|
|
50
|
+
let index = TriangleVerticies.One;
|
|
51
|
+
const items = this.vertices;
|
|
52
|
+
return {
|
|
53
|
+
next() {
|
|
54
|
+
if (index < TriangleVerticies.Three) {
|
|
55
|
+
return { value: items[index++], done: false };
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return { value: undefined, done: true };
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
clone() {
|
|
64
|
+
return new TriangleVertexData([
|
|
65
|
+
structuredClone(this.vertices[TriangleVerticies.One]),
|
|
66
|
+
structuredClone(this.vertices[TriangleVerticies.Two]),
|
|
67
|
+
structuredClone(this.vertices[TriangleVerticies.Three]),
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export class TriangleVector3VertexData extends TriangleVertexData {
|
|
72
|
+
vertices;
|
|
73
|
+
constructor(vertices = [
|
|
74
|
+
Vector3Like.Create(),
|
|
75
|
+
Vector3Like.Create(),
|
|
76
|
+
Vector3Like.Create(),
|
|
77
|
+
]) {
|
|
78
|
+
super(vertices);
|
|
79
|
+
this.vertices = vertices;
|
|
80
|
+
}
|
|
81
|
+
setFromQuadData(vertexData) {
|
|
82
|
+
Vector3Like.Copy(this.vertices[TriangleVerticies.One], vertexData.vertices[TriangleVerticies.One]);
|
|
83
|
+
Vector3Like.Copy(this.vertices[TriangleVerticies.Two], vertexData.vertices[TriangleVerticies.Two]);
|
|
84
|
+
Vector3Like.Copy(this.vertices[TriangleVerticies.Three], vertexData.vertices[TriangleVerticies.Three]);
|
|
85
|
+
}
|
|
86
|
+
addToVertex(vertex, value) {
|
|
87
|
+
Vector3Like.AddInPlace(this.vertices[vertex], value);
|
|
88
|
+
}
|
|
89
|
+
subtractFromVertex(vertex, value) {
|
|
90
|
+
Vector3Like.SubtractInPlace(this.vertices[vertex], value);
|
|
91
|
+
}
|
|
92
|
+
addAll(value) {
|
|
93
|
+
this.addToVertex(TriangleVerticies.One, value);
|
|
94
|
+
this.addToVertex(TriangleVerticies.Two, value);
|
|
95
|
+
this.addToVertex(TriangleVerticies.Three, value);
|
|
96
|
+
}
|
|
97
|
+
subtractAll(value) {
|
|
98
|
+
this.subtractFromVertex(TriangleVerticies.One, value);
|
|
99
|
+
this.subtractFromVertex(TriangleVerticies.Two, value);
|
|
100
|
+
this.subtractFromVertex(TriangleVerticies.Three, value);
|
|
101
|
+
}
|
|
102
|
+
isEqualTo(v1, v2, v3) {
|
|
103
|
+
return (Vector3Like.Equals(this.vertices[TriangleVerticies.One], v1) &&
|
|
104
|
+
Vector3Like.Equals(this.vertices[TriangleVerticies.Two], v2) &&
|
|
105
|
+
Vector3Like.Equals(this.vertices[TriangleVerticies.Three], v3));
|
|
106
|
+
}
|
|
107
|
+
isAllEqualTo(v1) {
|
|
108
|
+
return (Vector3Like.Equals(this.vertices[TriangleVerticies.One], v1) &&
|
|
109
|
+
Vector3Like.Equals(this.vertices[TriangleVerticies.Two], v1) &&
|
|
110
|
+
Vector3Like.Equals(this.vertices[TriangleVerticies.Three], v1));
|
|
111
|
+
}
|
|
112
|
+
clone() {
|
|
113
|
+
return new TriangleVector3VertexData([
|
|
114
|
+
Vector3Like.Clone(this.vertices[TriangleVerticies.One]),
|
|
115
|
+
Vector3Like.Clone(this.vertices[TriangleVerticies.Two]),
|
|
116
|
+
Vector3Like.Clone(this.vertices[TriangleVerticies.Three]),
|
|
117
|
+
]);
|
|
118
|
+
}
|
|
119
|
+
toVec3Array() {
|
|
120
|
+
return [
|
|
121
|
+
Vector3Like.ToArray(this.vertices[0]),
|
|
122
|
+
Vector3Like.ToArray(this.vertices[1]),
|
|
123
|
+
Vector3Like.ToArray(this.vertices[2]),
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export class TriangleVector2VertexData extends TriangleVertexData {
|
|
128
|
+
vertices;
|
|
129
|
+
constructor(vertices = [
|
|
130
|
+
Vector2Like.Create(),
|
|
131
|
+
Vector2Like.Create(),
|
|
132
|
+
Vector2Like.Create(),
|
|
133
|
+
]) {
|
|
134
|
+
super(vertices);
|
|
135
|
+
this.vertices = vertices;
|
|
136
|
+
}
|
|
137
|
+
setFromQuadData(vertexData) {
|
|
138
|
+
Vector2Like.Copy(this.vertices[TriangleVerticies.One], vertexData.vertices[TriangleVerticies.One]);
|
|
139
|
+
Vector2Like.Copy(this.vertices[TriangleVerticies.Two], vertexData.vertices[TriangleVerticies.Two]);
|
|
140
|
+
Vector2Like.Copy(this.vertices[TriangleVerticies.Three], vertexData.vertices[TriangleVerticies.Three]);
|
|
141
|
+
}
|
|
142
|
+
addToVertex(vertex, value) {
|
|
143
|
+
Vector2Like.AddInPlace(this.vertices[vertex], value);
|
|
144
|
+
}
|
|
145
|
+
subtractFromVertex(vertex, value) {
|
|
146
|
+
Vector2Like.SubtractInPlace(this.vertices[vertex], value);
|
|
147
|
+
}
|
|
148
|
+
addAll(value) {
|
|
149
|
+
this.addToVertex(TriangleVerticies.One, value);
|
|
150
|
+
this.addToVertex(TriangleVerticies.Two, value);
|
|
151
|
+
this.addToVertex(TriangleVerticies.Three, value);
|
|
152
|
+
}
|
|
153
|
+
subtractAll(value) {
|
|
154
|
+
this.subtractFromVertex(TriangleVerticies.One, value);
|
|
155
|
+
this.subtractFromVertex(TriangleVerticies.Two, value);
|
|
156
|
+
this.subtractFromVertex(TriangleVerticies.Three, value);
|
|
157
|
+
}
|
|
158
|
+
isEqualTo(v1, v2, v3) {
|
|
159
|
+
return (Vector2Like.Equals(this.vertices[TriangleVerticies.One], v1) &&
|
|
160
|
+
Vector2Like.Equals(this.vertices[TriangleVerticies.Two], v2) &&
|
|
161
|
+
Vector2Like.Equals(this.vertices[TriangleVerticies.Three], v3));
|
|
162
|
+
}
|
|
163
|
+
isAllEqualTo(v1) {
|
|
164
|
+
return (Vector2Like.Equals(this.vertices[TriangleVerticies.One], v1) &&
|
|
165
|
+
Vector2Like.Equals(this.vertices[TriangleVerticies.Two], v1) &&
|
|
166
|
+
Vector2Like.Equals(this.vertices[TriangleVerticies.Three], v1));
|
|
167
|
+
}
|
|
168
|
+
toVec2Array() {
|
|
169
|
+
return [
|
|
170
|
+
Vector2Like.ToArray(this.vertices[0]),
|
|
171
|
+
Vector2Like.ToArray(this.vertices[1]),
|
|
172
|
+
Vector2Like.ToArray(this.vertices[2]),
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
clone() {
|
|
176
|
+
return new TriangleVector2VertexData([
|
|
177
|
+
Vector2Like.Clone(this.vertices[TriangleVerticies.One]),
|
|
178
|
+
Vector2Like.Clone(this.vertices[TriangleVerticies.Two]),
|
|
179
|
+
Vector2Like.Clone(this.vertices[TriangleVerticies.Three]),
|
|
180
|
+
]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export class TriangleScalarVertexData extends TriangleVertexData {
|
|
184
|
+
vertices;
|
|
185
|
+
constructor(vertices = [0, 0, 0]) {
|
|
186
|
+
super(vertices);
|
|
187
|
+
this.vertices = vertices;
|
|
188
|
+
}
|
|
189
|
+
setFromQuadData(vertexData) {
|
|
190
|
+
this.vertices[TriangleVerticies.One] =
|
|
191
|
+
vertexData.vertices[TriangleVerticies.One];
|
|
192
|
+
this.vertices[TriangleVerticies.Two] =
|
|
193
|
+
vertexData.vertices[TriangleVerticies.Two];
|
|
194
|
+
this.vertices[TriangleVerticies.Three] =
|
|
195
|
+
vertexData.vertices[TriangleVerticies.Three];
|
|
196
|
+
}
|
|
197
|
+
subtractFromVertex(vertex, value) {
|
|
198
|
+
this.vertices[vertex] -= value;
|
|
199
|
+
}
|
|
200
|
+
addAll(value) {
|
|
201
|
+
this.vertices[TriangleVerticies.One] += value;
|
|
202
|
+
this.vertices[TriangleVerticies.Two] += value;
|
|
203
|
+
this.vertices[TriangleVerticies.Three] += value;
|
|
204
|
+
}
|
|
205
|
+
add(v1, v2, v3, v4) {
|
|
206
|
+
this.vertices[TriangleVerticies.One] += v1;
|
|
207
|
+
this.vertices[TriangleVerticies.Two] += v2;
|
|
208
|
+
this.vertices[TriangleVerticies.Three] += v3;
|
|
209
|
+
}
|
|
210
|
+
subtractAll(value) {
|
|
211
|
+
this.vertices[TriangleVerticies.One] -= value;
|
|
212
|
+
this.vertices[TriangleVerticies.Two] -= value;
|
|
213
|
+
this.vertices[TriangleVerticies.Three] -= value;
|
|
214
|
+
}
|
|
215
|
+
subtract(v1, v2, v3, v4) {
|
|
216
|
+
this.vertices[TriangleVerticies.One] += v1;
|
|
217
|
+
this.vertices[TriangleVerticies.Two] += v2;
|
|
218
|
+
this.vertices[TriangleVerticies.Three] += v3;
|
|
219
|
+
}
|
|
220
|
+
isGreaterThan(v1, v2, v3, v4) {
|
|
221
|
+
if (this.vertices[TriangleVerticies.One] < v1)
|
|
222
|
+
return false;
|
|
223
|
+
if (this.vertices[TriangleVerticies.Two] < v2)
|
|
224
|
+
return false;
|
|
225
|
+
if (this.vertices[TriangleVerticies.Three] < v3)
|
|
226
|
+
return false;
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
isAllGreaterThan(value) {
|
|
230
|
+
if (this.vertices[TriangleVerticies.One] < value)
|
|
231
|
+
return false;
|
|
232
|
+
if (this.vertices[TriangleVerticies.Two] < value)
|
|
233
|
+
return false;
|
|
234
|
+
if (this.vertices[TriangleVerticies.Three] < value)
|
|
235
|
+
return false;
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
isLessThan(v1, v2, v3, v4) {
|
|
239
|
+
if (this.vertices[TriangleVerticies.One] > v1)
|
|
240
|
+
return false;
|
|
241
|
+
if (this.vertices[TriangleVerticies.Two] > v2)
|
|
242
|
+
return false;
|
|
243
|
+
if (this.vertices[TriangleVerticies.Three] > v3)
|
|
244
|
+
return false;
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
isAllLessThan(value) {
|
|
248
|
+
if (this.vertices[TriangleVerticies.One] > value)
|
|
249
|
+
return false;
|
|
250
|
+
if (this.vertices[TriangleVerticies.Two] > value)
|
|
251
|
+
return false;
|
|
252
|
+
if (this.vertices[TriangleVerticies.Three] > value)
|
|
253
|
+
return false;
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
clone() {
|
|
257
|
+
return new TriangleScalarVertexData([
|
|
258
|
+
this.vertices[TriangleVerticies.One],
|
|
259
|
+
this.vertices[TriangleVerticies.Two],
|
|
260
|
+
this.vertices[TriangleVerticies.Three],
|
|
261
|
+
]);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vec3Array } from "@amodx/math";
|
|
2
|
+
import { Quad } from "../Primitives";
|
|
3
|
+
type BoxPoints = [Vec3Array, Vec3Array];
|
|
4
|
+
type BoxQuads = [
|
|
5
|
+
up: Quad,
|
|
6
|
+
down: Quad,
|
|
7
|
+
north: Quad,
|
|
8
|
+
south: Quad,
|
|
9
|
+
east: Quad,
|
|
10
|
+
west: Quad
|
|
11
|
+
];
|
|
12
|
+
export declare class Box {
|
|
13
|
+
static Create(points?: BoxPoints): Box;
|
|
14
|
+
quads: BoxQuads;
|
|
15
|
+
constructor(data: {
|
|
16
|
+
points?: BoxPoints;
|
|
17
|
+
});
|
|
18
|
+
setPoints(points: BoxPoints): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Quad } from "../Primitives";
|
|
2
|
+
export class Box {
|
|
3
|
+
static Create(points = [
|
|
4
|
+
[0, 0, 0],
|
|
5
|
+
[1, 1, 1],
|
|
6
|
+
]) {
|
|
7
|
+
return new Box({
|
|
8
|
+
points,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
quads = [
|
|
12
|
+
Quad.Create(),
|
|
13
|
+
Quad.Create(),
|
|
14
|
+
Quad.Create(),
|
|
15
|
+
Quad.Create(),
|
|
16
|
+
Quad.Create(),
|
|
17
|
+
Quad.Create(),
|
|
18
|
+
];
|
|
19
|
+
constructor(data) {
|
|
20
|
+
if (data.points)
|
|
21
|
+
this.setPoints(data.points);
|
|
22
|
+
}
|
|
23
|
+
setPoints(points) {
|
|
24
|
+
const [startX, startY, startZ] = points[0];
|
|
25
|
+
const [endX, endY, endZ] = points[1];
|
|
26
|
+
//top
|
|
27
|
+
this.quads[0].setPositions([
|
|
28
|
+
[endX, endY, endZ],
|
|
29
|
+
[startX, endY, endZ],
|
|
30
|
+
[startX, endY, startZ],
|
|
31
|
+
[endX, endY, startZ],
|
|
32
|
+
]);
|
|
33
|
+
//bottom
|
|
34
|
+
this.quads[1].setPositions([
|
|
35
|
+
[startX, startY, endZ],
|
|
36
|
+
[endX, startY, endZ],
|
|
37
|
+
[endX, startY, startZ],
|
|
38
|
+
[startX, startY, startZ],
|
|
39
|
+
]);
|
|
40
|
+
//north
|
|
41
|
+
this.quads[2].setPositions([
|
|
42
|
+
[startX, endY, endZ],
|
|
43
|
+
[endX, endY, endZ],
|
|
44
|
+
[endX, startY, endZ],
|
|
45
|
+
[startX, startY, endZ],
|
|
46
|
+
]);
|
|
47
|
+
//south
|
|
48
|
+
this.quads[3].setPositions([
|
|
49
|
+
[endX, endY, startZ],
|
|
50
|
+
[startX, endY, startZ],
|
|
51
|
+
[startX, startY, startZ],
|
|
52
|
+
[endX, startY, startZ],
|
|
53
|
+
]);
|
|
54
|
+
//east
|
|
55
|
+
this.quads[4].setPositions([
|
|
56
|
+
[endX, endY, endZ],
|
|
57
|
+
[endX, endY, startZ],
|
|
58
|
+
[endX, startY, startZ],
|
|
59
|
+
[endX, startY, endZ],
|
|
60
|
+
]);
|
|
61
|
+
//west
|
|
62
|
+
this.quads[5].setPositions([
|
|
63
|
+
[startX, endY, startZ],
|
|
64
|
+
[startX, endY, endZ],
|
|
65
|
+
[startX, startY, endZ],
|
|
66
|
+
[startX, startY, startZ],
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
}
|