@divinevoxel/vlox 0.0.1 → 0.0.2
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/Constructor/DivineVoxelEngineConstructor.d.ts +4 -4
- package/Contexts/Constructor/DivineVoxelEngineConstructor.js +5 -5
- package/Contexts/Constructor/Tasks/ConstructorTasks.d.ts +2 -0
- package/Contexts/Constructor/{ConstructorTasks.js → Tasks/ConstructorTasks.js} +6 -6
- package/Contexts/Constructor/Tasks/TasksRequest.js +1 -1
- package/Contexts/Constructor/{ConstrcutorTheads.d.ts → Threads/ConstrcutorTheads.d.ts} +1 -1
- package/Contexts/Constructor/{ConstrcutorTheads.js → Threads/ConstrcutorTheads.js} +2 -2
- package/Contexts/Constructor/{ConstructorThreadState.d.ts → Threads/ConstructorThreadState.d.ts} +1 -1
- package/Contexts/Constructor/{ConstructorThreadState.js → Threads/ConstructorThreadState.js} +1 -1
- package/Contexts/Nexus/DivineVoxelEngineNexus.d.ts +1 -1
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +2 -2
- package/Contexts/Render/DivineVoxelEngineRender.js +2 -2
- package/Contexts/RichWorld/{DivineStarVoxelEngineRichWorld.d.ts → DivineVoxelEngineRichWorld.d.ts} +1 -1
- package/Contexts/RichWorld/InitWorker.d.ts +1 -1
- package/Contexts/RichWorld/RichWorldTasks.d.ts +1 -1
- package/Contexts/RichWorld/Threads/RichWorldThreads.js +1 -1
- package/Contexts/RichWorld/Tools/RichColumnDataTool.js +1 -1
- package/Contexts/RichWorld/Tools/RichDataTool.js +1 -1
- package/Contexts/RichWorld/index.d.ts +1 -1
- package/Contexts/RichWorld/index.js +1 -1
- package/Contexts/World/Data/DataSync.js +9 -3
- package/Contexts/World/{WorldDataHooks.js → Data/WorldDataHooks.js} +3 -3
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +2 -2
- package/Contexts/World/DivineVoxelEngineWorld.js +2 -2
- package/Contexts/World/InitWorker.js +1 -1
- package/Contexts/World/{WorldThreadState.d.ts → Threads/WorldThreadState.d.ts} +1 -1
- package/Contexts/World/{WorldThreadState.js → Threads/WorldThreadState.js} +1 -1
- package/Contexts/World/{WorldThreads.d.ts → Threads/WorldThreads.d.ts} +2 -2
- package/Contexts/World/{WorldThreads.js → Threads/WorldThreads.js} +4 -2
- package/Data/DVEDataCore.d.ts +6 -0
- package/Data/DVEDataCore.js +6 -0
- package/Data/{DVEFDataManager.d.ts → DVEDataManager.d.ts} +3 -3
- package/Data/{DVEFDataManager.js → DVEDataManager.js} +3 -3
- package/Data/{DVEFDataSyncNode.d.ts → DVEDataSyncNode.d.ts} +1 -1
- package/Data/{DVEFDataSyncNode.js → DVEDataSyncNode.js} +1 -1
- package/DataLoader/World/DataHandlerWrapper.js +1 -1
- package/Mesher/Calc/CalcConstants.js +1 -1
- package/README.md +3 -5
- package/Tools/Tasks/TasksTool.js +3 -3
- package/VoxelModels/Shared/Transform.js +0 -3
- package/WorldGeneration/WorldGenRegister.js +1 -1
- package/WorldGeneration/WorldGeneration.js +1 -1
- package/package.json +31 -28
- package/Contexts/Constructor/ConstructorTasks.d.ts +0 -2
- package/Contexts/World/Data/DVEFDataStructs.d.ts +0 -7
- package/Contexts/World/Data/DVEFDataStructs.js +0 -21
- package/Data/DVEFDataCore.d.ts +0 -7
- package/Data/DVEFDataCore.js +0 -7
- package/Interfaces/Data/DVEDataCore.d.ts +0 -6
- package/Interfaces/Data/DVEDataCore.js +0 -2
- /package/Contexts/Constructor/{ConstructorRemoteThreadTasks.d.ts → Tasks/ConstructorRemoteThreadTasks.d.ts} +0 -0
- /package/Contexts/Constructor/{ConstructorRemoteThreadTasks.js → Tasks/ConstructorRemoteThreadTasks.js} +0 -0
- /package/Contexts/Constructor/{ConstructorTasksIds.d.ts → Tasks/ConstructorTasksIds.d.ts} +0 -0
- /package/Contexts/Constructor/{ConstructorTasksIds.js → Tasks/ConstructorTasksIds.js} +0 -0
- /package/Contexts/Constructor/{DVEConstructorTasksQueues.d.ts → Tasks/DVEConstructorTasksQueues.d.ts} +0 -0
- /package/Contexts/Constructor/{DVEConstructorTasksQueues.js → Tasks/DVEConstructorTasksQueues.js} +0 -0
- /package/Contexts/RichWorld/{DivineStarVoxelEngineRichWorld.js → DivineVoxelEngineRichWorld.js} +0 -0
- /package/Contexts/World/{WorldDataHooks.d.ts → Data/WorldDataHooks.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads/";
|
|
2
|
-
import {
|
|
3
|
-
import { ConstructorThreadManager } from "./ConstrcutorTheads.js";
|
|
4
|
-
import { DVEMesher, DVEMesherInitData } from "Mesher/Mesher.js";
|
|
2
|
+
import { DVEDataCore } from "../../Data/DVEDataCore.js";
|
|
3
|
+
import { ConstructorThreadManager } from "./Threads/ConstrcutorTheads.js";
|
|
4
|
+
import { DVEMesher, DVEMesherInitData } from "../../Mesher/Mesher.js";
|
|
5
5
|
export type DivineVoxelEngineConstructorInitData = {
|
|
6
6
|
mesherData: DVEMesherInitData;
|
|
7
7
|
};
|
|
@@ -10,7 +10,7 @@ export declare class DivineVoxelEngineConstructor {
|
|
|
10
10
|
static instance: DivineVoxelEngineConstructor;
|
|
11
11
|
TC: typeof Threads;
|
|
12
12
|
threads: ConstructorThreadManager;
|
|
13
|
-
data:
|
|
13
|
+
data: DVEDataCore;
|
|
14
14
|
mesher: DVEMesher;
|
|
15
15
|
constructor(data: DivineVoxelEngineConstructorInitData);
|
|
16
16
|
init(): Promise<void>;
|
|
@@ -3,16 +3,16 @@ import { Threads } from "@amodx/threads/";
|
|
|
3
3
|
//functions
|
|
4
4
|
import InitWorker from "./InitWorker.js";
|
|
5
5
|
import { Environment } from "@amodx/core/Environment/Environment.js";
|
|
6
|
-
import {
|
|
7
|
-
import ConstructorTasks from "./ConstructorTasks";
|
|
8
|
-
import { ConstructorThreadManager } from "./ConstrcutorTheads.js";
|
|
9
|
-
import { DVEMesher } from "Mesher/Mesher.js";
|
|
6
|
+
import { DVEDataCore } from "../../Data/DVEDataCore.js";
|
|
7
|
+
import ConstructorTasks from "./Tasks/ConstructorTasks.js";
|
|
8
|
+
import { ConstructorThreadManager } from "./Threads/ConstrcutorTheads.js";
|
|
9
|
+
import { DVEMesher } from "../../Mesher/Mesher.js";
|
|
10
10
|
export class DivineVoxelEngineConstructor {
|
|
11
11
|
static environment = "browser";
|
|
12
12
|
static instance;
|
|
13
13
|
TC = Threads;
|
|
14
14
|
threads = new ConstructorThreadManager();
|
|
15
|
-
data = new
|
|
15
|
+
data = new DVEDataCore();
|
|
16
16
|
mesher;
|
|
17
17
|
constructor(data) {
|
|
18
18
|
if (DivineVoxelEngineConstructor.instance)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ConstructorTasksIds } from "./ConstructorTasksIds.js";
|
|
2
2
|
import { Threads } from "@amodx/threads/";
|
|
3
|
-
import { WorldRegister } from "
|
|
4
|
-
import { WorldSpaces } from "
|
|
5
|
-
import { EreaseAndUpdate, PaintAndUpdate, VoxelUpdate, } from "
|
|
6
|
-
import { TasksRequest } from "
|
|
7
|
-
import { Propagation } from "
|
|
8
|
-
import { Analyzer } from "
|
|
3
|
+
import { WorldRegister } from "../../../Data/World/WorldRegister.js";
|
|
4
|
+
import { WorldSpaces } from "../../../Data/World/WorldSpaces.js";
|
|
5
|
+
import { EreaseAndUpdate, PaintAndUpdate, VoxelUpdate, } from "../Tasks/VoxelUpdate.js";
|
|
6
|
+
import { TasksRequest } from "../Tasks/TasksRequest.js";
|
|
7
|
+
import { Propagation } from "../../../Propagation";
|
|
8
|
+
import { Analyzer } from "../../../Analyzer/Analyzer";
|
|
9
9
|
export default function (DVEC) {
|
|
10
10
|
Threads.registerTasks("clear-all", () => {
|
|
11
11
|
WorldRegister.instance.clearAll();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConstructorRemoteThreadTasks } from "
|
|
1
|
+
import { ConstructorRemoteThreadTasks } from "./ConstructorRemoteThreadTasks";
|
|
2
2
|
import { EngineSettings } from "../../../Data/Settings/EngineSettings.js";
|
|
3
3
|
import { Threads } from "@amodx/threads/";
|
|
4
4
|
import { $3dMooreNeighborhood } from "../../../Math/Constants/CardinalNeighbors.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConstructorThreadState } from "./ConstructorThreadState";
|
|
2
|
-
import { ThreadManager } from "Interfaces/Classes/ThreadManager";
|
|
2
|
+
import { ThreadManager } from "../../../Interfaces/Classes/ThreadManager";
|
|
3
3
|
export declare class ConstructorThreadManager extends ThreadManager {
|
|
4
4
|
static instnace: ConstructorThreadManager;
|
|
5
5
|
state: ConstructorThreadState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads/";
|
|
2
2
|
import { ConstructorThreadState } from "./ConstructorThreadState";
|
|
3
|
-
import { EngineSettings } from "
|
|
4
|
-
import { ThreadManager } from "Interfaces/Classes/ThreadManager";
|
|
3
|
+
import { EngineSettings } from "../../../Data/Settings/EngineSettings";
|
|
4
|
+
import { ThreadManager } from "../../../Interfaces/Classes/ThreadManager";
|
|
5
5
|
const world = Threads.createThread("world");
|
|
6
6
|
export class ConstructorThreadManager extends ThreadManager {
|
|
7
7
|
static instnace;
|
package/Contexts/Constructor/{ConstructorThreadState.js → Threads/ConstructorThreadState.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Environment } from "@amodx/core/Environment/Environment.js";
|
|
2
2
|
import { ConstructorThreadManager } from "./ConstrcutorTheads";
|
|
3
|
-
import { ThreadState } from "
|
|
3
|
+
import { ThreadState } from "../../../Interfaces/Classes/ThreadState";
|
|
4
4
|
export class ConstructorThreadState extends ThreadState {
|
|
5
5
|
environment = Environment.nodeJS.isNode ? "node" : "brwoser";
|
|
6
6
|
isReady() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads/";
|
|
2
2
|
import { DataTool } from "../../Tools/Data/DataTool.js";
|
|
3
|
-
import { DVEDataCore } from "../../Interfaces/Data/DVEDataCore.js";
|
|
4
3
|
import { RichDataTool } from "../../Tools/Data/RichDataTool.js";
|
|
5
4
|
import { NexusThreads } from "./Threads/NexusTheads.js";
|
|
5
|
+
import { DVEDataCore } from "../../Data/DVEDataCore.js";
|
|
6
6
|
export type DivineVoxelEngineNexusInitData = {
|
|
7
7
|
data: DVEDataCore;
|
|
8
8
|
};
|
|
@@ -4,7 +4,7 @@ import type { EngineSettingsData } from "../../Types/EngineSettings.types.js";
|
|
|
4
4
|
import type { RecursivePartial } from "../../Types/Util.types";
|
|
5
5
|
import { DVERenderer } from "../../Interfaces/Render/DVERenderer.js";
|
|
6
6
|
import { MeshManager } from "./Scene/MeshManager.js";
|
|
7
|
-
import {
|
|
7
|
+
import { DVEDataCore } from "../../Data/DVEDataCore.js";
|
|
8
8
|
import { DVERenderThreads } from "./DVERenderThreads.js";
|
|
9
9
|
type PartialEngineSettings = RecursivePartial<EngineSettingsData>;
|
|
10
10
|
export interface DVERInitData extends PartialEngineSettings {
|
|
@@ -58,7 +58,7 @@ export declare class DivineVoxelEngineRender {
|
|
|
58
58
|
removeColumnsOutsideRadius: void;
|
|
59
59
|
};
|
|
60
60
|
threads: DVERenderThreads;
|
|
61
|
-
data:
|
|
61
|
+
data: DVEDataCore;
|
|
62
62
|
constructor();
|
|
63
63
|
init(props: DVERInitData): Promise<void>;
|
|
64
64
|
/**# clearAll
|
|
@@ -6,7 +6,7 @@ import { Threads } from "@amodx/threads/";
|
|
|
6
6
|
import InitThreads from "./InitThreads.js";
|
|
7
7
|
import { MeshManager } from "./Scene/MeshManager.js";
|
|
8
8
|
import { MeshRegister } from "./Scene/MeshRegister.js";
|
|
9
|
-
import {
|
|
9
|
+
import { DVEDataCore } from "../../Data/DVEDataCore.js";
|
|
10
10
|
import { DVERenderThreads } from "./DVERenderThreads.js";
|
|
11
11
|
export class DivineVoxelEngineRender {
|
|
12
12
|
static instance;
|
|
@@ -18,7 +18,7 @@ export class DivineVoxelEngineRender {
|
|
|
18
18
|
renderer;
|
|
19
19
|
tasks = RenderTasks;
|
|
20
20
|
threads = new DVERenderThreads();
|
|
21
|
-
data = new
|
|
21
|
+
data = new DVEDataCore();
|
|
22
22
|
constructor() {
|
|
23
23
|
if (DivineVoxelEngineRender.instance)
|
|
24
24
|
return DivineVoxelEngineRender.instance;
|
package/Contexts/RichWorld/{DivineStarVoxelEngineRichWorld.d.ts → DivineVoxelEngineRichWorld.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RichWorldThreads } from "./Threads/RichWorldThreads.js";
|
|
2
2
|
import { Threads } from "@amodx/threads/";
|
|
3
3
|
import { DataTool } from "../../Tools/Data/DataTool.js";
|
|
4
|
-
import { DVEDataCore } from "../../Interfaces/Data/DVEDataCore.js";
|
|
5
4
|
import { RichDataRegister } from "./RichDataRegister.js";
|
|
6
5
|
import { RichDataTool } from "./Tools/RichDataTool.js";
|
|
6
|
+
import { DVEDataCore } from "../../Data/DVEDataCore.js";
|
|
7
7
|
export type DivineVoxelEngineRichWorldInitData = {
|
|
8
8
|
data: DVEDataCore;
|
|
9
9
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DivineVoxelEngineRichWorld } from "./
|
|
1
|
+
import type { DivineVoxelEngineRichWorld } from "./DivineVoxelEngineRichWorld";
|
|
2
2
|
export default function (DVERW: DivineVoxelEngineRichWorld): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DivineVoxelEngineRichWorld } from "./
|
|
1
|
+
import { DivineVoxelEngineRichWorld } from "./DivineVoxelEngineRichWorld.js";
|
|
2
2
|
export default function (DVERW: DivineVoxelEngineRichWorld): void;
|
|
@@ -3,7 +3,7 @@ import { Threads } from "@amodx/threads/";
|
|
|
3
3
|
import { RichWorldThreadState } from "./RichWorldThreadState.js";
|
|
4
4
|
import { DataHooks } from "../../../Data/DataHooks.js";
|
|
5
5
|
import { ThreadManager } from "../../../Interfaces/Classes/ThreadManager.js";
|
|
6
|
-
import { DivineVoxelEngineRichWorld } from "../
|
|
6
|
+
import { DivineVoxelEngineRichWorld } from "../DivineVoxelEngineRichWorld.js";
|
|
7
7
|
export class RichWorldThreads extends ThreadManager {
|
|
8
8
|
state = new RichWorldThreadState(this);
|
|
9
9
|
parent = Threads.parent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BinaryObject } from "@amodx/binary/";
|
|
2
2
|
import { RichDataSegmentTool } from "../../../Tools/Classes/RichDataToolBase.js";
|
|
3
|
-
import { DivineVoxelEngineRichWorld as DVERW } from "../
|
|
3
|
+
import { DivineVoxelEngineRichWorld as DVERW } from "../DivineVoxelEngineRichWorld.js";
|
|
4
4
|
export class RichColumnDataTool extends RichDataSegmentTool {
|
|
5
5
|
column;
|
|
6
6
|
loadIn() {
|
|
@@ -2,7 +2,7 @@ import { BinaryObject } from "@amodx/binary/";
|
|
|
2
2
|
import { RichColumnDataTool } from "./RichColumnDataTool.js";
|
|
3
3
|
import { ColumnDataTool } from "../../../Tools/Data/WorldData/ColumnDataTool.js";
|
|
4
4
|
import { RichDataSegmentTool } from "../../../Tools/Classes/RichDataToolBase.js";
|
|
5
|
-
import { DivineVoxelEngineRichWorld as DVERW } from "../
|
|
5
|
+
import { DivineVoxelEngineRichWorld as DVERW } from "../DivineVoxelEngineRichWorld.js";
|
|
6
6
|
export class RichDataTool extends RichDataSegmentTool {
|
|
7
7
|
data;
|
|
8
8
|
richColumn = new RichColumnDataTool();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./DivineVoxelEngineRichWorld.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./DivineVoxelEngineRichWorld.js";
|
|
@@ -10,9 +10,9 @@ import { Pipeline, AsyncPipeline } from "@amodx/core/Pipelines/";
|
|
|
10
10
|
import { DataSyncIds } from "../../../Interfaces/Common/DataSyncIds.js";
|
|
11
11
|
//objects
|
|
12
12
|
import { WorldRegister } from "../../../Data/World/WorldRegister.js";
|
|
13
|
-
import { ChunkStatStruct } from "./Structs/ChunkStruct.js";
|
|
14
|
-
import { ColumnStateStruct, } from "./Structs/ColumnStruct.js";
|
|
15
|
-
import { RegionStateStruct, RegionHeaderTagManager, } from "./Structs/RegionStruct.js";
|
|
13
|
+
import { ChunkStatStruct, InitalizeChunkTags } from "./Structs/ChunkStruct.js";
|
|
14
|
+
import { ColumnStateStruct, InitalizeColumnTags, } from "./Structs/ColumnStruct.js";
|
|
15
|
+
import { InitalizeRegionTags, RegionStateStruct, RegionHeaderTagManager, } from "./Structs/RegionStruct.js";
|
|
16
16
|
import { RegionHeaderRegister } from "../../../Data/RegionHeaderRegister.js";
|
|
17
17
|
import { DimensionsRegister } from "../../../Data/World/DimensionsRegister.js";
|
|
18
18
|
import { DVEFDataSyncIds } from "../../../Data/Constants/DVEFDataSyncIds.js";
|
|
@@ -45,6 +45,12 @@ export class DataSync {
|
|
|
45
45
|
SubstanceTagBuilder.sync();
|
|
46
46
|
VoxelDataGenerator.generate();
|
|
47
47
|
VoxelTagBuilder.sync();
|
|
48
|
+
InitalizeChunkTags();
|
|
49
|
+
InitalizeColumnTags();
|
|
50
|
+
InitalizeRegionTags();
|
|
51
|
+
this.worldDataTags.chunk.sync();
|
|
52
|
+
this.worldDataTags.column.sync();
|
|
53
|
+
this.worldDataTags.region.sync();
|
|
48
54
|
this.palettes.voxel.sync();
|
|
49
55
|
this.palettes.substance.sync();
|
|
50
56
|
this.tags.voxel.sync();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DivineVoxelEngineWorld } from "
|
|
2
|
-
import { DataHooks } from "
|
|
3
|
-
import { WorldDataGenerator } from "./
|
|
1
|
+
import { DivineVoxelEngineWorld } from "..";
|
|
2
|
+
import { DataHooks } from "../../../Data/DataHooks";
|
|
3
|
+
import { WorldDataGenerator } from "./Generators/WorldDataGenerator.js";
|
|
4
4
|
//import type { DataLoaderTool } from "Tools/Loader/DataLoaderTool.js";
|
|
5
5
|
export default function () {
|
|
6
6
|
/* const DVEW = DivineVoxelEngineWorld.instance;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EngineSettings } from "../../Data/Settings/EngineSettings.js";
|
|
2
2
|
import { Threads } from "@amodx/threads/";
|
|
3
|
-
import { WorldThreadManager } from "./WorldThreads.js";
|
|
4
|
-
import { DVEConstructorTasksQueues } from "../Constructor/DVEConstructorTasksQueues";
|
|
3
|
+
import { WorldThreadManager } from "./Threads/WorldThreads.js";
|
|
4
|
+
import { DVEConstructorTasksQueues } from "../Constructor/Tasks/DVEConstructorTasksQueues.js";
|
|
5
5
|
import { WorldTasks } from "./Tasks/WorldTasks";
|
|
6
6
|
import { LocationData } from "../../Math";
|
|
7
7
|
import { DataSync } from "./Data/DataSync.js";
|
|
@@ -4,8 +4,8 @@ import { Environment } from "@amodx/core/Environment/Environment.js";
|
|
|
4
4
|
//functions
|
|
5
5
|
import InitWorldWorker from "./InitWorker.js";
|
|
6
6
|
import { Threads } from "@amodx/threads/";
|
|
7
|
-
import { WorldThreadManager } from "./WorldThreads.js";
|
|
8
|
-
import { DVEConstructorTasksQueues } from "../Constructor/DVEConstructorTasksQueues";
|
|
7
|
+
import { WorldThreadManager } from "./Threads/WorldThreads.js";
|
|
8
|
+
import { DVEConstructorTasksQueues } from "../Constructor/Tasks/DVEConstructorTasksQueues.js";
|
|
9
9
|
import InitWorldTasks, { WorldTasks } from "./Tasks/WorldTasks";
|
|
10
10
|
import { Distance3D } from "@amodx/math";
|
|
11
11
|
import { WorldRegister } from "../../Data/World/WorldRegister";
|
|
@@ -3,7 +3,7 @@ import { Threads } from "@amodx/threads/";
|
|
|
3
3
|
import { CreatePromiseCheck } from "@amodx/core/Intervals/CreatePromiseCheck.js";
|
|
4
4
|
import { WorldLock } from "./Lock/WorldLock";
|
|
5
5
|
import { DataLoaderTool } from "../../DataLoader/World/Tools/DataLoaderTool";
|
|
6
|
-
import RegisterDataHooks from "./WorldDataHooks";
|
|
6
|
+
import RegisterDataHooks from "./Data/WorldDataHooks.js";
|
|
7
7
|
export default function (DVEW) {
|
|
8
8
|
return new Promise(async (resolve) => {
|
|
9
9
|
let parent = "render";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThreadState } from "
|
|
1
|
+
import { ThreadState } from "../../../Interfaces/Classes/ThreadState";
|
|
2
2
|
export class WorldThreadState extends ThreadState {
|
|
3
3
|
isReady() {
|
|
4
4
|
return this.settingsSynced && this.threads.comms.every((_) => _.isReady());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ThreadPool } from "@amodx/threads/";
|
|
2
2
|
import { WorldThreadState } from "./WorldThreadState.js";
|
|
3
|
-
import { ThreadManager } from "
|
|
4
|
-
import { DVEWorldProps } from "
|
|
3
|
+
import { ThreadManager } from "../../../Interfaces/Classes/ThreadManager.js";
|
|
4
|
+
import { DVEWorldProps } from "../index.js";
|
|
5
5
|
export declare class WorldThreadManager extends ThreadManager {
|
|
6
6
|
props: DVEWorldProps;
|
|
7
7
|
constructors: ThreadPool;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads/";
|
|
2
|
-
import { EngineSettings } from "
|
|
3
|
-
import {
|
|
2
|
+
import { EngineSettings } from "../../../Data/Settings/EngineSettings.js";
|
|
3
|
+
import { WorldThreadState } from "./WorldThreadState.js";
|
|
4
|
+
import { ThreadManager } from "../../../Interfaces/Classes/ThreadManager.js";
|
|
4
5
|
export class WorldThreadManager extends ThreadManager {
|
|
5
6
|
props;
|
|
6
7
|
constructors = Threads.createThreadPool({
|
|
@@ -15,6 +16,7 @@ export class WorldThreadManager extends ThreadManager {
|
|
|
15
16
|
constructor(props = {}) {
|
|
16
17
|
super();
|
|
17
18
|
this.props = props;
|
|
19
|
+
this.state = new WorldThreadState(this);
|
|
18
20
|
this.addThread(this.constructors);
|
|
19
21
|
this.addThread(this.parent);
|
|
20
22
|
Threads.registerTasks("sync-settings", (settings) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DimensionsRegister } from "./World/DimensionsRegister.js";
|
|
2
2
|
import { WorldPainter } from "./World/WorldPainter.js";
|
|
3
3
|
import { WorldRegister } from "./World/WorldRegister.js";
|
|
4
|
-
import {
|
|
4
|
+
import { DVEDataSyncNode } from "./DVEDataSyncNode.js";
|
|
5
5
|
import { DataManager } from "../Interfaces/Data/DataManager.js";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class DVEDataManager extends DataManager {
|
|
7
7
|
world: WorldPainter;
|
|
8
|
-
dataSync:
|
|
8
|
+
dataSync: DVEDataSyncNode;
|
|
9
9
|
registers: {
|
|
10
10
|
dimensions: typeof DimensionsRegister;
|
|
11
11
|
world: WorldRegister;
|
|
@@ -5,11 +5,11 @@ import { RegionHeaderRegister } from "./RegionHeaderRegister.js";
|
|
|
5
5
|
import { Chunk } from "./World/Classes/Chunk.js";
|
|
6
6
|
import { Column } from "./World/Classes/Column.js";
|
|
7
7
|
import { Region } from "./World/Classes/Region.js";
|
|
8
|
-
import {
|
|
8
|
+
import { DVEDataSyncNode } from "./DVEDataSyncNode.js";
|
|
9
9
|
import { DataManager } from "../Interfaces/Data/DataManager.js";
|
|
10
|
-
export class
|
|
10
|
+
export class DVEDataManager extends DataManager {
|
|
11
11
|
world = new WorldPainter();
|
|
12
|
-
dataSync = new
|
|
12
|
+
dataSync = new DVEDataSyncNode();
|
|
13
13
|
registers = {
|
|
14
14
|
dimensions: DimensionsRegister,
|
|
15
15
|
world: new WorldRegister(),
|
|
@@ -4,7 +4,7 @@ import { RegionData, ColumnData, ChunkData } from "./World/Classes/index.js";
|
|
|
4
4
|
import { WorldDataSync } from "./Types/DataSync.types.js";
|
|
5
5
|
import { DimensionData } from "./Types/DimensionData.types.js";
|
|
6
6
|
import { RemoteDataSyncNode } from "../Interfaces/Data/RemoteDataSyncNode.js";
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class DVEDataSyncNode extends RemoteDataSyncNode {
|
|
8
8
|
worldData: {
|
|
9
9
|
dimension: import("@amodx/threads/").DataSync<DimensionData, void>;
|
|
10
10
|
chunk: import("@amodx/threads/").DataSync<[LocationData, ChunkData], LocationData>;
|
|
@@ -6,7 +6,7 @@ import { RegionHeaderRegister, RegionHeaderTags, } from "./RegionHeaderRegister.
|
|
|
6
6
|
import { Column, Chunk, Region, } from "./World/Classes/index.js";
|
|
7
7
|
import { DVEFDataSyncIds } from "./Constants/DVEFDataSyncIds.js";
|
|
8
8
|
import { RemoteDataSyncNode } from "../Interfaces/Data/RemoteDataSyncNode.js";
|
|
9
|
-
export class
|
|
9
|
+
export class DVEDataSyncNode extends RemoteDataSyncNode {
|
|
10
10
|
worldData = {
|
|
11
11
|
dimension: Threads.onDataSync(DVEFDataSyncIds.Dimesnion, (data) => {
|
|
12
12
|
DimensionsRegister.instance.registerDimension(data.id, data.options);
|
|
@@ -5,7 +5,7 @@ import { RichDataTool } from "../../Tools/Data/RichDataTool.js";
|
|
|
5
5
|
import { ColumnDataTool } from "../../Tools/Data/WorldData/ColumnDataTool.js";
|
|
6
6
|
import { arrayBufferToSharedArrayBuffer } from "@amodx/core/Buffers/arrayBufferToSharedArrayBuffer.js";
|
|
7
7
|
import { DataSerializerTool } from "./Tools/DataSerializerTool.js";
|
|
8
|
-
import { DivineVoxelEngineWorld } from "Contexts/World";
|
|
8
|
+
import { DivineVoxelEngineWorld } from "../../Contexts/World";
|
|
9
9
|
export class DataHanlderWrapper {
|
|
10
10
|
static instance;
|
|
11
11
|
columnDatatool = new ColumnDataTool();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QuadVerticies, QuadVerticiesArray, } from "@amodx/meshing/Geometry.types";
|
|
2
2
|
import { VoxelFaces, VoxelFacesArray } from "../../Math";
|
|
3
3
|
import { VoxelRelativeCubeIndex } from "../../VoxelModels/Indexing/VoxelRelativeCubeIndex";
|
|
4
|
-
import { LightData } from "
|
|
4
|
+
import { LightData } from "../../Data/LightData";
|
|
5
5
|
export const GradientCheckSets = [];
|
|
6
6
|
GradientCheckSets[VoxelFaces.Up] = [];
|
|
7
7
|
GradientCheckSets[VoxelFaces.Up][QuadVerticies.TopRight] = [
|
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
|
-
@divinevoxel/
|
|
2
|
+
@divinevoxel/vlox
|
|
3
3
|
</h1>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
<img src="https://divine-star-software.github.io/DigitalAssets/images/logo-small.png"/>
|
|
7
|
-
</p>
|
|
5
|
+
|
|
8
6
|
|
|
9
7
|
---
|
|
10
8
|
|
|
11
|
-
Divine Voxel Engine
|
|
9
|
+
Divine Voxel Engine Vlox is the orginal set up for DVE. It allows you to create Minecraft style voxel worlds.
|
package/Tools/Tasks/TasksTool.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Threads } from "@amodx/threads/";
|
|
2
2
|
import { WorldSpaces } from "../../Data/World/WorldSpaces.js";
|
|
3
|
-
import { ConstructorRemoteThreadTasks } from "../../Contexts/Constructor/ConstructorRemoteThreadTasks.js";
|
|
4
|
-
import { ConstructorTasksIds } from "../../Contexts/Constructor/ConstructorTasksIds.js";
|
|
5
|
-
import { DVEConstructorTasksQueues } from "../../Contexts/Constructor/DVEConstructorTasksQueues.js";
|
|
3
|
+
import { ConstructorRemoteThreadTasks } from "../../Contexts/Constructor/Tasks/ConstructorRemoteThreadTasks.js";
|
|
4
|
+
import { ConstructorTasksIds } from "../../Contexts/Constructor/Tasks/ConstructorTasksIds.js";
|
|
5
|
+
import { DVEConstructorTasksQueues } from "../../Contexts/Constructor/Tasks/DVEConstructorTasksQueues.js";
|
|
6
6
|
export class TaskTool {
|
|
7
7
|
_data = {
|
|
8
8
|
dimension: "main",
|
|
@@ -190,9 +190,6 @@ export function TransformBox(quads, transform) {
|
|
|
190
190
|
z: transform.rotationPivot[2],
|
|
191
191
|
}
|
|
192
192
|
: centroid;
|
|
193
|
-
if (transform.rotationPivot) {
|
|
194
|
-
console.warn(pivot, transform.rotationPivot);
|
|
195
|
-
}
|
|
196
193
|
for (const vertex of uniqueVertices) {
|
|
197
194
|
// Translate vertex to pivot point
|
|
198
195
|
let x = vertex.x - pivot.x;
|
|
@@ -2,7 +2,7 @@ import { WorldSpaces } from "../Data/World/WorldSpaces.js";
|
|
|
2
2
|
import { BrushTool } from "../Tools/Brush/Brush";
|
|
3
3
|
import { ChunkDataTool } from "../Tools/Data/WorldData/ChunkDataTool";
|
|
4
4
|
import { WorldBounds } from "../Data/World/WorldBounds";
|
|
5
|
-
import { DivineVoxelEngineConstructor } from "Contexts/Constructor";
|
|
5
|
+
import { DivineVoxelEngineConstructor } from "../Contexts/Constructor";
|
|
6
6
|
const brush = new BrushTool();
|
|
7
7
|
const dataTool = brush._dt;
|
|
8
8
|
const chunkTool = new ChunkDataTool();
|
|
@@ -6,7 +6,7 @@ import { WorldGenRegister } from "./WorldGenRegister.js";
|
|
|
6
6
|
import { WorldGenBrush } from "./WorldGenBrush.js";
|
|
7
7
|
import { SafeInterval } from "@amodx/core/Intervals/SafeInterval.js";
|
|
8
8
|
import { Threads } from "@amodx/threads";
|
|
9
|
-
import { ConstructorTasksIds } from "Contexts/Constructor/ConstructorTasksIds.js";
|
|
9
|
+
import { ConstructorTasksIds } from "../Contexts/Constructor/Tasks/ConstructorTasksIds.js";
|
|
10
10
|
export class WorldGeneration {
|
|
11
11
|
static worldGen = null;
|
|
12
12
|
static register = WorldGenRegister;
|
package/package.json
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"name": "@divinevoxel/vlox",
|
|
3
|
+
"version": "0.0.02",
|
|
4
|
+
"description": "Vlox a block style voxel engine.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"devDependencies": {},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "mkdir -p dist && rm -rf dist/* && cp package.json dist/package.json && cp README.md ./dist/README.md && cp ../../LICENSE.md ./dist/LICENSE.md && cd ./src && npx tsc",
|
|
11
|
+
"compile": "cd src && npx tsc --watch"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "Divine Star Software",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"url": "git+https://github.com/Divine-Star-Software/DivineVoxelEngine.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/Divine-Star-Software/DivineVoxelEngine/issues"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@amodx/uri": "^0.0.11",
|
|
24
|
+
"@amodx/meshing": "^0.0.01",
|
|
25
|
+
"@amodx/math": "^0.0.01",
|
|
26
|
+
"@amodx/binary": "^0.0.11",
|
|
27
|
+
"@amodx/threads": "^0.0.01",
|
|
28
|
+
"@amodx/indexdb": "^0.0.11"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
}
|
|
30
33
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DataStructBuilders } from "./DataStructBuilders";
|
|
2
|
-
export declare class DVEFDataStructs extends DataStructBuilders {
|
|
3
|
-
chunkTags: import("@amodx/binary").BinaryStruct;
|
|
4
|
-
columnTags: import("@amodx/binary").BinaryStruct;
|
|
5
|
-
regionTags: import("@amodx/binary").BinaryStruct;
|
|
6
|
-
constructor();
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DataStructBuilders } from "./DataStructBuilders";
|
|
2
|
-
import { ChunkStatStruct } from "./Structs/ChunkStruct";
|
|
3
|
-
import { ColumnStateStruct } from "./Structs/ColumnStruct";
|
|
4
|
-
import { RegionStateStruct } from "./Structs/RegionStruct";
|
|
5
|
-
import { LightData } from "../../../Data/LightData";
|
|
6
|
-
export class DVEFDataStructs extends DataStructBuilders {
|
|
7
|
-
chunkTags = ChunkStatStruct;
|
|
8
|
-
columnTags = ColumnStateStruct;
|
|
9
|
-
regionTags = RegionStateStruct;
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.voxels.overrides.set("#dve_light_value", (tags, value, id) => {
|
|
13
|
-
const v = value;
|
|
14
|
-
let sl = 0;
|
|
15
|
-
sl = LightData.setR(v[0], sl);
|
|
16
|
-
sl = LightData.setG(v[1], sl);
|
|
17
|
-
sl = LightData.setB(v[2], sl);
|
|
18
|
-
tags.setProperty("#dve_light_value", sl);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
package/Data/DVEFDataCore.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DVEDataCore } from "../Interfaces/Data/DVEDataCore";
|
|
2
|
-
import { DVEFDataManager } from "./DVEFDataManager";
|
|
3
|
-
import { DVEFDataSyncNode } from "../Data/DVEFDataSyncNode";
|
|
4
|
-
export declare class DVEFDataCore extends DVEDataCore {
|
|
5
|
-
dataManager: DVEFDataManager;
|
|
6
|
-
dataSync: DVEFDataSyncNode;
|
|
7
|
-
}
|
package/Data/DVEFDataCore.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DVEDataCore } from "../Interfaces/Data/DVEDataCore";
|
|
2
|
-
import { DVEFDataManager } from "./DVEFDataManager";
|
|
3
|
-
import { DVEFDataSyncNode } from "../Data/DVEFDataSyncNode";
|
|
4
|
-
export class DVEFDataCore extends DVEDataCore {
|
|
5
|
-
dataManager = new DVEFDataManager();
|
|
6
|
-
dataSync = new DVEFDataSyncNode();
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Contexts/Constructor/{DVEConstructorTasksQueues.js → Tasks/DVEConstructorTasksQueues.js}
RENAMED
|
File without changes
|
/package/Contexts/RichWorld/{DivineStarVoxelEngineRichWorld.js → DivineVoxelEngineRichWorld.js}
RENAMED
|
File without changes
|
|
File without changes
|