@divinevoxel/vlox 0.0.72 → 0.0.74
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/Contexts/Base/Remote/InitDataSync.js +4 -0
- package/Contexts/Base/Remote/InitWorldDataSync.js +1 -1
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +2 -1
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +2 -1
- package/Init/StartConstructor.js +8 -4
- package/Init/StartWorld.d.ts +1 -1
- package/Math/index.d.ts +5 -1
- package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
- package/Mesher/Functions/CompactVoxelMesh.js +1 -1
- package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
- package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
- package/Mesher/Functions/MeshSection.d.ts +1 -1
- package/Mesher/Functions/MeshSection.js +27 -22
- package/Mesher/Functions/MeshTexture.d.ts +1 -1
- package/Mesher/Functions/MeshTexture.js +3 -4
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
- package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +12 -10
- package/Mesher/Geomtry/Primitives/QuadVertexData.js +49 -56
- package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +2 -2
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +120 -199
- package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
- package/Mesher/Geomtry/VoxelMesh.js +4 -4
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +16 -0
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +51 -0
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
- package/Mesher/Geomtry/{Buffers.js → VoxelMeshBuffers.js} +2 -2
- package/Mesher/Geomtry/index.d.ts +0 -1
- package/Mesher/Geomtry/index.js +0 -1
- package/Mesher/InitMesher.js +1 -1
- package/Mesher/InitTask.js +9 -23
- package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
- package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
- package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
- package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -2
- package/Mesher/Models/Common/Calc/FaceDataCalc.js +37 -30
- package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +2 -2
- package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +18 -24
- package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -2
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +1 -0
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +40 -31
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
- package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.d.ts +1 -1
- package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.js +1 -1
- package/Mesher/Models/RenderedMaterials.d.ts +6 -0
- package/Mesher/{RenderedMaterials.js → Models/RenderedMaterials.js} +2 -2
- package/Mesher/Models/VoxelConstructor.d.ts +6 -6
- package/Mesher/Models/VoxelConstructor.js +8 -8
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +3 -5
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -32
- package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +4 -5
- package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +5 -8
- package/Mesher/Types/Mesher.types.d.ts +1 -0
- package/Models/Defaults/CubeVoxelGeometry.js +4 -0
- package/Models/Defaults/CubeVoxelModels.js +360 -383
- package/Models/Defaults/LiquidVoxelModel.js +5 -5
- package/Models/Defaults/PanelVoxelModels.js +442 -468
- package/Models/Defaults/StairVoxelModel.js +582 -597
- package/Models/Examples.js +490 -498
- package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
- package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
- package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
- package/Models/Rules/Functions/BuildFinalInputs.js +21 -19
- package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
- package/Models/Rules/Functions/BuildRules.js +2 -2
- package/Models/Rules/{VoxelModelManager.d.ts → VoxelModelRuleBuilderRegister.d.ts} +1 -1
- package/Models/Rules/VoxelModelRuleBuilderRegister.js +178 -0
- package/Models/VoxelModel.types.d.ts +17 -8
- package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
- package/Renderer/Classes/SectorMesh.d.ts +3 -4
- package/Renderer/Classes/SectorMesh.js +6 -11
- package/Renderer/InitTasks.js +1 -10
- package/Renderer/MeshManager.d.ts +1 -1
- package/Renderer/MeshManager.js +26 -25
- package/Renderer/MeshRegister.d.ts +5 -5
- package/Renderer/MeshRegister.js +4 -3
- package/Settings/EngineSettings.d.ts +2 -1
- package/Settings/EngineSettings.js +6 -5
- package/Settings/EngineSettings.types.d.ts +24 -39
- package/Settings/EngineSettings.types.js +22 -29
- package/Tasks/Logic/InitTasks.d.ts +1 -0
- package/Tasks/Logic/InitTasks.js +10 -0
- package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
- package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
- package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
- package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
- package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
- package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
- package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
- package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
- package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
- package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
- package/Tasks/Propagation/InitTasks.js +4 -4
- package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
- package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
- package/Tasks/Tasks.types.d.ts +2 -2
- package/Tasks/TasksIds.d.ts +2 -1
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/Update/Common.d.ts +3 -0
- package/Tasks/Update/Common.js +41 -0
- package/Tasks/Update/EreaseUpdate.d.ts +3 -0
- package/Tasks/Update/EreaseUpdate.js +66 -0
- package/Tasks/Update/InitTasks.d.ts +2 -2
- package/Tasks/Update/InitTasks.js +3 -1
- package/Tasks/Update/PaintUpdate.d.ts +3 -0
- package/Tasks/Update/PaintUpdate.js +89 -0
- package/Tasks/Update/VoxelUpdate.d.ts +2 -5
- package/Tasks/Update/VoxelUpdate.js +7 -143
- package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +16 -6
- package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +44 -5
- package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
- package/Tasks/WorldGeneration/WorldGenBrush.js +3 -3
- package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
- package/Templates/Cursor/TemplateCursor.d.ts +2 -2
- package/Templates/Cursor/TemplateCursor.js +1 -2
- package/Templates/Functions/CreateTemplate.d.ts +1 -1
- package/Templates/VoxelTemplates.types.d.ts +1 -1
- package/Textures/Classes/CompiledTexture.d.ts +18 -0
- package/Textures/Classes/CompiledTexture.js +50 -0
- package/Textures/Classes/CompiledTextureAnimation.d.ts +12 -0
- package/Textures/Classes/CompiledTextureAnimation.js +27 -0
- package/Textures/Classes/TextureAnimationTexture.d.ts +10 -0
- package/Textures/Classes/TextureAnimationTexture.js +32 -0
- package/Textures/Functions/BuildTextureData.d.ts +10 -0
- package/Textures/Functions/BuildTextureData.js +205 -0
- package/Textures/Texture.types.d.ts +50 -64
- package/Textures/TextureManager.d.ts +8 -19
- package/Textures/TextureManager.js +28 -166
- package/Tools/Brush/AdvancedBrushTool.js +1 -1
- package/Tools/Brush/Brush.d.ts +3 -3
- package/Tools/Brush/Brush.js +40 -8
- package/Tools/Tasks/TasksTool.d.ts +1 -0
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Util/Binary/BinaryArrays.d.ts +6 -0
- package/Util/Binary/BinaryArrays.js +25 -0
- package/Util/Binary/BinaryBuffer.d.ts +35 -0
- package/Util/Binary/BinaryBuffer.js +136 -0
- package/Util/Binary/{BitArray.d.ts → BinaryFunctions.d.ts} +1 -2
- package/Util/Binary/BinaryFunctions.js +11 -0
- package/{Mesher/Tools/VoxelMeshBVHBuilder.d.ts → Util/Binary/BinaryTree.d.ts} +1 -33
- package/Util/Binary/BinaryTree.js +104 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +8 -3
- package/Voxels/Cursor/VoxelCursor.interface.js +54 -13
- package/Voxels/Cursor/VoxelLightData.js +1 -1
- package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -5
- package/Voxels/Data/VoxelPalettesRegister.js +0 -9
- package/Voxels/Data/VoxelTag.types.d.ts +17 -2
- package/Voxels/Data/VoxelTag.types.js +6 -1
- package/Voxels/Data/VoxelTagsRegister.js +12 -7
- package/Voxels/Functions/BuildStateData.d.ts +6 -6
- package/Voxels/Functions/BuildStateData.js +37 -37
- package/Voxels/Functions/BuildTagAndPaletteData.js +6 -3
- package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
- package/Voxels/Indexes/VoxelIndex.js +16 -18
- package/Voxels/InitVoxelData.js +24 -21
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
- package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
- package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
- package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
- package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
- package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
- package/Voxels/Logic/VoxelLogic.types.js +1 -0
- package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
- package/Voxels/Logic/VoxelLogicRegister.js +15 -0
- package/Voxels/State/Schema/StateSchema.d.ts +1 -1
- package/Voxels/State/SchemaRegister.js +10 -5
- package/Voxels/State/State.types.d.ts +1 -1
- package/Voxels/State/StateTreeReader.d.ts +1 -1
- package/Voxels/State/StateTreeReader.js +2 -3
- package/Voxels/Types/Voxel.types.d.ts +21 -0
- package/Voxels/Types/Voxel.types.js +6 -2
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
- package/World/Archive/Archive.types.d.ts +65 -42
- package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
- package/World/Archive/Classes/ArchiveClasses.js +78 -0
- package/World/Archive/Classes/ImportedSection.d.ts +40 -0
- package/World/Archive/Classes/ImportedSection.js +307 -0
- package/World/Archive/Classes/ImportedSector.d.ts +23 -0
- package/World/Archive/Classes/ImportedSector.js +97 -0
- package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
- package/World/Archive/Functions/ArchiveArea.js +49 -54
- package/World/Archive/Functions/ArchiveSector.js +373 -282
- package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
- package/World/Archive/Functions/CreateArchivedSection.js +207 -0
- package/World/Archive/Functions/ImportSector.d.ts +2 -4
- package/World/Archive/Functions/ImportSector.js +50 -220
- package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
- package/World/Archive/Functions/RemoveDuplicates.js +92 -0
- package/World/Archive/Functions/Shared.d.ts +6 -0
- package/World/Archive/Functions/Shared.js +50 -0
- package/World/Archive/InitTasks.js +37 -23
- package/World/Cursor/SectionCursor.d.ts +3 -3
- package/World/Cursor/SectionCursor.js +2 -3
- package/World/Cursor/SectorCursor.d.ts +3 -3
- package/World/Cursor/SectorCursor.js +1 -2
- package/World/Cursor/WorldCursor.d.ts +6 -5
- package/World/Cursor/WorldCursor.js +17 -15
- package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
- package/World/Cursor/WorldVoxelCursor.js +24 -14
- package/World/Dimension/Dimension.d.ts +4 -1
- package/World/Dimension/Dimension.js +8 -1
- package/World/InitTasks.d.ts +1 -1
- package/World/Lock/WorldLock.d.ts +1 -1
- package/World/Section/Section.d.ts +27 -18
- package/World/Section/Section.js +125 -21
- package/World/Section/SectionState.d.ts +12 -0
- package/World/Section/SectionState.js +13 -0
- package/World/Sector/Sector.d.ts +20 -6
- package/World/Sector/Sector.js +100 -17
- package/World/Sector/SectorHeightMap.js +2 -2
- package/World/Sector/SectorState.d.ts +16 -7
- package/World/Sector/SectorState.js +29 -15
- package/World/Types/WorldData.types.d.ts +2 -7
- package/World/Types/WorldStorage.interface.js +1 -0
- package/World/WorldRegister.d.ts +13 -9
- package/World/WorldRegister.js +24 -9
- package/World/WorldSpaces.d.ts +4 -0
- package/World/WorldSpaces.js +25 -12
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +10 -3
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +19 -3
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
- package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
- package/WorldSimulation/Internal/Classes/TickQueue.js +58 -0
- package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
- package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +8 -8
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
- package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
- package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +38 -9
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
- package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
- package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
- package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
- package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
- package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -24
- package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
- package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
- package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
- package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +7 -5
- package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +6 -5
- package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +29 -23
- package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
- package/package.json +1 -1
- package/Mesher/Functions/CompactMesh.d.ts +0 -2
- package/Mesher/Functions/CompactMesh.js +0 -42
- package/Mesher/Geomtry/GeometryNormals.d.ts +0 -10
- package/Mesher/Geomtry/GeometryNormals.js +0 -52
- package/Mesher/Geomtry/MeshData.types.d.ts +0 -13
- package/Mesher/Geomtry/MeshData.types.js +0 -6
- package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +0 -7
- package/Mesher/Geomtry/Tools/MesherDataTools.js +0 -12
- package/Mesher/Geomtry/Tools/index.d.ts +0 -1
- package/Mesher/Geomtry/Tools/index.js +0 -1
- package/Mesher/RenderedMaterials.d.ts +0 -6
- package/Mesher/Tools/VoxelMeshBVHBuilder.js +0 -216
- package/Models/Rules/VoxelModelManager.js +0 -82
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
- package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
- package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -34
- package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
- package/Textures/TextureAnimations.d.ts +0 -4
- package/Textures/TextureAnimations.js +0 -35
- package/Textures/TextureArray.d.ts +0 -47
- package/Textures/TextureArray.js +0 -202
- package/Textures/TextureBuilder.d.ts +0 -13
- package/Textures/TextureBuilder.js +0 -120
- package/Textures/TextureRegister.d.ts +0 -9
- package/Textures/TextureRegister.js +0 -28
- package/Tools/DataCursor.interface.d.ts +0 -5
- package/Tools/DataCursor.interface.js +0 -2
- package/Util/Binary/BitArray.js +0 -16
- package/World/Structs/WorldDataStructProperties.d.ts +0 -8
- package/World/Structs/WorldDataStructProperties.js +0 -9
- /package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +0 -0
- /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
- /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
- /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
- /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
- /package/{World/Storage/WorldStorage.interface.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
- /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export class VoxelMeshBVHStructCursor {
|
|
2
|
+
data;
|
|
3
|
+
get minX() {
|
|
4
|
+
return this.data[this.trueIndex];
|
|
5
|
+
}
|
|
6
|
+
get minY() {
|
|
7
|
+
return this.data[this.trueIndex + 1];
|
|
8
|
+
}
|
|
9
|
+
get minZ() {
|
|
10
|
+
return this.data[this.trueIndex + 2];
|
|
11
|
+
}
|
|
12
|
+
get maxX() {
|
|
13
|
+
return this.data[this.trueIndex + 4];
|
|
14
|
+
}
|
|
15
|
+
get maxY() {
|
|
16
|
+
return this.data[this.trueIndex + 5];
|
|
17
|
+
}
|
|
18
|
+
get maxZ() {
|
|
19
|
+
return this.data[this.trueIndex + 6];
|
|
20
|
+
}
|
|
21
|
+
get voxelIndex() {
|
|
22
|
+
return this.data[this.trueIndex + 3];
|
|
23
|
+
}
|
|
24
|
+
get active() {
|
|
25
|
+
return this.data[this.trueIndex + 3];
|
|
26
|
+
}
|
|
27
|
+
get nodeType() {
|
|
28
|
+
return this.data[this.trueIndex + 7];
|
|
29
|
+
}
|
|
30
|
+
trueIndex = 0;
|
|
31
|
+
index = 0;
|
|
32
|
+
setIndex(index) {
|
|
33
|
+
this.trueIndex = index * 8;
|
|
34
|
+
}
|
|
35
|
+
constructor(data) {
|
|
36
|
+
this.data = data;
|
|
37
|
+
}
|
|
38
|
+
setActive() {
|
|
39
|
+
this.data[this.trueIndex + 3] = 1;
|
|
40
|
+
}
|
|
41
|
+
setVoxelIndex(value) {
|
|
42
|
+
this.data[this.trueIndex + 3] = value;
|
|
43
|
+
}
|
|
44
|
+
setInnerNode() {
|
|
45
|
+
this.data[this.trueIndex + 7] = 1;
|
|
46
|
+
}
|
|
47
|
+
setGeomtryNode() {
|
|
48
|
+
this.data[this.trueIndex + 7] = 2;
|
|
49
|
+
}
|
|
50
|
+
updateMin(x, y, z) {
|
|
51
|
+
const ix = this.trueIndex;
|
|
52
|
+
const iy = this.trueIndex + 1;
|
|
53
|
+
const iz = this.trueIndex + 2;
|
|
54
|
+
if (x < this.data[ix] || this.data[ix] == -Infinity) {
|
|
55
|
+
this.data[ix] = x;
|
|
56
|
+
}
|
|
57
|
+
if (y < this.data[iy] || this.data[iy] == -Infinity) {
|
|
58
|
+
this.data[iy] = y;
|
|
59
|
+
}
|
|
60
|
+
if (z < this.data[iz] || this.data[iz] == -Infinity) {
|
|
61
|
+
this.data[iz] = z;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
updateMax(x, y, z) {
|
|
65
|
+
const ix = this.trueIndex + 4;
|
|
66
|
+
const iy = this.trueIndex + 5;
|
|
67
|
+
const iz = this.trueIndex + 6;
|
|
68
|
+
if (x > this.data[ix] || this.data[ix] == -Infinity) {
|
|
69
|
+
this.data[ix] = x;
|
|
70
|
+
}
|
|
71
|
+
if (y > this.data[iy] || this.data[iy] == -Infinity) {
|
|
72
|
+
this.data[iy] = y;
|
|
73
|
+
}
|
|
74
|
+
if (z > this.data[iz] || this.data[iz] == -Infinity) {
|
|
75
|
+
this.data[iz] = z;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -3,7 +3,7 @@ export class VoxelVertexBuffer {
|
|
|
3
3
|
sectorVertexSize;
|
|
4
4
|
_buffers = [];
|
|
5
5
|
sectorSize = 0;
|
|
6
|
-
constructor(vertexFloatSize, sectorVertexSize, startingSectorSize =
|
|
6
|
+
constructor(vertexFloatSize, sectorVertexSize, startingSectorSize = 8) {
|
|
7
7
|
this.vertexFloatSize = vertexFloatSize;
|
|
8
8
|
this.sectorVertexSize = sectorVertexSize;
|
|
9
9
|
this.sectorSize = vertexFloatSize * sectorVertexSize;
|
|
@@ -28,7 +28,7 @@ export class VoxelVertexBuffer {
|
|
|
28
28
|
export class VoxelIndiceBuffer {
|
|
29
29
|
sectorSize;
|
|
30
30
|
_buffers = [];
|
|
31
|
-
constructor(sectorSize, startingSectorSize =
|
|
31
|
+
constructor(sectorSize, startingSectorSize = 8) {
|
|
32
32
|
this.sectorSize = sectorSize;
|
|
33
33
|
for (let i = 0; i < startingSectorSize; i++) {
|
|
34
34
|
this._buffers.push(new Uint32Array(sectorSize));
|
package/Mesher/Geomtry/index.js
CHANGED
package/Mesher/InitMesher.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderedMaterials } from "./RenderedMaterials";
|
|
1
|
+
import { RenderedMaterials } from "./Models/RenderedMaterials";
|
|
2
2
|
import { VoxelModelConstructorRegister } from "./Models/VoxelModelConstructorRegister.js";
|
|
3
3
|
import { LiquidGeometryNode } from "./Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js";
|
|
4
4
|
import { VoxelConstructor } from "./Models/VoxelConstructor.js";
|
package/Mesher/InitTask.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads";
|
|
2
2
|
import { WorldRegister } from "../World/WorldRegister";
|
|
3
|
-
import { WorldSpaces } from "../World/WorldSpaces";
|
|
4
3
|
import { MeshSection } from "./Functions/MeshSection";
|
|
5
4
|
import { TasksIds } from "../Tasks/TasksIds";
|
|
6
5
|
export default function (rendererThread) {
|
|
@@ -11,39 +10,26 @@ export default function (rendererThread) {
|
|
|
11
10
|
return;
|
|
12
11
|
rendererThread.runTask("set-section", section, transfers);
|
|
13
12
|
});
|
|
14
|
-
Threads.registerTask(TasksIds.BuildSector, (location) => {
|
|
15
|
-
const
|
|
16
|
-
const sector = WorldRegister.sectors.get(location[0], sectorPosition.x, sectorPosition.y, sectorPosition.z);
|
|
13
|
+
Threads.registerTask(TasksIds.BuildSector, (location, origin) => {
|
|
14
|
+
const sector = WorldRegister.sectors.getAt(location);
|
|
17
15
|
if (!sector) {
|
|
18
|
-
console.warn("Tried building a sector that does not exists.",
|
|
19
|
-
sectorPosition.x,
|
|
20
|
-
sectorPosition.y,
|
|
21
|
-
sectorPosition.z,
|
|
22
|
-
]);
|
|
16
|
+
console.warn("Tried building a sector that does not exists.", location);
|
|
23
17
|
return;
|
|
24
18
|
}
|
|
25
|
-
if (sector.sections.length == 0) {
|
|
26
|
-
console.warn("Tried building a sector with no sections.", sector.position);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const transfers = [];
|
|
30
19
|
for (let i = 0; i < sector.sections.length; i++) {
|
|
31
20
|
const section = sector.sections[i];
|
|
32
|
-
if (!section)
|
|
33
|
-
continue;
|
|
34
21
|
let [minY, maxY] = section.getMinMax();
|
|
35
22
|
if (Math.abs(minY) == Infinity && Math.abs(maxY) == Infinity)
|
|
36
23
|
continue;
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
sector.position[0],
|
|
41
|
-
sector.position[1] + i * WorldSpaces.section.bounds.y,
|
|
42
|
-
sector.position[2],
|
|
43
|
-
], transfers);
|
|
24
|
+
const t = performance.now();
|
|
25
|
+
const transfers = [];
|
|
26
|
+
const sectionMesh = MeshSection([location[0], ...section.getPosition()], transfers);
|
|
44
27
|
if (!sectionMesh)
|
|
45
28
|
continue;
|
|
46
29
|
rendererThread.runTask("set-section", sectionMesh, transfers);
|
|
30
|
+
const buildTime = performance.now() - t;
|
|
31
|
+
origin.runTask("add-build-time", buildTime);
|
|
32
|
+
console.log("BUILD TIME", buildTime);
|
|
47
33
|
}
|
|
48
34
|
});
|
|
49
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { VoxelFaces } from "../../../Math";
|
|
3
3
|
import { Quad } from "../../Geomtry/Primitives/Quad";
|
|
4
|
-
import {
|
|
4
|
+
import { getQuadWeights } from "./Calc/CalcConstants";
|
|
5
5
|
import { TransformBox } from "../../../Models/Shared/Transform";
|
|
6
6
|
import { GetBounds } from "./BoundsFunctions";
|
|
7
7
|
export function GetBoxGeometryNodeData(points, transform) {
|
|
@@ -66,12 +66,12 @@ export function GetBoxGeometryNodeData(points, transform) {
|
|
|
66
66
|
}
|
|
67
67
|
quadBounds[i] = GetBounds(positions);
|
|
68
68
|
}
|
|
69
|
-
vertexWeights[VoxelFaces.Up] =
|
|
70
|
-
vertexWeights[VoxelFaces.Down] =
|
|
71
|
-
vertexWeights[VoxelFaces.North] =
|
|
72
|
-
vertexWeights[VoxelFaces.South] =
|
|
73
|
-
vertexWeights[VoxelFaces.East] =
|
|
74
|
-
vertexWeights[VoxelFaces.West] =
|
|
69
|
+
vertexWeights[VoxelFaces.Up] = getQuadWeights(quads[VoxelFaces.Up], VoxelFaces.Up);
|
|
70
|
+
vertexWeights[VoxelFaces.Down] = getQuadWeights(quads[VoxelFaces.Down], VoxelFaces.Down);
|
|
71
|
+
vertexWeights[VoxelFaces.North] = getQuadWeights(quads[VoxelFaces.North], VoxelFaces.North);
|
|
72
|
+
vertexWeights[VoxelFaces.South] = getQuadWeights(quads[VoxelFaces.South], VoxelFaces.South);
|
|
73
|
+
vertexWeights[VoxelFaces.East] = getQuadWeights(quads[VoxelFaces.East], VoxelFaces.East);
|
|
74
|
+
vertexWeights[VoxelFaces.West] = getQuadWeights(quads[VoxelFaces.West], VoxelFaces.West);
|
|
75
75
|
return {
|
|
76
76
|
quads,
|
|
77
77
|
vertexWeights,
|
|
@@ -11,5 +11,5 @@ export declare function shouldCauseFlip(topRight: number, topLeft: number, botto
|
|
|
11
11
|
export declare function getVertexWeights(face: VoxelFaces, x: number, y: number, z: number): Vec4Array;
|
|
12
12
|
export declare function getInterpolationValue(value: Vec4Array, weights: Vec4Array): number;
|
|
13
13
|
export type QuadVertexWeights = [Vec4Array, Vec4Array, Vec4Array, Vec4Array];
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const getQuadWeights: (quad: Quad, direction: VoxelFaces) => QuadVertexWeights;
|
|
15
15
|
export declare function closestUnitNormal(v: Vec3Array): Vec3Array;
|
|
@@ -326,7 +326,7 @@ export function getInterpolationValue(value, weights) {
|
|
|
326
326
|
lightData.getB(value[2]) * weights[2] +
|
|
327
327
|
lightData.getB(value[3]) * weights[3]);
|
|
328
328
|
}
|
|
329
|
-
export const
|
|
329
|
+
export const getQuadWeights = (quad, direction) => {
|
|
330
330
|
const returnArray = [];
|
|
331
331
|
for (const vertex of QuadVerticiesArray) {
|
|
332
332
|
const { x, y, z } = quad.positions.vertices[vertex];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VoxelModelBuilder } from "../../VoxelModelBuilder.js";
|
|
2
2
|
import { VoxelFaces } from "../../../../Math/index.js";
|
|
3
|
-
export default function calculateFaceData(face: VoxelFaces, builder:
|
|
3
|
+
export default function calculateFaceData(face: VoxelFaces, builder: VoxelModelBuilder): void;
|
|
@@ -2,47 +2,54 @@ import { VoxelFaceDirections } from "../../../../Math/index.js";
|
|
|
2
2
|
import { GradientCheckSets } from "./CalcConstants.js";
|
|
3
3
|
import { VoxelLightData } from "../../../../Voxels/Cursor/VoxelLightData.js";
|
|
4
4
|
const lightData = new VoxelLightData();
|
|
5
|
-
const currentLightValues = new Uint16Array([0, 0, 0, 0]);
|
|
6
|
-
const loadedLightValues = new Uint16Array([0, 0, 0, 0]);
|
|
7
5
|
export default function calculateFaceData(face, builder) {
|
|
8
|
-
let light = builder.voxel.getLight();
|
|
9
|
-
const faceNormal = VoxelFaceDirections[face];
|
|
10
6
|
const x = builder.position.x;
|
|
11
7
|
const y = builder.position.y;
|
|
12
8
|
const z = builder.position.z;
|
|
13
9
|
const vertexData = builder.lightData[face];
|
|
14
10
|
const nVoxel = builder.nVoxel;
|
|
15
11
|
const checkSet = GradientCheckSets[face];
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
let startLight = 0;
|
|
13
|
+
if (builder.voxel.isLightSource()) {
|
|
14
|
+
startLight = builder.voxel.getLightSourceValue();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
startLight =
|
|
18
|
+
nVoxel
|
|
19
|
+
.getVoxel(x + VoxelFaceDirections[face][0], y + VoxelFaceDirections[face][1], z + VoxelFaceDirections[face][2])
|
|
20
|
+
?.getLight() || 0;
|
|
21
|
+
}
|
|
22
|
+
if (startLight < 0)
|
|
23
|
+
startLight = 0;
|
|
24
|
+
const startS = lightData.getS(startLight);
|
|
25
|
+
const startR = lightData.getR(startLight);
|
|
26
|
+
const startG = lightData.getG(startLight);
|
|
27
|
+
const startB = lightData.getB(startLight);
|
|
18
28
|
for (let vertex = 0; vertex < 4; vertex++) {
|
|
19
|
-
vertexData[vertex] =
|
|
20
|
-
|
|
29
|
+
vertexData[vertex] = startLight;
|
|
30
|
+
let s = startS;
|
|
31
|
+
let r = startR;
|
|
32
|
+
let g = startG;
|
|
33
|
+
let b = startB;
|
|
21
34
|
for (let i = 0; i < 9; i += 3) {
|
|
22
|
-
const nl =
|
|
35
|
+
const nl = nVoxel
|
|
36
|
+
.getVoxel(checkSet[vertex][i] + x, checkSet[vertex][i + 1] + y, checkSet[vertex][i + 2] + z)
|
|
37
|
+
?.getLight() || -1;
|
|
23
38
|
if (nl <= 0)
|
|
24
39
|
continue;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
lightData.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
currentLightValues[2] =
|
|
38
|
-
currentLightValues[2] < loadedLightValues[2]
|
|
39
|
-
? loadedLightValues[2]
|
|
40
|
-
: currentLightValues[2];
|
|
41
|
-
currentLightValues[3] =
|
|
42
|
-
currentLightValues[3] < loadedLightValues[3]
|
|
43
|
-
? loadedLightValues[3]
|
|
44
|
-
: currentLightValues[3];
|
|
40
|
+
let ns = lightData.getS(nl);
|
|
41
|
+
let nr = lightData.getR(nl);
|
|
42
|
+
let ng = lightData.getG(nl);
|
|
43
|
+
let nb = lightData.getB(nl);
|
|
44
|
+
if (s < ns)
|
|
45
|
+
s = ns;
|
|
46
|
+
if (r < nr)
|
|
47
|
+
r = nr;
|
|
48
|
+
if (g < ng)
|
|
49
|
+
g = ng;
|
|
50
|
+
if (b < nb)
|
|
51
|
+
b = nb;
|
|
45
52
|
}
|
|
46
|
-
vertexData[vertex] = lightData.
|
|
53
|
+
vertexData[vertex] = lightData.createLightValue(s, r, g, b);
|
|
47
54
|
}
|
|
48
55
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
2
|
import { VoxelFaces } from "../../../Math";
|
|
3
3
|
import { Quad } from "../../Geomtry/Primitives/Quad";
|
|
4
|
-
import {
|
|
4
|
+
import { getQuadWeights, closestUnitNormal, } from "./Calc/CalcConstants";
|
|
5
5
|
import { TransformQuad } from "../../../Models/Shared/Transform";
|
|
6
6
|
import { GetBounds } from "./BoundsFunctions";
|
|
7
7
|
export function GetQuadGeometryData(data, transform) {
|
|
@@ -40,7 +40,7 @@ export function GetQuadGeometryData(data, transform) {
|
|
|
40
40
|
closestFace = VoxelFaces.North;
|
|
41
41
|
if (unitNormal[2] == -1)
|
|
42
42
|
closestFace = VoxelFaces.South;
|
|
43
|
-
const vertexWeights =
|
|
43
|
+
const vertexWeights = getQuadWeights(quad, closestFace);
|
|
44
44
|
closestFace = closestFace;
|
|
45
45
|
return {
|
|
46
46
|
quad,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VoxelModelBuilder } from "../../../VoxelModelBuilder";
|
|
2
2
|
import { QuadScalarVertexData } from "../../../../Geomtry/Primitives/QuadVertexData";
|
|
3
3
|
import { CompassAngles } from "@amodx/math";
|
|
4
4
|
export declare enum FlowVerticies {
|
|
@@ -8,4 +8,4 @@ export declare enum FlowVerticies {
|
|
|
8
8
|
SouthEsat = 3
|
|
9
9
|
}
|
|
10
10
|
export declare function getFlowAngle(vertexLevel: QuadScalarVertexData): [angle: CompassAngles, flow: number];
|
|
11
|
-
export declare function getFlowGradient(tool:
|
|
11
|
+
export declare function getFlowGradient(tool: VoxelModelBuilder, flowStates: QuadScalarVertexData): QuadScalarVertexData;
|
|
@@ -66,7 +66,7 @@ const returnData = [
|
|
|
66
66
|
export function getFlowAngle(vertexLevel) {
|
|
67
67
|
if (vertexLevel.isAllEqualTo(7)) {
|
|
68
68
|
returnData[0] = 0;
|
|
69
|
-
returnData[1] = FlowStates.
|
|
69
|
+
returnData[1] = FlowStates.Up;
|
|
70
70
|
return returnData;
|
|
71
71
|
}
|
|
72
72
|
const upRight = vertexLevel.vertices[QuadVerticies.TopRight];
|
|
@@ -8,7 +8,7 @@ import { shouldCauseFlip } from "../../../Common/Calc/CalcConstants";
|
|
|
8
8
|
import { getFlowAngle, getFlowGradient, FlowVerticies } from "./FlowGradient";
|
|
9
9
|
import { GetBoxGeometryNodeData } from "../../../Common/BoxGeometryNode";
|
|
10
10
|
import { VoxelLightData } from "../../../../../Voxels/Cursor/VoxelLightData";
|
|
11
|
-
import {
|
|
11
|
+
import { addVoxelQuad } from "../../../../Geomtry/VoxelGeometryBuilder";
|
|
12
12
|
const vertexValue = new QuadScalarVertexData();
|
|
13
13
|
const vertexLevel = new QuadScalarVertexData();
|
|
14
14
|
const lightData = new VoxelLightData();
|
|
@@ -49,12 +49,13 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
determineShading(face) {
|
|
52
|
-
|
|
53
|
-
const lightData =
|
|
52
|
+
this.builder.calculateFaceData(face);
|
|
53
|
+
const lightData = this.builder.lightData[face];
|
|
54
54
|
const worldLight = this.builder.vars.light;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
worldLight.vertices[0] = lightData[0];
|
|
56
|
+
worldLight.vertices[1] = lightData[1];
|
|
57
|
+
worldLight.vertices[2] = lightData[2];
|
|
58
|
+
worldLight.vertices[3] = lightData[3];
|
|
58
59
|
}
|
|
59
60
|
shouldFlip() {
|
|
60
61
|
const worldLight = this.builder.vars.light;
|
|
@@ -72,7 +73,6 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
72
73
|
added = true;
|
|
73
74
|
getFlowGradient(tool, vertexLevel);
|
|
74
75
|
const quad = Quads[VoxelFaces.Up];
|
|
75
|
-
tool.calculateFaceData(VoxelFaces.Up);
|
|
76
76
|
this.determineShading(VoxelFaces.Up);
|
|
77
77
|
quad.flip = this.shouldFlip();
|
|
78
78
|
tool.vars.textureIndex = args.stillTexture;
|
|
@@ -92,26 +92,23 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
92
92
|
quad.positions.vertices[1].y = vertexValue.vertices[1] * waterHeight;
|
|
93
93
|
quad.positions.vertices[2].y = vertexValue.vertices[2] * waterHeight;
|
|
94
94
|
quad.positions.vertices[3].y = vertexValue.vertices[3] * waterHeight;
|
|
95
|
-
|
|
95
|
+
addVoxelQuad(tool, tool.origin, quad);
|
|
96
96
|
tool.updateBounds(quadBounds[VoxelFaces.Up]);
|
|
97
97
|
}
|
|
98
98
|
if (this.isExposed(VoxelFaces.Down)) {
|
|
99
99
|
added = true;
|
|
100
100
|
tool.vars.textureIndex = args.stillTexture;
|
|
101
101
|
const quad = Quads[VoxelFaces.Down];
|
|
102
|
-
tool.calculateFaceData(VoxelFaces.Down);
|
|
103
102
|
this.determineShading(VoxelFaces.Down);
|
|
104
103
|
quad.flip = this.shouldFlip();
|
|
105
|
-
tool.
|
|
106
|
-
VoxelGeometryBuilder.addQuad(tool, tool.origin, quad);
|
|
104
|
+
addVoxelQuad(tool, tool.origin, quad);
|
|
107
105
|
tool.updateBounds(quadBounds[VoxelFaces.Down]);
|
|
108
106
|
}
|
|
109
107
|
if (this.isExposed(VoxelFaces.North)) {
|
|
110
108
|
added = true;
|
|
111
|
-
tool.vars.textureIndex = args.
|
|
109
|
+
tool.vars.textureIndex = args.flowTexture;
|
|
112
110
|
const quad = Quads[VoxelFaces.North];
|
|
113
111
|
tool.vars.animation.setAll(1);
|
|
114
|
-
tool.calculateFaceData(VoxelFaces.North);
|
|
115
112
|
this.determineShading(VoxelFaces.North);
|
|
116
113
|
quad.flip = this.shouldFlip();
|
|
117
114
|
if (upFaceExposed) {
|
|
@@ -129,15 +126,14 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
129
126
|
quad.positions.vertices[QuadVerticies.TopLeft].y = 1;
|
|
130
127
|
quad.setUVs(uvs);
|
|
131
128
|
}
|
|
132
|
-
|
|
129
|
+
addVoxelQuad(tool, tool.origin, quad);
|
|
133
130
|
tool.updateBounds(quadBounds[VoxelFaces.North]);
|
|
134
131
|
}
|
|
135
132
|
if (this.isExposed(VoxelFaces.South)) {
|
|
136
133
|
added = true;
|
|
137
|
-
tool.vars.textureIndex = args.
|
|
134
|
+
tool.vars.textureIndex = args.flowTexture;
|
|
138
135
|
const quad = Quads[VoxelFaces.South];
|
|
139
136
|
tool.vars.animation.setAll(1);
|
|
140
|
-
tool.calculateFaceData(VoxelFaces.South);
|
|
141
137
|
this.determineShading(VoxelFaces.South);
|
|
142
138
|
quad.flip = this.shouldFlip();
|
|
143
139
|
if (upFaceExposed) {
|
|
@@ -155,17 +151,16 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
155
151
|
quad.positions.vertices[QuadVerticies.TopRight].y = 1;
|
|
156
152
|
quad.setUVs(uvs);
|
|
157
153
|
}
|
|
158
|
-
|
|
154
|
+
addVoxelQuad(tool, tool.origin, quad);
|
|
159
155
|
tool.updateBounds(quadBounds[VoxelFaces.South]);
|
|
160
156
|
}
|
|
161
157
|
if (this.isExposed(VoxelFaces.East)) {
|
|
162
158
|
added = true;
|
|
163
|
-
tool.vars.textureIndex = args.
|
|
159
|
+
tool.vars.textureIndex = args.flowTexture;
|
|
164
160
|
const quad = Quads[VoxelFaces.East];
|
|
165
161
|
tool.vars.animation.setAll(1);
|
|
166
|
-
tool.calculateFaceData(VoxelFaces.East);
|
|
167
162
|
this.determineShading(VoxelFaces.East);
|
|
168
|
-
|
|
163
|
+
quad.flip = this.shouldFlip();
|
|
169
164
|
if (upFaceExposed) {
|
|
170
165
|
quad.positions.vertices[QuadVerticies.TopRight].y =
|
|
171
166
|
vertexValue.vertices[FlowVerticies.NorthEast] * waterHeight;
|
|
@@ -181,15 +176,14 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
181
176
|
quad.positions.vertices[QuadVerticies.TopRight].y = 1;
|
|
182
177
|
quad.setUVs(uvs);
|
|
183
178
|
}
|
|
184
|
-
|
|
179
|
+
addVoxelQuad(tool, tool.origin, quad);
|
|
185
180
|
tool.updateBounds(quadBounds[VoxelFaces.East]);
|
|
186
181
|
}
|
|
187
182
|
if (this.isExposed(VoxelFaces.West)) {
|
|
188
183
|
added = true;
|
|
189
|
-
tool.vars.textureIndex = args.
|
|
184
|
+
tool.vars.textureIndex = args.flowTexture;
|
|
190
185
|
const quad = Quads[VoxelFaces.West];
|
|
191
186
|
tool.vars.animation.setAll(1);
|
|
192
|
-
tool.calculateFaceData(VoxelFaces.West);
|
|
193
187
|
this.determineShading(VoxelFaces.West);
|
|
194
188
|
quad.flip = this.shouldFlip();
|
|
195
189
|
if (upFaceExposed) {
|
|
@@ -207,7 +201,7 @@ export class LiquidGeometryNode extends GeoemtryNode {
|
|
|
207
201
|
quad.positions.vertices[QuadVerticies.TopRight].y = 1;
|
|
208
202
|
quad.setUVs(uvs);
|
|
209
203
|
}
|
|
210
|
-
|
|
204
|
+
addVoxelQuad(tool, tool.origin, quad);
|
|
211
205
|
tool.updateBounds(quadBounds[VoxelFaces.West]);
|
|
212
206
|
}
|
|
213
207
|
this.builder.vars.light.setAll(0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VoxelModelBuilder } from "../VoxelModelBuilder";
|
|
2
2
|
import { VoxelGeometryConstructor } from "./VoxelGeometryConstructor";
|
|
3
3
|
import { VoxelGeometryTransform } from "../../../Voxels/Types/VoxelModelCompiledData.types";
|
|
4
4
|
export interface GeoemtryNodeConstructor<Data = any, Args = any> {
|
|
@@ -13,7 +13,7 @@ export declare abstract class GeoemtryNode<Data = any, Args = any> {
|
|
|
13
13
|
vertexIndex: number;
|
|
14
14
|
faceCount: number;
|
|
15
15
|
vertexCount: number;
|
|
16
|
-
builder:
|
|
16
|
+
builder: VoxelModelBuilder;
|
|
17
17
|
constructor(geometryPaletteId: number, geomtry: VoxelGeometryConstructor, data: Data, transform: VoxelGeometryTransform);
|
|
18
18
|
abstract init(): void;
|
|
19
19
|
abstract add(args: Args): boolean;
|