@divinevoxel/vlox 0.0.73 → 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 +1 -0
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -0
- package/Init/StartConstructor.js +2 -0
- package/Math/index.d.ts +5 -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 +15 -22
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
- package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +1 -1
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +118 -197
- package/Mesher/Geomtry/VoxelMesh.js +2 -2
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +8 -70
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +18 -183
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
- package/Mesher/Geomtry/VoxelMeshBuffers.js +2 -2
- package/Mesher/InitTask.js +5 -1
- 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/QuadGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +7 -7
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +22 -25
- 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/Models/VoxelConstructor.d.ts +3 -3
- package/Mesher/Models/VoxelConstructor.js +8 -8
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -9
- package/Mesher/Models/VoxelModelBuilder.js +1 -8
- package/Mesher/Types/Mesher.types.d.ts +1 -0
- package/Models/Defaults/CubeVoxelModels.js +16 -39
- package/Models/Defaults/LiquidVoxelModel.js +3 -3
- package/Models/Defaults/PanelVoxelModels.js +10 -36
- package/Models/Defaults/StairVoxelModel.js +6 -21
- package/Models/Examples.js +23 -44
- 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 +13 -13
- package/Models/Rules/VoxelModelRuleBuilderRegister.js +8 -8
- package/Models/VoxelModel.types.d.ts +3 -3
- package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
- package/Renderer/InitTasks.js +1 -9
- package/Renderer/MeshManager.d.ts +1 -1
- package/Renderer/MeshManager.js +24 -23
- package/Renderer/MeshRegister.d.ts +5 -5
- package/Renderer/MeshRegister.js +2 -2
- package/Settings/EngineSettings.d.ts +1 -0
- package/Settings/EngineSettings.js +6 -3
- package/Settings/EngineSettings.types.d.ts +7 -21
- package/Settings/EngineSettings.types.js +6 -14
- 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 +5 -147
- package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +15 -7
- package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +20 -7
- package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
- package/Tasks/WorldGeneration/WorldGenBrush.js +2 -2
- package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
- package/Templates/Functions/CreateTemplate.d.ts +1 -1
- package/Tools/Brush/AdvancedBrushTool.js +1 -1
- package/Tools/Brush/Brush.d.ts +2 -2
- package/Tools/Brush/Brush.js +1 -1
- package/Tools/Tasks/TasksTool.d.ts +1 -0
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Util/Binary/BinaryBuffer.d.ts +17 -11
- package/Util/Binary/BinaryBuffer.js +65 -59
- package/Util/Binary/BinaryTree.d.ts +46 -0
- package/Util/Binary/BinaryTree.js +104 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +7 -2
- package/Voxels/Cursor/VoxelCursor.interface.js +46 -2
- package/Voxels/Cursor/VoxelLightData.js +1 -1
- package/Voxels/Data/VoxelTag.types.d.ts +17 -2
- package/Voxels/Data/VoxelTag.types.js +6 -1
- package/Voxels/Data/VoxelTagsRegister.js +5 -0
- package/Voxels/Functions/BuildStateData.d.ts +6 -6
- package/Voxels/Functions/BuildStateData.js +31 -31
- package/Voxels/Functions/BuildTagAndPaletteData.js +5 -0
- package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
- package/Voxels/Indexes/VoxelIndex.js +16 -18
- package/Voxels/InitVoxelData.js +12 -8
- 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/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 +3 -0
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
- package/World/Archive/Archive.types.d.ts +31 -12
- 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 +39 -36
- package/World/Archive/Functions/ArchiveSector.js +210 -404
- package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
- package/World/Archive/Functions/CreateArchivedSection.js +207 -0
- package/World/Archive/Functions/ImportSector.d.ts +1 -3
- package/World/Archive/Functions/ImportSector.js +13 -244
- package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
- package/World/Archive/Functions/RemoveDuplicates.js +92 -0
- package/World/Archive/Functions/Shared.d.ts +2 -2
- package/World/Archive/Functions/Shared.js +15 -40
- package/World/Archive/InitTasks.js +7 -10
- package/World/Cursor/SectionCursor.d.ts +1 -1
- package/World/Cursor/SectorCursor.d.ts +1 -1
- package/World/Cursor/WorldCursor.d.ts +4 -3
- package/World/Cursor/WorldCursor.js +16 -13
- package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
- package/World/Cursor/WorldVoxelCursor.js +23 -14
- package/World/Dimension/Dimension.d.ts +4 -1
- package/World/Dimension/Dimension.js +8 -1
- package/World/Section/Section.d.ts +17 -4
- package/World/Section/Section.js +68 -6
- package/World/Section/SectionState.d.ts +4 -2
- package/World/Section/SectionState.js +4 -2
- package/World/Sector/Sector.d.ts +7 -1
- package/World/Sector/Sector.js +37 -4
- package/World/Sector/SectorState.d.ts +3 -2
- package/World/Sector/SectorState.js +3 -2
- package/World/Types/WorldData.types.d.ts +2 -7
- package/World/WorldRegister.d.ts +9 -9
- package/World/WorldRegister.js +9 -6
- package/World/WorldSpaces.js +6 -6
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +6 -4
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +9 -5
- 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/{Tasks/IWG/Internal/Classes/BuildQueue.js → WorldSimulation/Internal/Classes/TickQueue.js} +16 -7
- package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
- package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +6 -6
- 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} +29 -19
- 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 -14
- 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 +5 -5
- package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +5 -5
- package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +21 -21
- package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
- package/package.json +1 -1
- package/Tasks/IWG/Internal/Classes/BuildQueue.d.ts +0 -11
- 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 -30
- package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
- /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,41 @@
|
|
|
1
|
+
import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
|
|
2
|
+
import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
|
|
3
|
+
export const updateLightTask = (tasks) => {
|
|
4
|
+
let doRGB = ES.doRGBPropagation;
|
|
5
|
+
let doSun = ES.doSunPropagation;
|
|
6
|
+
const [dimension, x, y, z] = tasks.origin;
|
|
7
|
+
tasks.nDataCursor.setFocalPoint(dimension, x, y, z);
|
|
8
|
+
for (const n of $3dCardinalNeighbors) {
|
|
9
|
+
const nx = n[0] + x;
|
|
10
|
+
const ny = n[1] + y;
|
|
11
|
+
const nz = n[2] + z;
|
|
12
|
+
const nVoxel = tasks.nDataCursor.getVoxel(nx, ny, nz);
|
|
13
|
+
if (!nVoxel)
|
|
14
|
+
continue;
|
|
15
|
+
if (doRGB) {
|
|
16
|
+
if (nVoxel.hasRGBLight()) {
|
|
17
|
+
tasks.rgb.update.push(nx, ny, nz);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (doSun) {
|
|
21
|
+
if (nVoxel.hasSunLight()) {
|
|
22
|
+
tasks.sun.update.push(nx, ny, nz);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const updatePowerTask = (tasks) => {
|
|
28
|
+
const [dimension, x, y, z] = tasks.origin;
|
|
29
|
+
tasks.nDataCursor.setFocalPoint(dimension, x, y, z);
|
|
30
|
+
for (const n of $3dCardinalNeighbors) {
|
|
31
|
+
const nx = n[0] + x;
|
|
32
|
+
const ny = n[1] + y;
|
|
33
|
+
const nz = n[2] + z;
|
|
34
|
+
const nVoxel = tasks.nDataCursor.getVoxel(nx, ny, nz);
|
|
35
|
+
if (!nVoxel)
|
|
36
|
+
continue;
|
|
37
|
+
if (nVoxel.getPower() > 0) {
|
|
38
|
+
tasks.power.update.push(nx, ny, nz);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
|
|
2
|
+
import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
|
|
3
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
|
|
4
|
+
import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
|
|
5
|
+
import { SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
|
|
6
|
+
import { FlowRemove } from "../Propagation/Flow/FlowRemove.js";
|
|
7
|
+
import { updateLightTask } from "./Common.js";
|
|
8
|
+
import { PowerRemove, PowerUpdate } from "../Propagation/Power/PowerUpdate.js";
|
|
9
|
+
const tasks = new VoxelUpdateTask();
|
|
10
|
+
export async function EreaseAndUpdate(location) {
|
|
11
|
+
const [dimension, x, y, z] = location;
|
|
12
|
+
tasks.setOrigin(location);
|
|
13
|
+
let voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
14
|
+
if (!voxel)
|
|
15
|
+
return false;
|
|
16
|
+
const substanceData = voxel.getSubstanceData();
|
|
17
|
+
const foundPower = voxel.getPower();
|
|
18
|
+
if (!voxel.isAir() && ES.doFlow && voxel.isRenderable()) {
|
|
19
|
+
if (substanceData["dve_is_liquid"]) {
|
|
20
|
+
FlowRemove(tasks);
|
|
21
|
+
return tasks;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
25
|
+
const light = voxel.getLight();
|
|
26
|
+
const isLightSource = voxel.isLightSource();
|
|
27
|
+
voxel.setSecondary(true).setId(0).setSecondary(false);
|
|
28
|
+
voxel
|
|
29
|
+
.setLight(light > 0 ? light : 0)
|
|
30
|
+
.setId(0)
|
|
31
|
+
.setLevel(0)
|
|
32
|
+
.setLevelState(0)
|
|
33
|
+
.setState(0)
|
|
34
|
+
.setMod(0)
|
|
35
|
+
.updateVoxel(1);
|
|
36
|
+
if (ES.doLight) {
|
|
37
|
+
if (ES.doRGBPropagation && isLightSource) {
|
|
38
|
+
tasks.rgb.remove.push(x, y, z);
|
|
39
|
+
RGBRemove(tasks);
|
|
40
|
+
}
|
|
41
|
+
updateLightTask(tasks);
|
|
42
|
+
if (ES.doRGBPropagation) {
|
|
43
|
+
RGBUpdate(tasks);
|
|
44
|
+
}
|
|
45
|
+
if (ES.doSunPropagation) {
|
|
46
|
+
SunUpdate(tasks);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
50
|
+
if (ES.doPower) {
|
|
51
|
+
if (foundPower > -1) {
|
|
52
|
+
voxel.setLevel(foundPower);
|
|
53
|
+
tasks.power.remove.push(x, y, z);
|
|
54
|
+
PowerRemove(tasks);
|
|
55
|
+
PowerUpdate(tasks);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
tasks.bounds.update(x, y, z);
|
|
59
|
+
tasks.bounds.update(x + 1, y + 1, z + 1);
|
|
60
|
+
for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
|
|
61
|
+
tasks.sDataCursor
|
|
62
|
+
.getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
|
|
63
|
+
?.updateVoxel(2);
|
|
64
|
+
}
|
|
65
|
+
return tasks;
|
|
66
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Thread } from "@amodx/threads";
|
|
2
|
-
import {
|
|
2
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask";
|
|
3
3
|
export default function (props: {
|
|
4
|
-
onDone(taks:
|
|
4
|
+
onDone(taks: VoxelUpdateTask, origin: Thread): void;
|
|
5
5
|
}): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads";
|
|
2
2
|
import { TasksIds } from "../TasksIds";
|
|
3
|
-
import { VoxelUpdate
|
|
3
|
+
import { VoxelUpdate } from "./VoxelUpdate";
|
|
4
|
+
import { EreaseAndUpdate } from "./EreaseUpdate";
|
|
5
|
+
import { PaintAndUpdate } from "./PaintUpdate";
|
|
4
6
|
export default function (props) {
|
|
5
7
|
Threads.registerTask(TasksIds.VoxelUpdate, async (data, origin) => {
|
|
6
8
|
const tasks = await VoxelUpdate(data);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
|
|
2
|
+
import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
|
|
3
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
|
|
4
|
+
import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
|
|
5
|
+
import { SunRemove, SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
|
|
6
|
+
import { FlowUpdate } from "../Propagation/Flow/FlowUpdate.js";
|
|
7
|
+
import { updateLightTask, updatePowerTask } from "./Common.js";
|
|
8
|
+
import { PowerUpdate } from "../../Tasks/Propagation/Power/PowerUpdate.js";
|
|
9
|
+
const tasks = new VoxelUpdateTask();
|
|
10
|
+
export async function PaintAndUpdate(data) {
|
|
11
|
+
const [dimension, x, y, z] = data[0];
|
|
12
|
+
tasks.setOrigin(data[0]);
|
|
13
|
+
let voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
14
|
+
if (!voxel)
|
|
15
|
+
return false;
|
|
16
|
+
const raw = data[1];
|
|
17
|
+
const isOpaque = voxel.isOpaque();
|
|
18
|
+
let doRGB = ES.doRGBPropagation;
|
|
19
|
+
let doSun = ES.doSunPropagation;
|
|
20
|
+
lighttest: if (ES.doLight) {
|
|
21
|
+
const light = voxel.getLight();
|
|
22
|
+
if (light <= 0)
|
|
23
|
+
break lighttest;
|
|
24
|
+
if (doSun) {
|
|
25
|
+
if (voxel.hasSunLight()) {
|
|
26
|
+
tasks.sun.remove.push(x, y, z);
|
|
27
|
+
SunRemove(tasks);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (doRGB) {
|
|
31
|
+
if (voxel.hasRGBLight() && isOpaque) {
|
|
32
|
+
tasks.rgb.remove.push(x, y, z);
|
|
33
|
+
RGBRemove(tasks);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
38
|
+
const id = raw[0];
|
|
39
|
+
if (id < 0)
|
|
40
|
+
return false;
|
|
41
|
+
voxel.setId(id);
|
|
42
|
+
voxel.setLevel(raw[2]);
|
|
43
|
+
voxel.setState(raw[3]);
|
|
44
|
+
voxel.setMod(raw[4]);
|
|
45
|
+
voxel.process();
|
|
46
|
+
if (raw[3] > 0 && voxel.canHaveSecondaryVoxel()) {
|
|
47
|
+
voxel.setSecondary(true);
|
|
48
|
+
voxel.setId(raw[5]);
|
|
49
|
+
voxel.setSecondary(false);
|
|
50
|
+
}
|
|
51
|
+
if (voxel.isLightSource() && voxel.getLightSourceValue()) {
|
|
52
|
+
voxel.setLight(voxel.getLightSourceValue());
|
|
53
|
+
}
|
|
54
|
+
voxel.updateVoxel(0);
|
|
55
|
+
if (ES.doLight) {
|
|
56
|
+
updateLightTask(tasks);
|
|
57
|
+
if (doRGB) {
|
|
58
|
+
tasks.rgb.update.push(x, y, z);
|
|
59
|
+
RGBUpdate(tasks);
|
|
60
|
+
}
|
|
61
|
+
if (doSun) {
|
|
62
|
+
SunUpdate(tasks);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
66
|
+
if (ES.doFlow) {
|
|
67
|
+
if (!voxel.isAir() && voxel.getSubstanceData()["dve_is_liquid"]) {
|
|
68
|
+
FlowUpdate(tasks);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (ES.doPower) {
|
|
72
|
+
if (voxel._tags["dve_can_be_powered"] ||
|
|
73
|
+
voxel._tags["dve_is_power_source"] ||
|
|
74
|
+
voxel._tags["dve_can_carry_power"] ||
|
|
75
|
+
voxel._tags["dve_can_hold_power"]) {
|
|
76
|
+
updatePowerTask(tasks);
|
|
77
|
+
tasks.power.update.push(x, y, z);
|
|
78
|
+
PowerUpdate(tasks);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
tasks.bounds.update(x, y, z);
|
|
82
|
+
tasks.bounds.update(x + 1, y + 1, z + 1);
|
|
83
|
+
for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
|
|
84
|
+
tasks.sDataCursor
|
|
85
|
+
.getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
|
|
86
|
+
?.updateVoxel(2);
|
|
87
|
+
}
|
|
88
|
+
return tasks;
|
|
89
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { VoxelUpdateTasks } from "../Tasks.types.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare function EreaseAndUpdate(location: LocationData): Promise<false | UpdateTask>;
|
|
5
|
-
export declare function PaintAndUpdate(data: VoxelUpdateTasks): Promise<false | UpdateTask>;
|
|
6
|
-
export declare function VoxelUpdate(data: VoxelUpdateTasks): Promise<false | UpdateTask>;
|
|
2
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
|
|
3
|
+
export declare function VoxelUpdate(data: VoxelUpdateTasks): Promise<false | VoxelUpdateTask>;
|
|
@@ -1,152 +1,10 @@
|
|
|
1
1
|
import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SunRemove, SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
|
|
2
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
|
|
3
|
+
import { RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
|
|
4
|
+
import { SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
|
|
6
5
|
import { FlowUpdate } from "../Propagation/Flow/FlowUpdate.js";
|
|
7
|
-
import {
|
|
8
|
-
const tasks = new
|
|
9
|
-
const updateLightTask = (tasks) => {
|
|
10
|
-
let doRGB = ES.doRGBPropagation;
|
|
11
|
-
let doSun = ES.doSunPropagation;
|
|
12
|
-
const [dimension, x, y, z] = tasks.origin;
|
|
13
|
-
tasks.nDataCursor.setFocalPoint(dimension, x, y, z);
|
|
14
|
-
for (const n of $3dCardinalNeighbors) {
|
|
15
|
-
const nx = n[0] + x;
|
|
16
|
-
const ny = n[1] + y;
|
|
17
|
-
const nz = n[2] + z;
|
|
18
|
-
const nVoxel = tasks.nDataCursor.getVoxel(nx, ny, nz);
|
|
19
|
-
if (!nVoxel)
|
|
20
|
-
continue;
|
|
21
|
-
if (doRGB) {
|
|
22
|
-
if (nVoxel.hasRGBLight()) {
|
|
23
|
-
tasks.rgb.update.push(nx, ny, nz);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (doSun) {
|
|
27
|
-
if (nVoxel.hasSunLight()) {
|
|
28
|
-
tasks.sun.update.push(nx, ny, nz);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
export async function EreaseAndUpdate(location) {
|
|
34
|
-
const [dimension, x, y, z] = location;
|
|
35
|
-
tasks.setOrigin(location);
|
|
36
|
-
let voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
37
|
-
if (!voxel)
|
|
38
|
-
return false;
|
|
39
|
-
const substanceData = voxel.getSubstanceData();
|
|
40
|
-
if (!voxel.isAir() && ES.doFlow && voxel.isRenderable()) {
|
|
41
|
-
if (substanceData["dve_is_liquid"]) {
|
|
42
|
-
FlowRemove(tasks);
|
|
43
|
-
return tasks;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
47
|
-
const light = voxel.getLight();
|
|
48
|
-
const isLightSource = voxel.isLightSource();
|
|
49
|
-
voxel.setSecondary(true).setId(0).setSecondary(false);
|
|
50
|
-
voxel
|
|
51
|
-
.setLight(light > 0 ? light : 0)
|
|
52
|
-
.setId(0)
|
|
53
|
-
.setLevel(0)
|
|
54
|
-
.setLevelState(0)
|
|
55
|
-
.setState(0)
|
|
56
|
-
.setMod(0)
|
|
57
|
-
.updateVoxel(1);
|
|
58
|
-
if (ES.doLight) {
|
|
59
|
-
if (ES.doRGBPropagation && isLightSource) {
|
|
60
|
-
tasks.rgb.remove.push(x, y, z);
|
|
61
|
-
RGBRemove(tasks);
|
|
62
|
-
}
|
|
63
|
-
updateLightTask(tasks);
|
|
64
|
-
if (ES.doRGBPropagation) {
|
|
65
|
-
RGBUpdate(tasks);
|
|
66
|
-
}
|
|
67
|
-
if (ES.doSunPropagation) {
|
|
68
|
-
SunUpdate(tasks);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
tasks.bounds.update(x, y, z);
|
|
72
|
-
tasks.bounds.update(x + 1, y + 1, z + 1);
|
|
73
|
-
for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
|
|
74
|
-
tasks.sDataCursor
|
|
75
|
-
.getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
|
|
76
|
-
?.updateVoxel(2);
|
|
77
|
-
}
|
|
78
|
-
return tasks;
|
|
79
|
-
}
|
|
80
|
-
export async function PaintAndUpdate(data) {
|
|
81
|
-
const [dimension, x, y, z] = data[0];
|
|
82
|
-
tasks.setOrigin(data[0]);
|
|
83
|
-
let voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
84
|
-
if (!voxel)
|
|
85
|
-
return false;
|
|
86
|
-
const raw = data[1];
|
|
87
|
-
const isOpaque = voxel.isOpaque();
|
|
88
|
-
let doRGB = ES.doRGBPropagation;
|
|
89
|
-
let doSun = ES.doSunPropagation;
|
|
90
|
-
lighttest: if (ES.doLight) {
|
|
91
|
-
const light = voxel.getLight();
|
|
92
|
-
if (light <= 0)
|
|
93
|
-
break lighttest;
|
|
94
|
-
if (doSun) {
|
|
95
|
-
if (voxel.hasSunLight()) {
|
|
96
|
-
tasks.sun.remove.push(x, y, z);
|
|
97
|
-
SunRemove(tasks);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (doRGB) {
|
|
101
|
-
if (voxel.hasRGBLight() && isOpaque) {
|
|
102
|
-
tasks.rgb.remove.push(x, y, z);
|
|
103
|
-
RGBRemove(tasks);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
108
|
-
const id = raw[0];
|
|
109
|
-
if (id < 0)
|
|
110
|
-
return false;
|
|
111
|
-
voxel.setId(id);
|
|
112
|
-
voxel.setLevel(raw[2]);
|
|
113
|
-
voxel.setState(raw[3]);
|
|
114
|
-
voxel.setMod(raw[4]);
|
|
115
|
-
voxel.process();
|
|
116
|
-
if (raw[3] > 0 && voxel.canHaveSecondaryVoxel()) {
|
|
117
|
-
voxel.setSecondary(true);
|
|
118
|
-
voxel.setId(raw[5]);
|
|
119
|
-
voxel.setSecondary(false);
|
|
120
|
-
}
|
|
121
|
-
if (voxel.isLightSource() && voxel.getLightSourceValue()) {
|
|
122
|
-
voxel.setLight(voxel.getLightSourceValue());
|
|
123
|
-
}
|
|
124
|
-
voxel.updateVoxel(0);
|
|
125
|
-
if (ES.doLight) {
|
|
126
|
-
updateLightTask(tasks);
|
|
127
|
-
if (doRGB) {
|
|
128
|
-
tasks.rgb.update.push(x, y, z);
|
|
129
|
-
RGBUpdate(tasks);
|
|
130
|
-
}
|
|
131
|
-
if (doSun) {
|
|
132
|
-
SunUpdate(tasks);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
voxel = tasks.sDataCursor.getVoxel(x, y, z);
|
|
136
|
-
if (ES.doFlow) {
|
|
137
|
-
if (!voxel.isAir() && voxel.getSubstanceData()["dve_is_liquid"]) {
|
|
138
|
-
FlowUpdate(tasks);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
tasks.bounds.update(x, y, z);
|
|
142
|
-
tasks.bounds.update(x + 1, y + 1, z + 1);
|
|
143
|
-
for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
|
|
144
|
-
tasks.sDataCursor
|
|
145
|
-
.getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
|
|
146
|
-
?.updateVoxel(2);
|
|
147
|
-
}
|
|
148
|
-
return tasks;
|
|
149
|
-
}
|
|
6
|
+
import { updateLightTask } from "./Common.js";
|
|
7
|
+
const tasks = new VoxelUpdateTask();
|
|
150
8
|
export async function VoxelUpdate(data) {
|
|
151
9
|
const [dimension, x, y, z] = data[0];
|
|
152
10
|
tasks.setOrigin(data[0]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WorldCursor } from "
|
|
1
|
+
import { WorldCursor } from "../World/Cursor/WorldCursor";
|
|
2
2
|
import { Vec3Array, Vector3Like } from "@amodx/math";
|
|
3
|
-
import { LocationData } from "
|
|
3
|
+
import { LocationData } from "../Math";
|
|
4
4
|
export declare class TaskMap {
|
|
5
5
|
_map: boolean[];
|
|
6
6
|
get size(): number;
|
|
@@ -12,20 +12,21 @@ export declare class TaskMap {
|
|
|
12
12
|
clear(): void;
|
|
13
13
|
}
|
|
14
14
|
declare class UpdatedBounds {
|
|
15
|
-
_task:
|
|
15
|
+
_task: VoxelUpdateTask;
|
|
16
16
|
min: Vector3Like;
|
|
17
17
|
max: Vector3Like;
|
|
18
|
-
dimension:
|
|
19
|
-
constructor(_task:
|
|
20
|
-
start(dimension?:
|
|
18
|
+
dimension: number;
|
|
19
|
+
constructor(_task: VoxelUpdateTask);
|
|
20
|
+
start(dimension?: number): void;
|
|
21
21
|
update(x: number, y: number, z: number): void;
|
|
22
22
|
getSections(): Vec3Array[];
|
|
23
23
|
markSectionsAsDirty(): void;
|
|
24
24
|
}
|
|
25
|
-
export declare class
|
|
25
|
+
export declare class VoxelUpdateTask {
|
|
26
26
|
flow: FlowQueues;
|
|
27
27
|
rgb: LightQueue;
|
|
28
28
|
sun: LightQueue;
|
|
29
|
+
power: PowerQueue;
|
|
29
30
|
bounds: UpdatedBounds;
|
|
30
31
|
sDataCursor: WorldCursor;
|
|
31
32
|
nDataCursor: WorldCursor;
|
|
@@ -52,4 +53,11 @@ declare class LightQueue {
|
|
|
52
53
|
updateMap: TaskMap;
|
|
53
54
|
clear(): void;
|
|
54
55
|
}
|
|
56
|
+
declare class PowerQueue {
|
|
57
|
+
update: number[];
|
|
58
|
+
remove: number[];
|
|
59
|
+
removeMap: TaskMap;
|
|
60
|
+
updateMap: TaskMap;
|
|
61
|
+
clear(): void;
|
|
62
|
+
}
|
|
55
63
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WorldCursor } from "
|
|
1
|
+
import { WorldCursor } from "../World/Cursor/WorldCursor";
|
|
2
2
|
import { Vector3Like } from "@amodx/math";
|
|
3
|
-
import { WorldSpaces } from "
|
|
4
|
-
import { WorldRegister } from "
|
|
3
|
+
import { WorldSpaces } from "../World/WorldSpaces";
|
|
4
|
+
import { WorldRegister } from "../World/WorldRegister";
|
|
5
5
|
export class TaskMap {
|
|
6
6
|
_map = [];
|
|
7
7
|
get size() {
|
|
@@ -35,12 +35,12 @@ class UpdatedBounds {
|
|
|
35
35
|
_task;
|
|
36
36
|
min = Vector3Like.Clone(InfinityVec3);
|
|
37
37
|
max = Vector3Like.Clone(NegativeInfinityVec3);
|
|
38
|
-
dimension =
|
|
38
|
+
dimension = 0;
|
|
39
39
|
constructor(_task) {
|
|
40
40
|
this._task = _task;
|
|
41
41
|
}
|
|
42
42
|
start(dimension) {
|
|
43
|
-
this.dimension = dimension ||
|
|
43
|
+
this.dimension = dimension || 0;
|
|
44
44
|
Vector3Like.Copy(this.min, InfinityVec3);
|
|
45
45
|
Vector3Like.Copy(this.max, NegativeInfinityVec3);
|
|
46
46
|
}
|
|
@@ -97,16 +97,17 @@ class UpdatedBounds {
|
|
|
97
97
|
if (!sector)
|
|
98
98
|
continue;
|
|
99
99
|
const section = sector.getSection(x, y, z);
|
|
100
|
-
section.
|
|
100
|
+
section.setDisplayDirty(true);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
export class
|
|
106
|
+
export class VoxelUpdateTask {
|
|
107
107
|
flow = new FlowQueues();
|
|
108
108
|
rgb = new LightQueue();
|
|
109
109
|
sun = new LightQueue();
|
|
110
|
+
power = new PowerQueue();
|
|
110
111
|
bounds = new UpdatedBounds(this);
|
|
111
112
|
sDataCursor = new WorldCursor();
|
|
112
113
|
nDataCursor = new WorldCursor();
|
|
@@ -161,3 +162,15 @@ class LightQueue {
|
|
|
161
162
|
this.updateMap.clear();
|
|
162
163
|
}
|
|
163
164
|
}
|
|
165
|
+
class PowerQueue {
|
|
166
|
+
update = [];
|
|
167
|
+
remove = [];
|
|
168
|
+
removeMap = new TaskMap();
|
|
169
|
+
updateMap = new TaskMap();
|
|
170
|
+
clear() {
|
|
171
|
+
this.update.length = 0;
|
|
172
|
+
this.remove.length = 0;
|
|
173
|
+
this.removeMap.clear();
|
|
174
|
+
this.updateMap.clear();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { BrushTool } from "../../Tools/Brush/Brush.js";
|
|
3
|
-
import {
|
|
3
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
|
|
4
4
|
export declare class WorldGenBrush extends BrushTool {
|
|
5
5
|
constructor();
|
|
6
6
|
requestsId: "";
|
|
7
|
-
tasks:
|
|
8
|
-
start(dimension:
|
|
7
|
+
tasks: VoxelUpdateTask;
|
|
8
|
+
start(dimension: number, x: number, y: number, z: number): this;
|
|
9
9
|
paint(): this;
|
|
10
10
|
getUpdatedSections(): Vec3Array[];
|
|
11
11
|
update(): false | undefined;
|
|
@@ -3,7 +3,7 @@ import { BrushTool } from "../../Tools/Brush/Brush.js";
|
|
|
3
3
|
import { VoxelLightData } from "../../Voxels/Cursor/VoxelLightData.js";
|
|
4
4
|
import { WorldGeneration } from "./WorldGeneration.js";
|
|
5
5
|
import { DivineVoxelEngineConstructor } from "../../Contexts/Constructor/DivineVoxelEngineConstructor.js";
|
|
6
|
-
import {
|
|
6
|
+
import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
|
|
7
7
|
import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
|
|
8
8
|
import { SunRemove, SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
|
|
9
9
|
const lightData = new VoxelLightData();
|
|
@@ -13,7 +13,7 @@ export class WorldGenBrush extends BrushTool {
|
|
|
13
13
|
WorldGeneration._brushes.push(this);
|
|
14
14
|
}
|
|
15
15
|
requestsId;
|
|
16
|
-
tasks = new
|
|
16
|
+
tasks = new VoxelUpdateTask();
|
|
17
17
|
start(dimension, x, y, z) {
|
|
18
18
|
this.dataCursor.setFocalPoint(dimension, x, y, z);
|
|
19
19
|
this.tasks.setOrigin([dimension, x, y, z]);
|
|
@@ -4,7 +4,7 @@ export declare class WorldGenRegister {
|
|
|
4
4
|
static MAX_ATTEMPTS: number;
|
|
5
5
|
static _requests: Map<string, {
|
|
6
6
|
attempts: number;
|
|
7
|
-
dimension:
|
|
7
|
+
dimension: number;
|
|
8
8
|
sections: Map<string, [x: number, y: number, z: number]>;
|
|
9
9
|
voxels: [x: number, y: number, z: number, data: RawVoxelData][];
|
|
10
10
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { VoxelTemplate } from "../VoxelTemplate";
|
|
3
|
-
export default function CreateTemplate(dimension:
|
|
3
|
+
export default function CreateTemplate(dimension: number, start: Vec3Array, end: Vec3Array): VoxelTemplate;
|
package/Tools/Brush/Brush.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { WorldCursor } from "../../World/Cursor/WorldCursor.js";
|
|
|
3
3
|
import { VoxelCursor } from "../../Voxels/Cursor/VoxelCursor.js";
|
|
4
4
|
export declare class BrushTool {
|
|
5
5
|
data: PaintVoxelData;
|
|
6
|
-
dimension:
|
|
6
|
+
dimension: number;
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
9
|
z: number;
|
|
@@ -29,6 +29,6 @@ export declare class BrushTool {
|
|
|
29
29
|
_erase(): void;
|
|
30
30
|
paint(): this;
|
|
31
31
|
erase(): this;
|
|
32
|
-
start(dimension:
|
|
32
|
+
start(dimension: number, x: number, y: number, z: number): this;
|
|
33
33
|
stop(): this;
|
|
34
34
|
}
|
package/Tools/Brush/Brush.js
CHANGED
package/Tools/Tasks/TasksTool.js
CHANGED
|
@@ -62,11 +62,13 @@ class VoxelTasks {
|
|
|
62
62
|
update;
|
|
63
63
|
paint;
|
|
64
64
|
erease;
|
|
65
|
+
logic;
|
|
65
66
|
constructor(tool) {
|
|
66
67
|
this.tool = tool;
|
|
67
68
|
this.update = new TaskToolTask(TasksIds.VoxelUpdate, tool.threads);
|
|
68
69
|
this.paint = new TaskToolTask(TasksIds.VoxelPaint, tool.threads);
|
|
69
70
|
this.erease = new TaskToolTask(TasksIds.VoxelErease, tool.threads);
|
|
71
|
+
this.logic = new TaskToolTask(TasksIds.LogicUpdate, tool.threads);
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
class BuildTask {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare enum BinaryBufferTypes {
|
|
2
|
+
Value = 0,
|
|
3
|
+
BitArray = 1,
|
|
4
|
+
HalfNibbleArray = 2,
|
|
5
|
+
NibbleArray = 4,
|
|
6
|
+
ByteArray = 8,
|
|
7
|
+
ShortArray = 16
|
|
8
|
+
}
|
|
4
9
|
export interface BinaryBufferData {
|
|
5
|
-
type
|
|
6
|
-
buffer: number |
|
|
10
|
+
type: BinaryBufferTypes;
|
|
11
|
+
buffer: number | ArrayBufferLike;
|
|
7
12
|
}
|
|
8
13
|
export interface BinaryBuffer extends BinaryBufferData {
|
|
9
14
|
}
|
|
10
15
|
export declare class BinaryBuffer {
|
|
11
|
-
static
|
|
12
|
-
static
|
|
13
|
-
static
|
|
14
|
-
static
|
|
16
|
+
static ByteArrayMax: number;
|
|
17
|
+
static NibbleArrayMax: number;
|
|
18
|
+
static HalfNibbleArrayMax: number;
|
|
19
|
+
static BitArrayMax: number;
|
|
15
20
|
static DetermineSubByteArray: (paletteSize: number) => BinaryBufferTypes | null;
|
|
16
21
|
static CreateBufferForType(type: BinaryBufferTypes, length: number): Uint16Array | Uint8Array;
|
|
17
22
|
static GetConvertedBufferSize(source: Uint8Array | Uint16Array, type: BinaryBufferTypes): number;
|
|
@@ -20,10 +25,11 @@ export declare class BinaryBuffer {
|
|
|
20
25
|
static SetBufferAtIndex(source: Uint8Array | Uint16Array, type: BinaryBufferTypes, index: number, value: number): number | void;
|
|
21
26
|
static Convert(source: Uint8Array | Uint16Array, sourceType: BinaryBufferTypes, destinationType: BinaryBufferTypes): Uint16Array | Uint8Array;
|
|
22
27
|
static Create(data: Partial<BinaryBufferData>): BinaryBufferData;
|
|
28
|
+
bufferView: Uint8Array | Uint16Array;
|
|
23
29
|
constructor(data: BinaryBufferData);
|
|
24
30
|
getValue(index: number): number;
|
|
25
31
|
toJSON(): {
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
buffer: number | ArrayBufferLike;
|
|
33
|
+
type: BinaryBufferTypes;
|
|
28
34
|
};
|
|
29
35
|
}
|