@divinevoxel/vlox 0.0.4 → 0.0.5
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/Cache/Cache.types.d.ts +3 -3
- package/Contexts/Base/Main/DataGenerator.types.d.ts +5 -0
- package/Contexts/Base/Main/{Generator/InitDataGenerator.d.ts → InitDataGenerator.d.ts} +1 -1
- package/Contexts/Base/Main/InitDataGenerator.js +19 -0
- package/Contexts/Base/Remote/DataSync.types.d.ts +18 -0
- package/Contexts/Base/Remote/InitDataSync.js +42 -0
- package/Contexts/Base/Remote/InitWorldDataSync.js +19 -0
- package/Contexts/Base/ThreadManager.d.ts +6 -11
- package/Contexts/Base/ThreadManager.js +31 -30
- package/Contexts/Constructor/DivineVoxelEngineConstructor.d.ts +0 -2
- package/Contexts/Constructor/DivineVoxelEngineConstructor.js +0 -2
- package/Contexts/Nexus/DivineVoxelEngineNexus.d.ts +0 -2
- package/Contexts/Nexus/DivineVoxelEngineNexus.js +0 -6
- package/Contexts/Nexus/NexusTheads.js +1 -4
- package/Contexts/Render/DVERenderThreads.d.ts +0 -3
- package/Contexts/Render/DVERenderThreads.js +1 -7
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +28 -9
- package/Contexts/Render/DivineVoxelEngineRender.js +2 -4
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +28 -10
- package/Contexts/World/DivineVoxelEngineWorld.js +0 -26
- package/Contexts/World/WorldThreads.d.ts +1 -2
- package/Contexts/World/WorldThreads.js +1 -4
- package/Data/Cursor/{Interfaces/DataCursor.interface.d.ts → DataCursor.interface.d.ts} +1 -1
- package/Data/Structs/{Builder/StructBuilder.d.ts → StructBuilder.d.ts} +5 -3
- package/Init/StartConstructor.js +23 -19
- package/Init/StartNexus.js +12 -9
- package/Init/StartRenderer.d.ts +2 -12
- package/Init/StartRenderer.js +22 -45
- package/Init/StartWorld.d.ts +4 -1
- package/Init/StartWorld.js +22 -97
- package/Math/Indexing.d.ts +12 -0
- package/Math/Indexing.js +58 -0
- package/Math/index.d.ts +8 -11
- package/Math/index.js +2 -11
- package/Mesher/Functions/CompactMesh.d.ts +2 -3
- package/Mesher/Functions/CompactMesh.js +36 -31
- package/Mesher/Functions/CompactVoxelMesh.d.ts +1 -1
- package/Mesher/Functions/CompactVoxelMesh.js +82 -107
- package/Mesher/Functions/MeshSection.d.ts +3 -0
- package/Mesher/Functions/MeshSection.js +113 -0
- package/Mesher/Functions/MeshTexture.d.ts +1 -0
- package/Mesher/Functions/MeshTexture.js +275 -0
- package/Mesher/Functions/MeshVoxel.d.ts +3 -0
- package/Mesher/Functions/MeshVoxel.js +43 -0
- package/Mesher/Geomtry/Geometry.types.d.ts +11 -0
- package/Mesher/Geomtry/Geometry.types.js +13 -0
- package/Mesher/Geomtry/GeometryNormals.d.ts +10 -0
- package/Mesher/Geomtry/GeometryNormals.js +52 -0
- package/Mesher/Geomtry/Mesh.d.ts +11 -0
- package/Mesher/Geomtry/Mesh.js +23 -0
- package/Mesher/Geomtry/MeshData.types.d.ts +13 -0
- package/Mesher/Geomtry/MeshData.types.js +6 -0
- package/Mesher/Geomtry/Primitives/Quad.d.ts +38 -0
- package/Mesher/Geomtry/Primitives/Quad.js +224 -0
- package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +66 -0
- package/Mesher/Geomtry/Primitives/QuadVertexData.js +349 -0
- package/Mesher/Geomtry/Primitives/index.d.ts +2 -0
- package/Mesher/Geomtry/Primitives/index.js +2 -0
- package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +7 -0
- package/Mesher/Geomtry/Tools/MesherDataTools.js +12 -0
- package/Mesher/Geomtry/Tools/index.d.ts +1 -0
- package/Mesher/Geomtry/Tools/index.js +1 -0
- package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +6 -0
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +242 -0
- package/Mesher/Geomtry/index.d.ts +2 -0
- package/Mesher/Geomtry/index.js +2 -0
- package/Mesher/InitMesher.d.ts +2 -0
- package/Mesher/InitMesher.js +23 -0
- package/Mesher/InitTask.d.ts +2 -0
- package/Mesher/InitTask.js +44 -0
- package/Mesher/Models/Common/BoxGeometryNode.d.ts +2 -2
- package/Mesher/Models/Common/BoxGeometryNode.js +61 -56
- package/Mesher/Models/Common/Calc/CalcConstants.d.ts +2 -2
- package/Mesher/Models/Common/Calc/CalcConstants.js +8 -7
- package/Mesher/Models/Common/Calc/FaceDataCalc.js +5 -4
- package/Mesher/Models/Common/QuadGeometryNode.d.ts +2 -2
- package/Mesher/Models/Common/QuadGeometryNode.js +1 -1
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +10 -5
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +148 -57
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +1 -1
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +59 -116
- package/Mesher/Models/Nodes/GeometryNode.d.ts +1 -1
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +4 -2
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +9 -8
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.d.ts +4 -2
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +9 -8
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.d.ts +10 -3
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +9 -8
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.d.ts +4 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +9 -8
- package/Mesher/Models/Nodes/VoxelGeometryConstructor.d.ts +2 -2
- package/Mesher/Models/Nodes/VoxelGeometryConstructor.js +1 -1
- package/Mesher/Models/VoxelConstructor.d.ts +3 -3
- package/Mesher/Models/VoxelConstructor.js +1 -1
- package/Mesher/Models/VoxelGeometryLookUp.d.ts +2 -2
- package/Mesher/Models/VoxelGeometryLookUp.js +2 -2
- package/Mesher/Models/VoxelModelConstructorRegister.d.ts +4 -4
- package/Mesher/Models/VoxelModelConstructorRegister.js +1 -1
- package/Mesher/RenderedMaterials.d.ts +6 -0
- package/Mesher/RenderedMaterials.js +12 -0
- package/Mesher/Tools/OutlinedVoxelTool.d.ts +2 -11
- package/Mesher/Tools/OutlinedVoxelTool.js +69 -39
- package/Mesher/Tools/VoxelMeshBVHBuilder.d.ts +1 -1
- package/Mesher/Tools/VoxelMeshBVHBuilder.js +3 -3
- package/Mesher/Tools/VoxelMeshVertexStructCursor.d.ts +1 -1
- package/Mesher/Tools/VoxelMesherDataTool.d.ts +23 -17
- package/Mesher/Tools/VoxelMesherDataTool.js +28 -61
- package/Mesher/Types/Mesher.types.d.ts +8 -12
- package/Models/Defaults/CubeVoxelModels.js +26 -26
- package/Models/Defaults/PanelVoxelModels.js +24 -24
- package/Models/Input/BoxVoxelGometryInputs.d.ts +5 -3
- package/Models/Input/BoxVoxelGometryInputs.js +5 -5
- package/Models/Input/QuadVoxelGometryInputs.d.ts +1 -1
- package/Models/Rules/Classes/OcclusionFace.js +1 -1
- package/Models/Rules/Classes/VoxelRulesGeometry.d.ts +3 -3
- package/Models/Rules/Functions/BuildGeomtryInputs.js +44 -37
- package/Models/Rules/Functions/GetOcclusionFaces.d.ts +2 -2
- package/Models/Rules/Functions/GetOcclusionFaces.js +1 -1
- package/Models/Shared/Transform.d.ts +2 -2
- package/Models/Shared/Transform.js +4 -6
- package/Models/VoxelModel.types.d.ts +1 -1
- package/Renderer/Classes/DVESectionMeshInterface.d.ts +3 -0
- package/Renderer/Classes/DVESectionMeshes.d.ts +6 -0
- package/Renderer/Classes/DVESectionMeshes.js +2 -0
- package/Renderer/Classes/SectionMesh.d.ts +13 -0
- package/Renderer/Classes/SectionMesh.js +26 -0
- package/Renderer/Classes/SectorMesh.d.ts +11 -0
- package/Renderer/Classes/SectorMesh.js +33 -0
- package/Renderer/DVERenderNode.types.d.ts +1 -1
- package/Renderer/DVERenderer.d.ts +2 -2
- package/Renderer/InitTasks.d.ts +2 -0
- package/Renderer/InitTasks.js +19 -0
- package/Renderer/MeshManager.d.ts +5 -7
- package/Renderer/MeshManager.js +27 -52
- package/Renderer/MeshRegister.d.ts +14 -27
- package/Renderer/MeshRegister.js +38 -164
- package/Renderer/Renderer.types.d.ts +21 -0
- package/Renderer/index.d.ts +4 -0
- package/Renderer/index.js +4 -0
- package/Settings/EngineSettings.d.ts +19 -21
- package/Settings/EngineSettings.js +15 -43
- package/Settings/EngineSettings.types.d.ts +8 -35
- package/Settings/EngineSettings.types.js +8 -35
- package/Tasks/IWG/IWG.d.ts +25 -0
- package/Tasks/IWG/IWG.js +89 -0
- package/Tasks/IWG/Internal/Classes/DimensionSegment.d.ts +37 -0
- package/Tasks/IWG/Internal/Classes/DimensionSegment.js +67 -0
- package/Tasks/IWG/Internal/Classes/Generator.d.ts +27 -0
- package/Tasks/IWG/Internal/Classes/Generator.js +41 -0
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +15 -0
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.js +62 -0
- package/Tasks/IWG/Internal/Classes/SectorState.d.ts +11 -0
- package/Tasks/IWG/Internal/Classes/SectorState.js +20 -0
- package/Tasks/IWG/Internal/Classes/SectorVisistedMap.d.ts +9 -0
- package/Tasks/IWG/Internal/Classes/SectorVisistedMap.js +24 -0
- package/Tasks/IWG/Internal/Functions/cullSectors.d.ts +2 -0
- package/Tasks/IWG/Internal/Functions/cullSectors.js +112 -0
- package/Tasks/IWG/Internal/Functions/getSectorState.d.ts +4 -0
- package/Tasks/IWG/Internal/Functions/getSectorState.js +42 -0
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +2 -0
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.js +52 -0
- package/Tasks/IWG/Internal/Functions/runWorldUpdate.d.ts +2 -0
- package/Tasks/IWG/Internal/Functions/runWorldUpdate.js +71 -0
- package/Tasks/IWG/Internal/IWGDimensions.d.ts +6 -0
- package/Tasks/IWG/Internal/IWGDimensions.js +17 -0
- package/Tasks/IWG/Internal/IWGTasks.d.ts +34 -0
- package/Tasks/IWG/Internal/IWGTasks.js +154 -0
- package/Tasks/IWG/Internal/IWGTools.d.ts +8 -0
- package/Tasks/IWG/Internal/IWGTools.js +5 -0
- package/Tasks/IWG/Internal/TaskRegister.d.ts +7 -0
- package/Tasks/IWG/Internal/TaskRegister.js +14 -0
- package/Tasks/IWG/Procedures/InitalLoad.d.ts +10 -0
- package/Tasks/IWG/Procedures/InitalLoad.js +53 -0
- package/Tasks/IWG/Procedures/SaveAllSectors.d.ts +5 -0
- package/Tasks/IWG/Procedures/SaveAllSectors.js +20 -0
- package/Tasks/IWG/index.d.ts +2 -1
- package/Tasks/IWG/index.js +2 -1
- package/Tasks/Propagation/Explosion/ExplosionManager.js +26 -26
- package/Tasks/Propagation/Flow/FlowManager.d.ts +9 -51
- package/Tasks/Propagation/Flow/FlowManager.js +96 -108
- package/Tasks/Propagation/Flow/{Functions/FlowRemove.d.ts → FlowRemove.d.ts} +1 -1
- package/Tasks/Propagation/Flow/FlowRemove.js +157 -0
- package/Tasks/Propagation/Flow/{Functions/FlowUpdate.d.ts → FlowUpdate.d.ts} +1 -1
- package/Tasks/Propagation/Flow/FlowUpdate.js +98 -0
- package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -0
- package/Tasks/Propagation/Flow/WorldFlow.js +153 -0
- package/Tasks/Propagation/Illumanation/CommonFunctions.d.ts +104 -0
- package/Tasks/Propagation/Illumanation/CommonFunctions.js +280 -0
- package/Tasks/Propagation/Illumanation/{Functions/RGBUpdate.d.ts → RGBUpdate.d.ts} +1 -1
- package/Tasks/Propagation/Illumanation/{Functions/RGBUpdate.js → RGBUpdate.js} +8 -8
- package/Tasks/Propagation/Illumanation/{Functions/SunUpdate.d.ts → SunUpdate.d.ts} +1 -1
- package/Tasks/Propagation/Illumanation/{Functions/SunUpdate.js → SunUpdate.js} +11 -11
- package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -0
- package/Tasks/Propagation/Illumanation/WorldRGB.js +44 -0
- package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -0
- package/Tasks/Propagation/Illumanation/WorldSun.js +119 -0
- package/Tasks/Propagation/InitTasks.js +32 -16
- package/Tasks/Propagation/index.d.ts +2 -1
- package/Tasks/Propagation/index.js +2 -1
- package/Tasks/Tasks.types.d.ts +6 -77
- package/Tasks/TasksIds.d.ts +3 -3
- package/Tasks/TasksIds.js +3 -3
- package/Tasks/Update/InitTasks.js +9 -24
- package/Tasks/Update/UpdateTask.d.ts +2 -2
- package/Tasks/Update/UpdateTask.js +18 -17
- package/Tasks/Update/VoxelUpdate.d.ts +3 -2
- package/Tasks/Update/VoxelUpdate.js +23 -19
- package/Tasks/WorldGeneration/InitTasks.js +2 -10
- package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
- package/Tasks/WorldGeneration/WorldGenBrush.js +20 -27
- package/Tasks/WorldGeneration/WorldGenRegister.d.ts +2 -2
- package/Tasks/WorldGeneration/WorldGenRegister.js +30 -40
- package/Tasks/WorldGeneration/WorldGeneration.d.ts +1 -1
- package/Tasks/WorldGeneration/WorldGeneration.js +15 -11
- package/{Data/Cursor/Template → Templates/Cursor}/TemplateCursor.d.ts +1 -1
- package/{Data/Cursor/Template → Templates/Cursor}/TemplateCursor.js +1 -1
- package/{Data/Cursor/Template → Templates/Cursor}/TemplateVoxelCursor.d.ts +2 -1
- package/{Data/Cursor/Template → Templates/Cursor}/TemplateVoxelCursor.js +4 -1
- package/Templates/FullVoxelTemplate.d.ts +1 -0
- package/Templates/FullVoxelTemplate.js +14 -7
- package/Templates/Functions/CreateTemplate.js +58 -37
- package/Templates/Functions/FlipTemplate.js +4 -0
- package/Templates/Functions/RotateTemplate.js +4 -0
- package/Templates/VoxelTemplate.d.ts +5 -2
- package/Templates/VoxelTemplate.js +33 -18
- package/Templates/VoxelTemplates.types.d.ts +5 -7
- package/Textures/Texture.types.d.ts +1 -0
- package/Textures/TextureManager.d.ts +4 -5
- package/Textures/TextureManager.js +3 -1
- package/Textures/TextureRegister.d.ts +9 -10
- package/Textures/TextureRegister.js +12 -12
- package/Textures/index.d.ts +1 -0
- package/Textures/index.js +1 -0
- package/Tools/Brush/AdvancedBrushTool.d.ts +2 -1
- package/Tools/Brush/AdvancedBrushTool.js +12 -15
- package/Tools/Brush/Brush.d.ts +4 -4
- package/Tools/Brush/Brush.js +22 -22
- package/Tools/Data/SubstanceDataTool.d.ts +2 -1
- package/Tools/Data/SubstanceDataTool.js +6 -5
- package/Tools/Tasks/TasksTool.d.ts +43 -88
- package/Tools/Tasks/TasksTool.js +97 -212
- package/Util/BinaryObject.d.ts +2 -0
- package/Util/BinaryObject.js +14 -0
- package/Util/Environment.d.ts +4 -0
- package/Util/Environment.js +10 -0
- package/Util/TypedEventTarget.d.ts +5 -0
- package/Util/TypedEventTarget.js +12 -0
- package/Util/Util.types.d.ts +0 -2
- package/{Data → Voxels}/Cursor/VoxelCursor.d.ts +3 -3
- package/{Data/Cursor/Interfaces → Voxels/Cursor}/VoxelCursor.interface.d.ts +14 -7
- package/{Data/Cursor/Interfaces → Voxels/Cursor}/VoxelCursor.interface.js +57 -44
- package/{Data → Voxels}/Cursor/VoxelCursor.js +7 -8
- package/Voxels/Cursor/VoxelLightData.d.ts +45 -0
- package/Voxels/Cursor/VoxelLightData.js +146 -0
- package/Voxels/Effects/VoxelEffect.d.ts +4 -4
- package/Voxels/Functions/BuildStateData.js +1 -1
- package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
- package/Voxels/Indexes/VoxelIndex.js +6 -6
- package/Voxels/InitVoxelData.d.ts +7 -3
- package/Voxels/InitVoxelData.js +182 -29
- package/Voxels/Segments/MaterialDataGenerator.d.ts +6 -0
- package/{Contexts/Base/Main/Generator → Voxels}/Segments/MaterialDataGenerator.js +2 -2
- package/Voxels/Segments/SubstanceDataGenerator.d.ts +6 -0
- package/{Contexts/Base/Main/Generator → Voxels}/Segments/SubstanceDataGenerator.js +4 -4
- package/{Contexts/Base/Main/Generator → Voxels}/Segments/VoxelDataGenerator.d.ts +2 -2
- package/{Contexts/Base/Main/Generator → Voxels}/Segments/VoxelDataGenerator.js +4 -5
- package/Voxels/State/LogicStatementReader.js +1 -1
- package/Voxels/State/Schema/BinarySchema.d.ts +4 -0
- package/Voxels/State/Schema/BinarySchema.js +32 -1
- package/Voxels/State/Schema/StateSchema.d.ts +2 -2
- package/Voxels/State/Schema/VoxelSchema.d.ts +4 -4
- package/Voxels/State/Schema/VoxelSchema.js +6 -6
- package/Voxels/State/SchemaRegister.d.ts +4 -3
- package/Voxels/State/SchemaRegister.js +5 -2
- package/Voxels/State/VoxelTagStates.js +1 -1
- package/Voxels/Structs/Builder/SubstanceStructBuilder.d.ts +2 -0
- package/{Data → Voxels}/Structs/Builder/SubstanceStructBuilder.js +2 -2
- package/Voxels/Structs/Builder/VoxelStructBuilder.d.ts +2 -0
- package/{Data → Voxels}/Structs/Builder/VoxelStructBuilder.js +2 -7
- package/{Data → Voxels}/Structs/SubstanceStruct.d.ts +2 -1
- package/{Data → Voxels}/Structs/SubstanceStruct.js +2 -4
- package/{Data → Voxels}/Structs/VoxelStruct.d.ts +2 -2
- package/{Data → Voxels}/Structs/VoxelStruct.js +1 -1
- package/Voxels/{Voxel.types.d.ts → Types/Voxel.types.d.ts} +18 -7
- package/Voxels/{Voxel.types.js → Types/Voxel.types.js} +19 -1
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +93 -0
- package/Voxels/index.d.ts +3 -3
- package/Voxels/index.js +3 -3
- package/World/Archive/Archive.types.d.ts +159 -0
- package/World/Archive/Functions/ArchiveArea.d.ts +10 -0
- package/World/Archive/Functions/ArchiveArea.js +350 -0
- package/World/Archive/Functions/ArchiveSector.d.ts +7 -0
- package/World/Archive/Functions/ArchiveSector.js +355 -0
- package/World/Archive/Functions/ImportSector.d.ts +9 -0
- package/World/Archive/Functions/ImportSector.js +234 -0
- package/World/Archive/Functions/index.d.ts +3 -0
- package/World/Archive/Functions/index.js +3 -0
- package/World/Archive/InitTasks.d.ts +4 -0
- package/World/Archive/InitTasks.js +71 -0
- package/World/Cursor/SectionCursor.d.ts +16 -0
- package/World/Cursor/SectionCursor.js +58 -0
- package/{Data/Cursor/World/ColumnCursor.d.ts → World/Cursor/SectorCursor.d.ts} +8 -7
- package/World/Cursor/SectorCursor.js +58 -0
- package/{Data/Cursor/World → World/Cursor}/WorldCursor.d.ts +4 -4
- package/World/Cursor/WorldCursor.js +52 -0
- package/{Data/Cursor/World → World/Cursor}/WorldSectionCursor.interface.d.ts +2 -2
- package/{Data/Cursor/World → World/Cursor}/WorldVoxelCursor.d.ts +3 -2
- package/World/Cursor/WorldVoxelCursor.js +58 -0
- package/{Data/World/Classes → World/Dimension}/Dimension.d.ts +5 -5
- package/World/Dimension/Dimension.js +20 -0
- package/World/InitTasks.d.ts +6 -0
- package/World/InitTasks.js +97 -0
- package/World/Lock/WorldLock.d.ts +11 -0
- package/{Contexts/World → World}/Lock/WorldLock.js +34 -37
- package/World/Section/Section.d.ts +34 -0
- package/World/Section/Section.js +89 -0
- package/World/Section/SectionHeightMap.d.ts +10 -0
- package/World/Section/SectionHeightMap.js +39 -0
- package/World/Section/SectionStruct.d.ts +8 -0
- package/World/Section/SectionStruct.js +29 -0
- package/{Data/Structs/Constants/ChunkStructProperties.d.ts → World/Section/SectionStructProperties.d.ts} +1 -1
- package/World/Section/SectionStructProperties.js +11 -0
- package/World/Section/index.d.ts +1 -0
- package/World/Section/index.js +1 -0
- package/World/Sector/Sector.d.ts +23 -0
- package/World/Sector/Sector.js +60 -0
- package/World/Sector/SectorHeightMap.d.ts +5 -0
- package/World/Sector/SectorHeightMap.js +49 -0
- package/World/Sector/SectorStruct.d.ts +1 -0
- package/World/Sector/SectorStruct.js +46 -0
- package/World/Sector/SectorStructIds.d.ts +13 -0
- package/World/Sector/SectorStructIds.js +14 -0
- package/World/Sector/index.d.ts +1 -0
- package/World/Sector/index.js +1 -0
- package/World/Storage/WorldStorage.interface.d.ts +6 -0
- package/{Data/Types/RichWorldData.types.d.ts → World/Types/WorldData.types.d.ts} +11 -2
- package/World/Types/WorldDataSyncIds.d.ts +6 -0
- package/World/Types/WorldDataSyncIds.js +7 -0
- package/{Data/World → World}/WorldBounds.js +4 -0
- package/World/WorldRegister.d.ts +35 -0
- package/World/WorldRegister.js +91 -0
- package/World/WorldSpaces.d.ts +34 -0
- package/World/WorldSpaces.js +96 -0
- package/World/index.d.ts +4 -0
- package/World/index.js +4 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +2 -7
- package/Archive/Archive.types.d.ts +0 -176
- package/Archive/Functions/ArchiveArea.d.ts +0 -10
- package/Archive/Functions/ArchiveArea.js +0 -315
- package/Archive/Functions/ArchiveColumn.d.ts +0 -8
- package/Archive/Functions/ArchiveColumn.js +0 -293
- package/Archive/Functions/ImportColumn.d.ts +0 -9
- package/Archive/Functions/ImportColumn.js +0 -213
- package/Archive/Functions/index.d.ts +0 -3
- package/Archive/Functions/index.js +0 -3
- package/Contexts/Base/DataHooks.d.ts +0 -51
- package/Contexts/Base/DataHooks.js +0 -29
- package/Contexts/Base/Main/Generator/DataGenerator.types.d.ts +0 -12
- package/Contexts/Base/Main/Generator/InitDataGenerator.js +0 -201
- package/Contexts/Base/Main/Generator/Segments/MaterialDataGenerator.d.ts +0 -6
- package/Contexts/Base/Main/Generator/Segments/SubstanceDataGenerator.d.ts +0 -6
- package/Contexts/Base/Remote/Sync/DataSync.types.d.ts +0 -34
- package/Contexts/Base/Remote/Sync/InitDataSync.js +0 -43
- package/Contexts/Base/Remote/Sync/InitWorldDataSync.js +0 -37
- package/Contexts/Constructor/Tasks/ConstructorRemoteThreadTasks.d.ts +0 -7
- package/Contexts/Constructor/Tasks/ConstructorRemoteThreadTasks.js +0 -8
- package/Contexts/Constructor/Tasks/DVEConstructorTasksQueues.d.ts +0 -27
- package/Contexts/Constructor/Tasks/DVEConstructorTasksQueues.js +0 -72
- package/Contexts/Render/Scene/MeshRegister.d.ts +0 -39
- package/Contexts/Render/Scene/MeshRegister.js +0 -218
- package/Contexts/Render/Tasks/RenderTasks.d.ts +0 -7
- package/Contexts/Render/Tasks/RenderTasks.js +0 -20
- package/Contexts/Render/Tasks/RenderTasks.types.d.ts +0 -21
- package/Contexts/World/Data/DataSync.d.ts +0 -29
- package/Contexts/World/Data/DataSync.js +0 -110
- package/Contexts/World/Data/DataSyncNode.d.ts +0 -28
- package/Contexts/World/Data/DataSyncNode.js +0 -54
- package/Contexts/World/Lock/WorldLock.d.ts +0 -12
- package/Contexts/World/Tasks/WorldTasks.d.ts +0 -11
- package/Contexts/World/Tasks/WorldTasks.js +0 -104
- package/Data/Constants/DVEFDataSyncIds.d.ts +0 -12
- package/Data/Constants/DVEFDataSyncIds.js +0 -13
- package/Data/Constants/DataHeaders.d.ts +0 -6
- package/Data/Constants/DataHeaders.js +0 -6
- package/Data/Cursor/World/ChunkCursor.d.ts +0 -16
- package/Data/Cursor/World/ChunkCursor.js +0 -59
- package/Data/Cursor/World/ColumnCursor.js +0 -57
- package/Data/Cursor/World/WorldCursor.js +0 -50
- package/Data/Cursor/World/WorldVoxelCursor.js +0 -55
- package/Data/Structs/Builder/SubstanceStructBuilder.d.ts +0 -2
- package/Data/Structs/Builder/VoxelStructBuilder.d.ts +0 -2
- package/Data/Structs/ChunkStruct.d.ts +0 -1
- package/Data/Structs/ChunkStruct.js +0 -29
- package/Data/Structs/ColumnStruct.d.ts +0 -1
- package/Data/Structs/ColumnStruct.js +0 -45
- package/Data/Structs/Constants/ChunkStructProperties.js +0 -11
- package/Data/Structs/Constants/SubstanceStructIds.d.ts +0 -0
- package/Data/Structs/Constants/SubstanceStructIds.js +0 -1
- package/Data/Structs/RegionStruct.d.ts +0 -3
- package/Data/Structs/RegionStruct.js +0 -50
- package/Data/Types/DimensionData.types.d.ts +0 -9
- package/Data/Types/WorldData.types.d.ts +0 -10
- package/Data/Types/WorldData.types.js +0 -19
- package/Data/World/Classes/Chunk.d.ts +0 -26
- package/Data/World/Classes/Chunk.js +0 -75
- package/Data/World/Classes/Column.d.ts +0 -19
- package/Data/World/Classes/Column.js +0 -35
- package/Data/World/Classes/Dimension.js +0 -20
- package/Data/World/Classes/Region.d.ts +0 -23
- package/Data/World/Classes/Region.js +0 -67
- package/Data/World/Classes/index.d.ts +0 -4
- package/Data/World/Classes/index.js +0 -4
- package/Data/World/DimensionsRegister.d.ts +0 -14
- package/Data/World/DimensionsRegister.js +0 -53
- package/Data/World/RegionHeaderRegister.d.ts +0 -29
- package/Data/World/RegionHeaderRegister.js +0 -56
- package/Data/World/WorldPainter.d.ts +0 -12
- package/Data/World/WorldPainter.js +0 -56
- package/Data/World/WorldRegister.d.ts +0 -51
- package/Data/World/WorldRegister.js +0 -228
- package/Data/World/WorldRegisterCache.d.ts +0 -23
- package/Data/World/WorldRegisterCache.js +0 -68
- package/Data/World/WorldSpaces.d.ts +0 -4
- package/Data/World/WorldSpaces.js +0 -23
- package/Math/Classes/BoundingBox.d.ts +0 -27
- package/Math/Classes/BoundingBox.js +0 -44
- package/Math/Classes/MatrixArray.d.ts +0 -66
- package/Math/Classes/MatrixArray.js +0 -243
- package/Math/Classes/Plane.d.ts +0 -22
- package/Math/Classes/Plane.js +0 -53
- package/Math/Classes/Scalar.d.ts +0 -5
- package/Math/Classes/Scalar.js +0 -9
- package/Math/Classes/SimpleBoundingBox.d.ts +0 -40
- package/Math/Classes/SimpleBoundingBox.js +0 -157
- package/Math/Classes/Vector3.d.ts +0 -54
- package/Math/Classes/Vector3.js +0 -236
- package/Math/Constants/ConstantMartrix.d.ts +0 -3
- package/Math/Constants/ConstantMartrix.js +0 -8
- package/Math/Constants/Faces.d.ts +0 -5
- package/Math/Constants/Faces.js +0 -28
- package/Math/Math.types.d.ts +0 -25
- package/Math/Objects/CompassDirection.d.ts +0 -9
- package/Math/Objects/CompassDirection.js +0 -19
- package/Math/Spaces/VoxelSpace.d.ts +0 -32
- package/Math/Spaces/VoxelSpace.js +0 -99
- package/Math/Spaces/VoxelSpaces.d.ts +0 -50
- package/Math/Spaces/VoxelSpaces.js +0 -117
- package/Math/Spaces/VoxelSpaces.types.d.ts +0 -6
- package/Math/VoxelMath.d.ts +0 -21
- package/Math/VoxelMath.js +0 -47
- package/Mesher/Geometry/VoxelGeometry.d.ts +0 -7
- package/Mesher/Geometry/VoxelGeometry.js +0 -115
- package/Mesher/Mesher.d.ts +0 -16
- package/Mesher/Mesher.js +0 -44
- package/Mesher/Meshers/MesherInterface.d.ts +0 -5
- package/Mesher/Meshers/MesherManager.d.ts +0 -7
- package/Mesher/Meshers/MesherManager.js +0 -16
- package/Mesher/Meshers/TextureMesher.d.ts +0 -15
- package/Mesher/Meshers/TextureMesher.js +0 -191
- package/Mesher/Meshers/VoxelMesher.d.ts +0 -15
- package/Mesher/Meshers/VoxelMesher.js +0 -47
- package/Mesher/Processors/ChunkProcessor.d.ts +0 -13
- package/Mesher/Processors/ChunkProcessor.js +0 -117
- package/Mesher/Substances/RenderedSubstances.d.ts +0 -5
- package/Mesher/Substances/RenderedSubstances.js +0 -7
- package/Mesher/Tasks/BuidlerTasks.types.d.ts +0 -7
- package/Mesher/Tools/VoxelTemplateDataTool.d.ts +0 -15
- package/Mesher/Tools/VoxelTemplateDataTool.js +0 -112
- package/Renderer/Classes/ChunkMesh.d.ts +0 -10
- package/Renderer/Classes/ChunkMesh.js +0 -13
- package/Renderer/Classes/MeshRegisterColumn.d.ts +0 -7
- package/Renderer/Classes/MeshRegisterColumn.js +0 -7
- package/Renderer/Classes/MushRegisterRegion.d.ts +0 -4
- package/Renderer/Classes/MushRegisterRegion.js +0 -3
- package/Renderer/DVEChunkMeshInterface.d.ts +0 -3
- package/Renderer/DVEChunkMeshInterface.js +0 -1
- package/Renderer/DVEChunkMeshes.d.ts +0 -6
- package/Renderer/DVEChunkMeshes.js +0 -2
- package/Tasks/Analyzer/Analyzer.d.ts +0 -19
- package/Tasks/Analyzer/Analyzer.js +0 -156
- package/Tasks/Analyzer/AnalyzerUpdater.d.ts +0 -10
- package/Tasks/Analyzer/AnalyzerUpdater.js +0 -13
- package/Tasks/Analyzer/InitTasks.d.ts +0 -1
- package/Tasks/Analyzer/InitTasks.js +0 -16
- package/Tasks/DataLoader/Broswer/DataHandler.d.ts +0 -20
- package/Tasks/DataLoader/Broswer/DataHandler.js +0 -54
- package/Tasks/DataLoader/Broswer/WorldDataBase.d.ts +0 -26
- package/Tasks/DataLoader/Broswer/WorldDataBase.js +0 -81
- package/Tasks/DataLoader/Broswer/WorldDataBaseManager.d.ts +0 -6
- package/Tasks/DataLoader/Broswer/WorldDataBaseManager.js +0 -30
- package/Tasks/DataLoader/Broswer/WorldDataTool.d.ts +0 -16
- package/Tasks/DataLoader/Broswer/WorldDataTool.js +0 -64
- package/Tasks/DataLoader/Broswer/index.d.ts +0 -1
- package/Tasks/DataLoader/Broswer/index.js +0 -1
- package/Tasks/DataLoader/Constructor/DataLoaderTasks.d.ts +0 -2
- package/Tasks/DataLoader/Constructor/DataLoaderTasks.js +0 -14
- package/Tasks/DataLoader/Constructor/DivineVoxelEngineDataLoaderConstructor.d.ts +0 -9
- package/Tasks/DataLoader/Constructor/DivineVoxelEngineDataLoaderConstructor.js +0 -17
- package/Tasks/DataLoader/Constructor/WorldDataSerializer.d.ts +0 -15
- package/Tasks/DataLoader/Constructor/WorldDataSerializer.js +0 -54
- package/Tasks/DataLoader/Constructor/index.d.ts +0 -1
- package/Tasks/DataLoader/Constructor/index.js +0 -1
- package/Tasks/DataLoader/Node/DivineVoxelEngineData.d.ts +0 -48
- package/Tasks/DataLoader/Node/DivineVoxelEngineData.js +0 -47
- package/Tasks/DataLoader/Node/System/RegionSystem.d.ts +0 -28
- package/Tasks/DataLoader/Node/System/RegionSystem.js +0 -147
- package/Tasks/DataLoader/Node/System/System.d.ts +0 -13
- package/Tasks/DataLoader/Node/System/System.js +0 -168
- package/Tasks/DataLoader/Node/System/SystemPath.d.ts +0 -12
- package/Tasks/DataLoader/Node/System/SystemPath.js +0 -29
- package/Tasks/DataLoader/Node/Tools/NodeRegionTool.d.ts +0 -28
- package/Tasks/DataLoader/Node/Tools/NodeRegionTool.js +0 -134
- package/Tasks/DataLoader/Node/Util/DVED.util.d.ts +0 -17
- package/Tasks/DataLoader/Node/Util/DVED.util.js +0 -25
- package/Tasks/DataLoader/Node/index.d.ts +0 -3
- package/Tasks/DataLoader/Node/index.js +0 -3
- package/Tasks/DataLoader/Types/DVED.types.d.ts +0 -13
- package/Tasks/DataLoader/Types/DVED.types.js +0 -1
- package/Tasks/DataLoader/Types/DVEDataHandler.d.ts +0 -17
- package/Tasks/DataLoader/Types/DVEDataHandler.js +0 -14
- package/Tasks/DataLoader/World/DataHandlerWrapper.d.ts +0 -21
- package/Tasks/DataLoader/World/DataHandlerWrapper.js +0 -152
- package/Tasks/DataLoader/World/DataLoaderTasks.d.ts +0 -2
- package/Tasks/DataLoader/World/DataLoaderTasks.js +0 -70
- package/Tasks/DataLoader/World/DivineVoxelEngineDataLoaderWorld.d.ts +0 -12
- package/Tasks/DataLoader/World/DivineVoxelEngineDataLoaderWorld.js +0 -17
- package/Tasks/DataLoader/World/Tools/DataLoaderTool.d.ts +0 -24
- package/Tasks/DataLoader/World/Tools/DataLoaderTool.js +0 -113
- package/Tasks/DataLoader/World/Tools/DataSerializerTool.d.ts +0 -8
- package/Tasks/DataLoader/World/Tools/DataSerializerTool.js +0 -27
- package/Tasks/DataLoader/World/Tools/LoaderRegister.d.ts +0 -9
- package/Tasks/DataLoader/World/Tools/LoaderRegister.js +0 -29
- package/Tasks/IWG/Constants/ColumnState.d.ts +0 -6
- package/Tasks/IWG/Constants/ColumnState.js +0 -7
- package/Tasks/IWG/World/Classes/DebouncedTasks.d.ts +0 -16
- package/Tasks/IWG/World/Classes/DebouncedTasks.js +0 -34
- package/Tasks/IWG/World/Classes/Generator.d.ts +0 -50
- package/Tasks/IWG/World/Classes/Generator.js +0 -482
- package/Tasks/IWG/World/Classes/Tasks/IWGBatchTask.d.ts +0 -7
- package/Tasks/IWG/World/Classes/Tasks/IWGBatchTask.js +0 -35
- package/Tasks/IWG/World/Classes/Tasks/IWGSingleTask.d.ts +0 -6
- package/Tasks/IWG/World/Classes/Tasks/IWGSingleTask.js +0 -29
- package/Tasks/IWG/World/Classes/Tasks/IWGTaskBase.d.ts +0 -27
- package/Tasks/IWG/World/Classes/Tasks/IWGTaskBase.js +0 -34
- package/Tasks/IWG/World/Classes/Tasks/IWGTaskRegister.d.ts +0 -6
- package/Tasks/IWG/World/Classes/Tasks/IWGTaskRegister.js +0 -14
- package/Tasks/IWG/World/IWG.d.ts +0 -22
- package/Tasks/IWG/World/IWG.js +0 -83
- package/Tasks/IWG/World/Load/InitLoad.d.ts +0 -5
- package/Tasks/IWG/World/Load/InitLoad.js +0 -17
- package/Tasks/IWG/World/Load/LoaderBase.d.ts +0 -16
- package/Tasks/IWG/World/Load/LoaderBase.js +0 -57
- package/Tasks/IWG/World/Load/SafeExit.d.ts +0 -5
- package/Tasks/IWG/World/Load/SafeExit.js +0 -15
- package/Tasks/IWG/World/Load/Teleport.d.ts +0 -9
- package/Tasks/IWG/World/Load/Teleport.js +0 -26
- package/Tasks/IWG/World/Tasks/RegisterDefaultTasks.d.ts +0 -1
- package/Tasks/IWG/World/Tasks/RegisterDefaultTasks.js +0 -12
- package/Tasks/IWG/World/Tasks/Rendering/IWGBuildTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/Rendering/IWGBuildTasks.js +0 -26
- package/Tasks/IWG/World/Tasks/Saving/IWGSaveAndUnloadTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/Saving/IWGSaveAndUnloadTasks.js +0 -22
- package/Tasks/IWG/World/Tasks/Saving/IWGSaveTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/Saving/IWGSaveTasks.js +0 -22
- package/Tasks/IWG/World/Tasks/WorldGen/IWGDecorateTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/WorldGen/IWGDecorateTasks.js +0 -29
- package/Tasks/IWG/World/Tasks/WorldGen/IWGGenerateTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/WorldGen/IWGGenerateTasks.js +0 -29
- package/Tasks/IWG/World/Tasks/WorldGen/IWGLoadTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/WorldGen/IWGLoadTasks.js +0 -58
- package/Tasks/IWG/World/Tasks/WorldGen/IWGPropagationTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/WorldGen/IWGPropagationTasks.js +0 -27
- package/Tasks/IWG/World/Tasks/WorldGen/IWGWorldSunTasks.d.ts +0 -8
- package/Tasks/IWG/World/Tasks/WorldGen/IWGWorldSunTasks.js +0 -27
- package/Tasks/IWG/World/Types/IWG.types.d.ts +0 -20
- package/Tasks/IWG/World/Types/IWG.types.js +0 -7
- package/Tasks/IWG/World/index.d.ts +0 -2
- package/Tasks/IWG/World/index.js +0 -2
- package/Tasks/Mesher/InitTasks.d.ts +0 -2
- package/Tasks/Mesher/InitTasks.js +0 -46
- package/Tasks/Propagation/Flow/Functions/FlowRemove.js +0 -162
- package/Tasks/Propagation/Flow/Functions/FlowUpdate.js +0 -96
- package/Tasks/Propagation/Illumanation/Functions/WorldSun.d.ts +0 -2
- package/Tasks/Propagation/Illumanation/Functions/WorldSun.js +0 -115
- package/Tasks/Propagation/Illumanation/IlluminationManager.d.ts +0 -48
- package/Tasks/Propagation/Illumanation/IlluminationManager.js +0 -13
- package/Tasks/Propagation/Propagation.d.ts +0 -13
- package/Tasks/Propagation/Propagation.js +0 -38
- package/Textures/Constructor.types.d.ts +0 -5
- package/Textures/Constructor.types.js +0 -1
- package/Tools/Anaylzer/AnaylzerTool.d.ts +0 -6
- package/Tools/Anaylzer/AnaylzerTool.js +0 -31
- package/Tools/Classes/DataToolBase.d.ts +0 -43
- package/Tools/Classes/DataToolBase.js +0 -85
- package/Tools/Classes/LocationBoundTool.d.ts +0 -20
- package/Tools/Classes/LocationBoundTool.js +0 -45
- package/Tools/Classes/LocationBoundToolBase.d.ts +0 -24
- package/Tools/Classes/LocationBoundToolBase.js +0 -61
- package/Tools/Classes/RichDataToolBase.d.ts +0 -10
- package/Tools/Classes/RichDataToolBase.js +0 -26
- package/Tools/Data/DataTool.d.ts +0 -102
- package/Tools/Data/DataTool.js +0 -430
- package/Tools/Data/WorldData/ChunkDataTool.d.ts +0 -11
- package/Tools/Data/WorldData/ChunkDataTool.js +0 -38
- package/Tools/Data/WorldData/ColumnDataTool.d.ts +0 -26
- package/Tools/Data/WorldData/ColumnDataTool.js +0 -81
- package/Tools/Data/WorldData/HeightMapTool.d.ts +0 -24
- package/Tools/Data/WorldData/HeightMapTool.js +0 -117
- package/Tools/Data/WorldData/RegionDataTool.d.ts +0 -13
- package/Tools/Data/WorldData/RegionDataTool.js +0 -39
- package/Tools/Mesher/MesherTool.d.ts +0 -19
- package/Tools/Mesher/MesherTool.js +0 -52
- package/Util/VoxelIDMatrix.d.ts +0 -15
- package/Util/VoxelIDMatrix.js +0 -55
- package/Voxels/LightData.d.ts +0 -150
- package/Voxels/LightData.js +0 -402
- package/Voxels/VoxelSyncData.d.ts +0 -71
- package/Voxels/VoxelSyncData.js +0 -1
- /package/Contexts/Base/Main/{Generator/DataGenerator.types.js → DataGenerator.types.js} +0 -0
- /package/Contexts/Base/Remote/{Sync/DataSync.types.js → DataSync.types.js} +0 -0
- /package/Contexts/Base/Remote/{Sync/DataSyncIds.d.ts → DataSyncIds.d.ts} +0 -0
- /package/Contexts/Base/Remote/{Sync/DataSyncIds.js → DataSyncIds.js} +0 -0
- /package/Contexts/Base/Remote/{Sync/InitDataSync.d.ts → InitDataSync.d.ts} +0 -0
- /package/Contexts/Base/Remote/{Sync/InitWorldDataSync.d.ts → InitWorldDataSync.d.ts} +0 -0
- /package/Data/Cursor/{Interfaces/DataCursor.interface.js → DataCursor.interface.js} +0 -0
- /package/{Archive → Data}/Functions/Palettes.d.ts +0 -0
- /package/{Archive → Data}/Functions/Palettes.js +0 -0
- /package/Data/Structs/{Builder/StructBuilder.js → StructBuilder.js} +0 -0
- /package/Data/{Types → Structs}/StructBuilder.types.d.ts +0 -0
- /package/Data/{Types → Structs}/StructBuilder.types.js +0 -0
- /package/Math/{Constants/CardinalNeighbors.d.ts → CardinalNeighbors.d.ts} +0 -0
- /package/Math/{Constants/CardinalNeighbors.js → CardinalNeighbors.js} +0 -0
- /package/Math/{Constants/VoxelFaces.d.ts → VoxelFaces.d.ts} +0 -0
- /package/Math/{Constants/VoxelFaces.js → VoxelFaces.js} +0 -0
- /package/{Voxels → Mesher}/VoxelShaderData.d.ts +0 -0
- /package/{Voxels → Mesher}/VoxelShaderData.js +0 -0
- /package/{Archive/Archive.types.js → Renderer/Classes/DVESectionMeshInterface.js} +0 -0
- /package/{Contexts/Render/Tasks/RenderTasks.types.js → Renderer/Renderer.types.js} +0 -0
- /package/{Data/Cursor/World/WorldSectionCursor.interface.js → Tasks/Propagation/Flow/CommonFunctions.d.ts} +0 -0
- /package/{Data/Types/DimensionData.types.js → Tasks/Propagation/Flow/CommonFunctions.js} +0 -0
- /package/{Data → Voxels}/Palettes/MaterialPalette.d.ts +0 -0
- /package/{Data → Voxels}/Palettes/MaterialPalette.js +0 -0
- /package/{Data → Voxels}/Palettes/SubstancePalette.d.ts +0 -0
- /package/{Data → Voxels}/Palettes/SubstancePalette.js +0 -0
- /package/{Data → Voxels}/Palettes/VoxelPalette.d.ts +0 -0
- /package/{Data → Voxels}/Palettes/VoxelPalette.js +0 -0
- /package/Voxels/{VoxelMaterial.types.d.ts → Types/VoxelMaterial.types.d.ts} +0 -0
- /package/Voxels/{VoxelMaterial.types.js → Types/VoxelMaterial.types.js} +0 -0
- /package/{Data/Types/RichWorldData.types.js → Voxels/Types/VoxelModelCompiledData.types.js} +0 -0
- /package/Voxels/{VoxelSubstances.types.d.ts → Types/VoxelSubstances.types.d.ts} +0 -0
- /package/Voxels/{VoxelSubstances.types.js → Types/VoxelSubstances.types.js} +0 -0
- /package/{Math/Math.types.js → World/Archive/Archive.types.js} +0 -0
- /package/{Archive → World/Archive}/index.d.ts +0 -0
- /package/{Archive → World/Archive}/index.js +0 -0
- /package/{Math/Spaces/VoxelSpaces.types.js → World/Cursor/WorldSectionCursor.interface.js} +0 -0
- /package/{Mesher/Meshers/MesherInterface.js → World/Storage/WorldStorage.interface.js} +0 -0
- /package/{Data/Structs/Constants → World/Structs}/WorldDataStructProperties.d.ts +0 -0
- /package/{Data/Structs/Constants → World/Structs}/WorldDataStructProperties.js +0 -0
- /package/{Mesher/Tasks/BuidlerTasks.types.js → World/Types/WorldData.types.js} +0 -0
- /package/{Data/World → World}/WorldBounds.d.ts +0 -0
|
@@ -1,111 +1,86 @@
|
|
|
1
|
-
import { MeshDefaultAttributes, } from "@amodx/meshing/MeshData.types";
|
|
2
|
-
import { EngineSettings } from "../../Settings/EngineSettings";
|
|
3
|
-
import { BinaryNumberTypes, TypedArrayClassMap, MappedByteCounts, } from "@amodx/binary";
|
|
4
|
-
import { VoxelMeshTypes } from "../../Mesher/Types/VoxelMesh.types";
|
|
5
|
-
import { Vector3Like } from "@amodx/math";
|
|
6
1
|
import { VoxelMeshVertexStructCursor } from "../Tools/VoxelMeshVertexStructCursor";
|
|
7
|
-
/**
|
|
8
|
-
struct VoxelMeshVertex {
|
|
9
|
-
position: vec3<f32>,
|
|
10
|
-
normal: vec3<f32>,
|
|
11
|
-
voxelData: f32,
|
|
12
|
-
textureIndex: vec3<f32>,
|
|
13
|
-
uv: vec2<f32>,
|
|
14
|
-
colors: vec3<f32>,
|
|
15
|
-
};
|
|
16
|
-
*/
|
|
17
2
|
const structCursor = new VoxelMeshVertexStructCursor();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
3
|
+
/*
|
|
4
|
+
function MakeWebGPUMesh(tool: VoxelMesherDataTool): CompactMeshData {
|
|
5
|
+
const mesh = tool.mesh!;
|
|
6
|
+
|
|
7
|
+
const positions = mesh.attributes.get(MeshDefaultAttributes.Position)![0];
|
|
8
|
+
const normals = mesh.attributes.get(MeshDefaultAttributes.Normal)![0];
|
|
9
|
+
const voxelData = mesh.attributes.get("voxelData")![0];
|
|
10
|
+
const textureIndex = mesh.attributes.get("textureIndex")![0];
|
|
11
|
+
const uv = mesh.attributes.get("uv")![0];
|
|
12
|
+
const colors = mesh.attributes.get("colors")![0];
|
|
13
|
+
const indices = mesh.attributes.get(MeshDefaultAttributes.Indices)![0];
|
|
14
|
+
|
|
15
|
+
const numVertices = positions.length / 3;
|
|
16
|
+
|
|
17
|
+
// Create the vertex buffer
|
|
18
|
+
const finalBuffer = new ArrayBuffer(
|
|
19
|
+
numVertices * VoxelMeshTypes.vertexStrideBytes
|
|
20
|
+
);
|
|
21
|
+
const vertexData = new Float32Array(finalBuffer);
|
|
22
|
+
structCursor.data = vertexData;
|
|
23
|
+
for (let i = 0; i < numVertices; i++) {
|
|
24
|
+
structCursor.index = i;
|
|
25
|
+
|
|
26
|
+
structCursor.positionX = positions[i * 3];
|
|
27
|
+
structCursor.positionY = positions[i * 3 + 1];
|
|
28
|
+
structCursor.positionZ = positions[i * 3 + 2];
|
|
29
|
+
|
|
30
|
+
structCursor.normalX = normals[i * 3];
|
|
31
|
+
structCursor.normalY = normals[i * 3 + 1];
|
|
32
|
+
structCursor.normalZ = normals[i * 3 + 2];
|
|
33
|
+
|
|
34
|
+
structCursor.voxelData = voxelData[i];
|
|
35
|
+
|
|
36
|
+
structCursor.textureIndexX = textureIndex[i * 3];
|
|
37
|
+
structCursor.textureIndexY = textureIndex[i * 3 + 1];
|
|
38
|
+
structCursor.textureIndexZ = textureIndex[i * 3 + 2];
|
|
39
|
+
|
|
40
|
+
structCursor.uvX = uv[i * 2];
|
|
41
|
+
structCursor.uvY = uv[i * 2 + 1];
|
|
42
|
+
|
|
43
|
+
structCursor.colorR = colors[i * 3];
|
|
44
|
+
structCursor.colorG = colors[i * 3 + 1];
|
|
45
|
+
structCursor.colorB = colors[i * 3 + 2];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const indexData = new Uint32Array(indices);
|
|
49
|
+
for (let i = 0; i < tool.bvhTool.tree.length; i++) {
|
|
50
|
+
if (tool.bvhTool.tree[i] == -Infinity) tool.bvhTool.tree[i] = -1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return [
|
|
54
|
+
1,
|
|
55
|
+
finalBuffer,
|
|
56
|
+
indexData,
|
|
57
|
+
tool.bvhTool.tree.slice(0),
|
|
58
|
+
tool.bvhTool.indices.slice(0),
|
|
59
|
+
Vector3Like.ToArray(mesh.minBounds),
|
|
60
|
+
Vector3Like.ToArray(mesh.maxBounds),
|
|
61
|
+
];
|
|
62
|
+
} */
|
|
63
|
+
export function CompactVoxelMesh(tools) {
|
|
64
|
+
const data = [0, []];
|
|
65
|
+
const transfers = [];
|
|
66
|
+
for (let i = 0; i < tools.length; i++) {
|
|
67
|
+
const tool = tools[i];
|
|
68
|
+
if (!tool.mesh.buffer.length)
|
|
69
|
+
continue;
|
|
70
|
+
const dataBuffer = new Float32Array(tool.mesh.buffer);
|
|
71
|
+
const indiciesBuffer = tool.mesh.indicieIndex > 65535
|
|
72
|
+
? new Uint32Array(tool.mesh.indices)
|
|
73
|
+
: new Uint16Array(tool.mesh.indices);
|
|
74
|
+
const minBounds = tool.mesh.minBounds;
|
|
75
|
+
const maxBounds = tool.mesh.maxBounds;
|
|
76
|
+
data[1].push([
|
|
77
|
+
tool.id,
|
|
78
|
+
dataBuffer,
|
|
79
|
+
indiciesBuffer,
|
|
80
|
+
[minBounds.x, minBounds.y, minBounds.z],
|
|
81
|
+
[maxBounds.x, maxBounds.y, maxBounds.z],
|
|
82
|
+
]);
|
|
83
|
+
transfers.push(dataBuffer.buffer, indiciesBuffer.buffer);
|
|
49
84
|
}
|
|
50
|
-
|
|
51
|
-
for (let i = 0; i < tool.bvhTool.tree.length; i++) {
|
|
52
|
-
if (tool.bvhTool.tree[i] == -Infinity)
|
|
53
|
-
tool.bvhTool.tree[i] = -1;
|
|
54
|
-
}
|
|
55
|
-
return [
|
|
56
|
-
1,
|
|
57
|
-
finalBuffer,
|
|
58
|
-
indexData,
|
|
59
|
-
tool.bvhTool.tree.slice(0),
|
|
60
|
-
tool.bvhTool.indices.slice(0),
|
|
61
|
-
Vector3Like.ToArray(mesh.minBounds),
|
|
62
|
-
Vector3Like.ToArray(mesh.maxBounds),
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
export function CompactVoxelMesh(...tools) {
|
|
66
|
-
if (EngineSettings.settings.rendererSettings.mode == "webgpu") {
|
|
67
|
-
throw new Error("WebGPU disabled right now");
|
|
68
|
-
// return MakeWebGPUMesh(tool);
|
|
69
|
-
}
|
|
70
|
-
const dataMap = [];
|
|
71
|
-
let totalSize = 0;
|
|
72
|
-
for (const tool of tools) {
|
|
73
|
-
const mesh = tool.mesh;
|
|
74
|
-
const subMesh = [tool.id, []];
|
|
75
|
-
for (let [key, [array, stride, type]] of mesh.attributes) {
|
|
76
|
-
if (key == MeshDefaultAttributes.Indices) {
|
|
77
|
-
if (array.length > 60_000) {
|
|
78
|
-
type = BinaryNumberTypes.Uint32;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
let current = totalSize;
|
|
82
|
-
totalSize += MappedByteCounts[type] * array.length;
|
|
83
|
-
subMesh[1].push([
|
|
84
|
-
key,
|
|
85
|
-
mesh.attributes.get(key)[0],
|
|
86
|
-
array.length,
|
|
87
|
-
current,
|
|
88
|
-
totalSize,
|
|
89
|
-
stride,
|
|
90
|
-
type,
|
|
91
|
-
]);
|
|
92
|
-
}
|
|
93
|
-
for (let i = 0; i < tool.bvhTool.tree.length; i++) {
|
|
94
|
-
if (tool.bvhTool.tree[i] == -Infinity)
|
|
95
|
-
tool.bvhTool.tree[i] = -1;
|
|
96
|
-
}
|
|
97
|
-
dataMap.push(subMesh);
|
|
98
|
-
}
|
|
99
|
-
const finalBuffer = new ArrayBuffer(totalSize);
|
|
100
|
-
for (let subMesh of dataMap) {
|
|
101
|
-
for (const data of subMesh[1]) {
|
|
102
|
-
const [id, n, length, startByte, endByte, stride, type] = data;
|
|
103
|
-
const newArray = new TypedArrayClassMap[type](finalBuffer,
|
|
104
|
-
//@ts-ignore
|
|
105
|
-
startByte, length);
|
|
106
|
-
newArray.set(n);
|
|
107
|
-
data[1] = newArray;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return [0, finalBuffer, dataMap];
|
|
85
|
+
return [data, transfers];
|
|
111
86
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
//data
|
|
2
|
+
import { WorldSpaces } from "../../World/WorldSpaces.js";
|
|
3
|
+
//tools
|
|
4
|
+
import { VoxelGeometryLookUp } from "../Models/VoxelGeometryLookUp.js";
|
|
5
|
+
import { CompactVoxelMesh } from "./CompactVoxelMesh.js";
|
|
6
|
+
import { WorldCursor } from "../../World/Cursor/WorldCursor.js";
|
|
7
|
+
import { SectionCursor } from "../../World/Cursor/SectionCursor.js";
|
|
8
|
+
import { RenderedMaterials } from "../RenderedMaterials";
|
|
9
|
+
import { VoxelModelConstructorRegister } from "../Models/VoxelModelConstructorRegister.js";
|
|
10
|
+
import { SectionHeightMap } from "../../World/Section/SectionHeightMap.js";
|
|
11
|
+
import { WorldRegister } from "../../World/WorldRegister.js";
|
|
12
|
+
import { VoxelMeshBVHBuilder } from "../Tools/VoxelMeshBVHBuilder";
|
|
13
|
+
const sectionCursor = new SectionCursor();
|
|
14
|
+
const worldCursor = new WorldCursor();
|
|
15
|
+
const bvhTool = new VoxelMeshBVHBuilder();
|
|
16
|
+
function process(x, y, z) {
|
|
17
|
+
const voxel = sectionCursor.getVoxel(x, y, z);
|
|
18
|
+
if (!voxel)
|
|
19
|
+
return false;
|
|
20
|
+
if (!voxel.isRenderable())
|
|
21
|
+
return false;
|
|
22
|
+
if (voxel.hasSecondaryVoxel()) {
|
|
23
|
+
voxel.setSecondary(true);
|
|
24
|
+
meshVoxel(x, y, z, voxel);
|
|
25
|
+
voxel.setSecondary(false);
|
|
26
|
+
}
|
|
27
|
+
meshVoxel(x, y, z, voxel);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function meshVoxel(x, y, z, voxel) {
|
|
31
|
+
const constructor = VoxelModelConstructorRegister.constructorsPaltte[voxel.getId()];
|
|
32
|
+
if (!constructor) {
|
|
33
|
+
throw new Error(`Could not find constructor ${voxel.getId()} | ${voxel.getName()} `);
|
|
34
|
+
}
|
|
35
|
+
const mesher = RenderedMaterials.meshers[voxel.getRenderedMaterial()];
|
|
36
|
+
if (!mesher) {
|
|
37
|
+
throw new Error(`Could not find material for ${voxel.getId()} | ${voxel.getName()} | ${constructor?.id} | ${voxel.getMaterial()} | ${voxel.getRenderedMaterialStringId()}`);
|
|
38
|
+
}
|
|
39
|
+
mesher.origin.x = sectionCursor._voxelPosition.x;
|
|
40
|
+
mesher.origin.y = sectionCursor._voxelPosition.y;
|
|
41
|
+
mesher.origin.z = sectionCursor._voxelPosition.z;
|
|
42
|
+
mesher.position.x = x;
|
|
43
|
+
mesher.position.y = y;
|
|
44
|
+
mesher.position.z = z;
|
|
45
|
+
mesher.voxel = voxel;
|
|
46
|
+
mesher.nVoxel = worldCursor;
|
|
47
|
+
mesher.startConstruction();
|
|
48
|
+
constructor.process(mesher);
|
|
49
|
+
mesher.endConstruction();
|
|
50
|
+
mesher.reset();
|
|
51
|
+
}
|
|
52
|
+
export function MeshSection(location) {
|
|
53
|
+
const [dimension, cx, cy, cz] = location;
|
|
54
|
+
WorldRegister.setDimension(dimension);
|
|
55
|
+
const sector = WorldRegister.sectors.get(cx, cy, cz);
|
|
56
|
+
if (!sector)
|
|
57
|
+
return null;
|
|
58
|
+
// console.log("mesh section", dimension, cx, cy, cz);
|
|
59
|
+
const meshStart = performance.now();
|
|
60
|
+
const section = sector.getSection(cy);
|
|
61
|
+
SectionHeightMap.setSection(section);
|
|
62
|
+
worldCursor.setFocalPoint(...location);
|
|
63
|
+
sectionCursor.setSection(...location);
|
|
64
|
+
let [minY, maxY] = SectionHeightMap.getMinMax();
|
|
65
|
+
const maxX = WorldSpaces.section.bounds.x;
|
|
66
|
+
const maxZ = WorldSpaces.section.bounds.z;
|
|
67
|
+
if (Math.abs(minY) == Infinity && Math.abs(maxY) == Infinity)
|
|
68
|
+
return null;
|
|
69
|
+
VoxelGeometryLookUp.start(dimension, location[1], location[2], location[3]);
|
|
70
|
+
bvhTool.reset();
|
|
71
|
+
for (let i = 0; i < RenderedMaterials.meshers.length; i++) {
|
|
72
|
+
RenderedMaterials.meshers[i].bvhTool = bvhTool;
|
|
73
|
+
}
|
|
74
|
+
for (let y = minY; y <= maxY; y++) {
|
|
75
|
+
let foundVoxels = false;
|
|
76
|
+
if (!SectionHeightMap.getVoxel(y) && !SectionHeightMap.getDirty(y))
|
|
77
|
+
continue;
|
|
78
|
+
for (let x = 0; x < maxX; x++) {
|
|
79
|
+
for (let z = 0; z < maxZ; z++) {
|
|
80
|
+
let found = process(x + cx, y + cy, z + cz);
|
|
81
|
+
if (found)
|
|
82
|
+
foundVoxels = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
SectionHeightMap.setVoxel(y, foundVoxels);
|
|
86
|
+
SectionHeightMap.setDirty(y, false);
|
|
87
|
+
}
|
|
88
|
+
VoxelGeometryLookUp.stop();
|
|
89
|
+
const compactStart = performance.now();
|
|
90
|
+
const transfers = [];
|
|
91
|
+
const sectionEffects = [];
|
|
92
|
+
const sections = [location, [], sectionEffects, 0];
|
|
93
|
+
const meshed = [];
|
|
94
|
+
for (let i = 0; i < RenderedMaterials.meshers.length; i++) {
|
|
95
|
+
const mesher = RenderedMaterials.meshers[i];
|
|
96
|
+
for (const e in mesher.effects) {
|
|
97
|
+
const float = Float32Array.from(mesher.effects[e]);
|
|
98
|
+
transfers.push(float.buffer);
|
|
99
|
+
sectionEffects.push([e, float]);
|
|
100
|
+
}
|
|
101
|
+
if (!mesher.mesh.buffer.length) {
|
|
102
|
+
mesher.resetAll();
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
meshed.push(mesher);
|
|
106
|
+
}
|
|
107
|
+
const [compactMesh, buffers] = CompactVoxelMesh(meshed);
|
|
108
|
+
sections[1] = compactMesh;
|
|
109
|
+
for (let i = 0; i < meshed.length; i++) {
|
|
110
|
+
meshed[i].resetAll();
|
|
111
|
+
}
|
|
112
|
+
return [sections, [...transfers, ...buffers]];
|
|
113
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MeshTexture(textureId: number, textureData: number[]): import("../Geomtry/Mesh").Mesh | null;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { MesherDataTool } from "../Geomtry/Tools/MesherDataTools";
|
|
2
|
+
import { Quad } from "../Geomtry/Primitives/Quad";
|
|
3
|
+
const Quads = {
|
|
4
|
+
north: Quad.Create([
|
|
5
|
+
[0, 0, 0],
|
|
6
|
+
[1, 1, 0],
|
|
7
|
+
], Quad.FullUVs, false, 1),
|
|
8
|
+
south: Quad.Create([
|
|
9
|
+
[0, 0, 0],
|
|
10
|
+
[1, 1, 0],
|
|
11
|
+
], Quad.FullUVs, false, 0),
|
|
12
|
+
};
|
|
13
|
+
const tool = new MesherDataTool();
|
|
14
|
+
tool.startNewMesh();
|
|
15
|
+
//tool.mesh!.attributes.set("uv", [[], 2, BinaryNumberTypes.Float32]);
|
|
16
|
+
//tool.mesh!.attributes.set("textureIndex", [[], 3, BinaryNumberTypes.Float32]);
|
|
17
|
+
export function MeshTexture(textureId, textureData) {
|
|
18
|
+
/*
|
|
19
|
+
const width = Math.sqrt(textureData.length / 4);
|
|
20
|
+
const height = Math.sqrt(textureData.length / 4);
|
|
21
|
+
const factor = 1 / width;
|
|
22
|
+
|
|
23
|
+
const textureDataIndex = Flat2DIndex.GetXYOrder();
|
|
24
|
+
textureDataIndex.setBounds(width, height);
|
|
25
|
+
|
|
26
|
+
const origin = Vector3Like.Create(-0.5, -0.5, -0.5);
|
|
27
|
+
|
|
28
|
+
const isSolid = (x: number, y: number) =>
|
|
29
|
+
x >= 0 &&
|
|
30
|
+
x < width &&
|
|
31
|
+
y >= 0 &&
|
|
32
|
+
y < height &&
|
|
33
|
+
textureData[textureDataIndex.getIndexXY(x, y) * 4 + 3] > 0.01
|
|
34
|
+
? true
|
|
35
|
+
: false;
|
|
36
|
+
|
|
37
|
+
const uvs = tool.mesh!.getAttribute("uv");
|
|
38
|
+
const textureIndex = tool.mesh!.getAttribute("textureIndex");
|
|
39
|
+
const uvOffset = width > 16 ? -(2 / Math.max(width, height)) : 0;
|
|
40
|
+
|
|
41
|
+
const addUvs = (sx: number, sy: number, ex: number, ey: number) => {
|
|
42
|
+
uvs.push(
|
|
43
|
+
(ex + uvOffset) * factor,
|
|
44
|
+
(ey + uvOffset) * factor,
|
|
45
|
+
(sx - uvOffset) * factor,
|
|
46
|
+
(ey + uvOffset) * factor,
|
|
47
|
+
(sx - uvOffset) * factor,
|
|
48
|
+
(sy - uvOffset) * factor,
|
|
49
|
+
(ex + uvOffset) * factor,
|
|
50
|
+
(sy - uvOffset) * factor
|
|
51
|
+
);
|
|
52
|
+
textureIndex.push(
|
|
53
|
+
textureId,
|
|
54
|
+
0,
|
|
55
|
+
0,
|
|
56
|
+
textureId,
|
|
57
|
+
0,
|
|
58
|
+
0,
|
|
59
|
+
textureId,
|
|
60
|
+
0,
|
|
61
|
+
0,
|
|
62
|
+
textureId,
|
|
63
|
+
0,
|
|
64
|
+
0
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
{
|
|
69
|
+
GeometryBuilder.addQuad(tool, origin, Quads.south);
|
|
70
|
+
uvs.push(
|
|
71
|
+
Quads.south.uvs.vertices[QuadVerticies.TopRight].x,
|
|
72
|
+
Quads.south.uvs.vertices[QuadVerticies.TopRight].y,
|
|
73
|
+
Quads.south.uvs.vertices[QuadVerticies.TopLeft].x,
|
|
74
|
+
Quads.south.uvs.vertices[QuadVerticies.TopLeft].y,
|
|
75
|
+
Quads.south.uvs.vertices[QuadVerticies.BottomLeft].x,
|
|
76
|
+
Quads.south.uvs.vertices[QuadVerticies.BottomLeft].y,
|
|
77
|
+
Quads.south.uvs.vertices[QuadVerticies.BottomRight].x,
|
|
78
|
+
Quads.south.uvs.vertices[QuadVerticies.BottomRight].y
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
textureIndex.push(
|
|
82
|
+
textureId,
|
|
83
|
+
0,
|
|
84
|
+
0,
|
|
85
|
+
textureId,
|
|
86
|
+
0,
|
|
87
|
+
0,
|
|
88
|
+
textureId,
|
|
89
|
+
0,
|
|
90
|
+
0,
|
|
91
|
+
textureId,
|
|
92
|
+
0,
|
|
93
|
+
0
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
{
|
|
98
|
+
const backPositionZ = factor;
|
|
99
|
+
Quads.north.positions.vertices[QuadVerticies.TopRight].z = backPositionZ;
|
|
100
|
+
Quads.north.positions.vertices[QuadVerticies.TopLeft].z = backPositionZ;
|
|
101
|
+
Quads.north.positions.vertices[QuadVerticies.BottomLeft].z = backPositionZ;
|
|
102
|
+
Quads.north.positions.vertices[QuadVerticies.BottomRight].z = backPositionZ;
|
|
103
|
+
Quads.north.flip = true;
|
|
104
|
+
uvs.push(
|
|
105
|
+
Quads.north.uvs.vertices[QuadVerticies.TopLeft].x,
|
|
106
|
+
Quads.north.uvs.vertices[QuadVerticies.TopLeft].y,
|
|
107
|
+
Quads.north.uvs.vertices[QuadVerticies.TopRight].x,
|
|
108
|
+
Quads.north.uvs.vertices[QuadVerticies.TopRight].y,
|
|
109
|
+
Quads.north.uvs.vertices[QuadVerticies.BottomRight].x,
|
|
110
|
+
Quads.north.uvs.vertices[QuadVerticies.BottomRight].y,
|
|
111
|
+
Quads.north.uvs.vertices[QuadVerticies.BottomLeft].x,
|
|
112
|
+
Quads.north.uvs.vertices[QuadVerticies.BottomLeft].y
|
|
113
|
+
);
|
|
114
|
+
GeometryBuilder.addQuad(tool, origin, Quads.north);
|
|
115
|
+
textureIndex.push(
|
|
116
|
+
textureId,
|
|
117
|
+
0,
|
|
118
|
+
0,
|
|
119
|
+
textureId,
|
|
120
|
+
0,
|
|
121
|
+
0,
|
|
122
|
+
textureId,
|
|
123
|
+
0,
|
|
124
|
+
0,
|
|
125
|
+
textureId,
|
|
126
|
+
0,
|
|
127
|
+
0
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for (let x = 0; x < width; x++) {
|
|
132
|
+
let eastFace: Vec2Array | null = null;
|
|
133
|
+
let westFace: Vec2Array | null = null;
|
|
134
|
+
for (let y = 0; y < height; y++) {
|
|
135
|
+
let eastFaceExposed = true;
|
|
136
|
+
let westFaceExposed = true;
|
|
137
|
+
|
|
138
|
+
if (!isSolid(x, y)) {
|
|
139
|
+
eastFaceExposed = false;
|
|
140
|
+
westFaceExposed = false;
|
|
141
|
+
}
|
|
142
|
+
if (isSolid(x + 1, y)) {
|
|
143
|
+
eastFaceExposed = false;
|
|
144
|
+
}
|
|
145
|
+
if (isSolid(x - 1, y)) {
|
|
146
|
+
westFaceExposed = false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (eastFace && !eastFaceExposed) {
|
|
150
|
+
const newQuad = Quad.Create(
|
|
151
|
+
[
|
|
152
|
+
[x * factor + factor, eastFace[1] * factor, 0],
|
|
153
|
+
[x * factor + factor, y * factor, factor],
|
|
154
|
+
],
|
|
155
|
+
Quad.FullUVs as any,
|
|
156
|
+
false,
|
|
157
|
+
0
|
|
158
|
+
);
|
|
159
|
+
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
160
|
+
|
|
161
|
+
let [sx, sy] = eastFace;
|
|
162
|
+
let ex = x;
|
|
163
|
+
let ey = y;
|
|
164
|
+
ex += 1;
|
|
165
|
+
addUvs(sx, sy, ex, ey);
|
|
166
|
+
eastFace = null;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (westFace && !westFaceExposed) {
|
|
170
|
+
const newQuad = Quad.Create(
|
|
171
|
+
[
|
|
172
|
+
[x * factor, westFace[1] * factor, 0],
|
|
173
|
+
[x * factor, y * factor, factor],
|
|
174
|
+
],
|
|
175
|
+
Quad.FullUVs as any,
|
|
176
|
+
false,
|
|
177
|
+
1
|
|
178
|
+
);
|
|
179
|
+
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
180
|
+
let [sx, sy] = westFace;
|
|
181
|
+
let ex = x;
|
|
182
|
+
let ey = y;
|
|
183
|
+
ex += 1;
|
|
184
|
+
addUvs(sx, sy, ex, ey);
|
|
185
|
+
westFace = null;
|
|
186
|
+
}
|
|
187
|
+
const isPixel = isSolid(x, y);
|
|
188
|
+
if (!isSolid(x + 1, y) && !eastFace && isPixel) {
|
|
189
|
+
eastFace = [x, y];
|
|
190
|
+
}
|
|
191
|
+
if (!isSolid(x - 1, y) && !westFace && isPixel) {
|
|
192
|
+
westFace = [x, y];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
for (let y = 0; y < height; y++) {
|
|
197
|
+
let upFace: Vec2Array | null = null;
|
|
198
|
+
let downFace: Vec2Array | null = null;
|
|
199
|
+
|
|
200
|
+
for (let x = 0; x < width; x++) {
|
|
201
|
+
let upFaceExposed = true;
|
|
202
|
+
let downFaceExposed = true;
|
|
203
|
+
|
|
204
|
+
if (!isSolid(x, y)) {
|
|
205
|
+
upFaceExposed = false;
|
|
206
|
+
downFaceExposed = false;
|
|
207
|
+
}
|
|
208
|
+
if (isSolid(x, y + 1)) {
|
|
209
|
+
upFaceExposed = false;
|
|
210
|
+
}
|
|
211
|
+
if (isSolid(x, y - 1)) {
|
|
212
|
+
downFaceExposed = false;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (upFace && !upFaceExposed) {
|
|
216
|
+
const newQuad = Quad.Create(
|
|
217
|
+
[
|
|
218
|
+
[upFace[0] * factor, y * factor + factor, 0],
|
|
219
|
+
[x * factor, y * factor + factor, factor],
|
|
220
|
+
],
|
|
221
|
+
Quad.FullUVs as any,
|
|
222
|
+
false,
|
|
223
|
+
0
|
|
224
|
+
);
|
|
225
|
+
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
226
|
+
let [sx, sy] = upFace;
|
|
227
|
+
let [ex, ey] = [x, y];
|
|
228
|
+
|
|
229
|
+
ey += 1;
|
|
230
|
+
addUvs(sx, sy, ex, ey);
|
|
231
|
+
upFace = null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (downFace && !downFaceExposed) {
|
|
235
|
+
const newQuad = Quad.Create(
|
|
236
|
+
[
|
|
237
|
+
[downFace[0] * factor, y * factor, 0],
|
|
238
|
+
[x * factor, y * factor, factor],
|
|
239
|
+
],
|
|
240
|
+
Quad.FullUVs as any,
|
|
241
|
+
false,
|
|
242
|
+
1
|
|
243
|
+
);
|
|
244
|
+
GeometryBuilder.addQuad(tool, origin, newQuad);
|
|
245
|
+
let [sx, sy] = downFace;
|
|
246
|
+
let [ex, ey] = [x, y];
|
|
247
|
+
ey += 1;
|
|
248
|
+
addUvs(sx, sy, ex, ey);
|
|
249
|
+
downFace = null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const isPixel = isSolid(x, y);
|
|
253
|
+
if (!isSolid(x, y + 1) && !upFace && isPixel) {
|
|
254
|
+
upFace = [x, y];
|
|
255
|
+
}
|
|
256
|
+
if (!isSolid(x, y - 1) && !downFace && isPixel) {
|
|
257
|
+
downFace = [x, y];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
for (const [key, [data]] of tool.mesh!.attributes) {
|
|
263
|
+
if (key == "position") {
|
|
264
|
+
for (let i = 0; i < data.length; i += 3) {
|
|
265
|
+
(data as any as number[])[i] -= 0.5;
|
|
266
|
+
(data as any as number[])[i + 1] -= 0.5;
|
|
267
|
+
(data as any as number[])[i + 2];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const compacted = CompactMesh("dve_node", tool);
|
|
273
|
+
*/
|
|
274
|
+
return tool.mesh;
|
|
275
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RenderedMaterials } from "../RenderedMaterials";
|
|
2
|
+
import { VoxelGeometryLookUp } from "../Models/VoxelGeometryLookUp.js";
|
|
3
|
+
import { TemplateCursor } from "../../Templates/Cursor/TemplateCursor.js";
|
|
4
|
+
import { VoxelCursor } from "../../Voxels/Cursor/VoxelCursor.js";
|
|
5
|
+
import { FullVoxelTemplate } from "../../Templates/FullVoxelTemplate.js";
|
|
6
|
+
import { CompactVoxelMesh } from "../Functions/CompactVoxelMesh.js";
|
|
7
|
+
import { VoxelModelConstructorRegister } from "../Models/VoxelModelConstructorRegister.js";
|
|
8
|
+
const templateCursor = new TemplateCursor();
|
|
9
|
+
const voxelCursor = new VoxelCursor();
|
|
10
|
+
templateCursor.setTemplate(new FullVoxelTemplate(FullVoxelTemplate.CreateNew([3, 3, 3], 0xf)));
|
|
11
|
+
export function MeshVoxel(rawVoxelData) {
|
|
12
|
+
const voxel = templateCursor.getVoxel(1, 1, 1);
|
|
13
|
+
voxel.copyRaw(rawVoxelData);
|
|
14
|
+
voxel.process();
|
|
15
|
+
if (!voxel.isRenderable())
|
|
16
|
+
return false;
|
|
17
|
+
const constructor = VoxelModelConstructorRegister.getConstructor(voxel.getStringId());
|
|
18
|
+
if (!constructor) {
|
|
19
|
+
throw new Error(`Could not find constructor for voxel [id:${voxel.getStringId()} name:${voxel.getName()}] `);
|
|
20
|
+
}
|
|
21
|
+
const mesher = RenderedMaterials.meshersMap.get(voxel.getRenderedMaterialStringId());
|
|
22
|
+
if (!mesher) {
|
|
23
|
+
throw new Error(`Could not find material mesh for voxel [id:${voxel.getStringId()} name:${voxel.getName()}] `);
|
|
24
|
+
}
|
|
25
|
+
mesher.bvhTool = null;
|
|
26
|
+
mesher.resetAll();
|
|
27
|
+
VoxelGeometryLookUp.start("main", 0, 0, 0);
|
|
28
|
+
mesher.origin.x = -0.5;
|
|
29
|
+
mesher.origin.y = -0.5;
|
|
30
|
+
mesher.origin.z = -0.5;
|
|
31
|
+
mesher.position.x = 1;
|
|
32
|
+
mesher.position.y = 1;
|
|
33
|
+
mesher.position.z = 1;
|
|
34
|
+
mesher.voxel = voxelCursor.copy(voxel);
|
|
35
|
+
mesher.nVoxel = templateCursor;
|
|
36
|
+
constructor.process(mesher);
|
|
37
|
+
mesher.reset();
|
|
38
|
+
VoxelGeometryLookUp.stop();
|
|
39
|
+
const compacted = CompactVoxelMesh([mesher]);
|
|
40
|
+
mesher.reset();
|
|
41
|
+
mesher.mesh.clear();
|
|
42
|
+
return compacted;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Vec2Array, Vec3Array } from "@amodx/math";
|
|
2
|
+
export type QuadVertexVec3Data = [Vec3Array, Vec3Array, Vec3Array, Vec3Array];
|
|
3
|
+
export type QuadVertexFloatData = [number, number, number, number];
|
|
4
|
+
export type QuadUVData = [Vec2Array, Vec2Array, Vec2Array, Vec2Array];
|
|
5
|
+
export declare enum QuadVerticies {
|
|
6
|
+
TopRight = 0,
|
|
7
|
+
TopLeft = 1,
|
|
8
|
+
BottomLeft = 2,
|
|
9
|
+
BottomRight = 3
|
|
10
|
+
}
|
|
11
|
+
export declare const QuadVerticiesArray: QuadVerticies[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var QuadVerticies;
|
|
2
|
+
(function (QuadVerticies) {
|
|
3
|
+
QuadVerticies[QuadVerticies["TopRight"] = 0] = "TopRight";
|
|
4
|
+
QuadVerticies[QuadVerticies["TopLeft"] = 1] = "TopLeft";
|
|
5
|
+
QuadVerticies[QuadVerticies["BottomLeft"] = 2] = "BottomLeft";
|
|
6
|
+
QuadVerticies[QuadVerticies["BottomRight"] = 3] = "BottomRight";
|
|
7
|
+
})(QuadVerticies || (QuadVerticies = {}));
|
|
8
|
+
export const QuadVerticiesArray = [
|
|
9
|
+
QuadVerticies.TopRight,
|
|
10
|
+
QuadVerticies.TopLeft,
|
|
11
|
+
QuadVerticies.BottomLeft,
|
|
12
|
+
QuadVerticies.BottomRight,
|
|
13
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Vec3Array } from "@amodx/math";
|
|
2
|
+
export declare class GeometryNormals {
|
|
3
|
+
static subtract(v1: Vec3Array, v2: Vec3Array): Vec3Array;
|
|
4
|
+
static cross(v1: Vec3Array, v2: Vec3Array): Vec3Array;
|
|
5
|
+
static scale(v: Vec3Array, scaleFactor: number): Vec3Array;
|
|
6
|
+
static add(v1: Vec3Array, v2: Vec3Array): Vec3Array;
|
|
7
|
+
static normalize(v: Vec3Array): Vec3Array;
|
|
8
|
+
static getTriangleNormals(p1: Vec3Array, p2: Vec3Array, p3: Vec3Array): Vec3Array;
|
|
9
|
+
static getQuadNormal(p1: Vec3Array, p2: Vec3Array, p3: Vec3Array, p4: Vec3Array): [n1: Vec3Array, n2: Vec3Array, n3: Vec3Array, n4: Vec3Array];
|
|
10
|
+
}
|