@divinevoxel/vlox 0.0.72 → 0.0.73
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/Render/DivineVoxelEngineRender.d.ts +1 -1
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -1
- package/Init/StartConstructor.js +6 -4
- package/Init/StartWorld.d.ts +1 -1
- package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
- package/Mesher/Functions/CompactVoxelMesh.js +1 -1
- package/Mesher/Functions/MeshSection.js +20 -8
- package/Mesher/Functions/MeshTexture.d.ts +1 -1
- package/Mesher/Functions/MeshTexture.js +3 -4
- 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 +2 -2
- package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
- package/Mesher/Geomtry/VoxelMesh.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 +4 -22
- package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -2
- package/Mesher/Models/Common/Calc/FaceDataCalc.js +37 -30
- 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 +11 -17
- 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 +24 -12
- 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 +3 -3
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +1 -3
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +0 -23
- package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +4 -5
- package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +11 -7
- package/Models/Defaults/CubeVoxelGeometry.js +4 -0
- package/Models/Defaults/CubeVoxelModels.js +344 -344
- package/Models/Defaults/LiquidVoxelModel.js +2 -2
- package/Models/Defaults/PanelVoxelModels.js +432 -432
- package/Models/Defaults/StairVoxelModel.js +576 -576
- package/Models/Examples.js +469 -456
- package/Models/Rules/Functions/BuildFinalInputs.js +9 -7
- 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 +14 -5
- package/Renderer/Classes/SectorMesh.d.ts +3 -4
- package/Renderer/Classes/SectorMesh.js +6 -11
- package/Renderer/InitTasks.js +6 -7
- package/Renderer/MeshManager.js +2 -2
- package/Renderer/MeshRegister.js +2 -1
- package/Settings/EngineSettings.d.ts +1 -1
- package/Settings/EngineSettings.js +3 -5
- package/Settings/EngineSettings.types.d.ts +17 -18
- package/Settings/EngineSettings.types.js +16 -15
- package/Tasks/IWG/IWG.d.ts +2 -1
- package/Tasks/IWG/IWG.js +9 -3
- package/Tasks/IWG/Internal/Classes/BuildQueue.d.ts +11 -0
- package/Tasks/IWG/Internal/Classes/BuildQueue.js +49 -0
- package/Tasks/IWG/Internal/Classes/Generator.d.ts +6 -1
- package/Tasks/IWG/Internal/Classes/Generator.js +13 -1
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.js +2 -2
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.js +21 -2
- package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -4
- package/Tasks/IWG/Internal/IWGTasks.js +0 -10
- package/Tasks/IWG/Internal/IWGTools.d.ts +1 -1
- package/Tasks/IWG/Procedures/SaveAllSectors.js +2 -0
- package/Tasks/Update/UpdateTask.d.ts +3 -1
- package/Tasks/Update/UpdateTask.js +28 -2
- package/Tasks/Update/VoxelUpdate.js +6 -0
- package/Tasks/WorldGeneration/WorldGenBrush.js +1 -1
- package/Templates/Cursor/TemplateCursor.d.ts +2 -2
- package/Templates/Cursor/TemplateCursor.js +1 -2
- 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/Brush.d.ts +1 -1
- package/Tools/Brush/Brush.js +39 -7
- package/Util/Binary/BinaryArrays.d.ts +6 -0
- package/Util/Binary/BinaryArrays.js +25 -0
- package/Util/Binary/BinaryBuffer.d.ts +29 -0
- package/Util/Binary/BinaryBuffer.js +130 -0
- package/Util/Binary/{BitArray.d.ts → BinaryFunctions.d.ts} +1 -2
- package/Util/Binary/BinaryFunctions.js +11 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +1 -1
- package/Voxels/Cursor/VoxelCursor.interface.js +8 -11
- package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -5
- package/Voxels/Data/VoxelPalettesRegister.js +0 -9
- package/Voxels/Data/VoxelTagsRegister.js +7 -7
- package/Voxels/Functions/BuildStateData.js +9 -9
- package/Voxels/Functions/BuildTagAndPaletteData.js +2 -4
- package/Voxels/InitVoxelData.js +12 -13
- package/Voxels/State/Schema/StateSchema.d.ts +1 -1
- package/Voxels/Types/Voxel.types.d.ts +18 -0
- package/Voxels/Types/Voxel.types.js +6 -2
- package/World/Archive/Archive.types.d.ts +38 -34
- package/World/Archive/Functions/ArchiveArea.js +16 -24
- package/World/Archive/Functions/ArchiveSector.js +477 -192
- package/World/Archive/Functions/ImportSector.d.ts +3 -3
- package/World/Archive/Functions/ImportSector.js +202 -141
- package/World/Archive/Functions/Shared.d.ts +6 -0
- package/World/Archive/Functions/Shared.js +75 -0
- package/World/Archive/InitTasks.js +30 -13
- package/World/Cursor/SectionCursor.d.ts +2 -2
- package/World/Cursor/SectionCursor.js +2 -3
- package/World/Cursor/SectorCursor.d.ts +2 -2
- package/World/Cursor/SectorCursor.js +1 -2
- package/World/Cursor/WorldCursor.d.ts +2 -2
- package/World/Cursor/WorldCursor.js +1 -2
- package/World/Cursor/WorldVoxelCursor.js +1 -0
- package/World/InitTasks.d.ts +1 -1
- package/World/Lock/WorldLock.d.ts +1 -1
- package/World/Section/Section.d.ts +12 -16
- package/World/Section/Section.js +62 -20
- package/World/Section/SectionState.d.ts +10 -0
- package/World/Section/SectionState.js +11 -0
- package/World/Sector/Sector.d.ts +14 -6
- package/World/Sector/Sector.js +67 -17
- package/World/Sector/SectorHeightMap.js +2 -2
- package/World/Sector/SectorState.d.ts +14 -6
- package/World/Sector/SectorState.js +28 -15
- package/World/Types/WorldStorage.interface.js +1 -0
- package/World/WorldRegister.d.ts +4 -0
- package/World/WorldRegister.js +15 -3
- package/World/WorldSpaces.d.ts +4 -0
- package/World/WorldSpaces.js +19 -6
- 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/Models/Rules/VoxelModelManager.js +0 -82
- 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/{Tools → Geomtry}/VoxelMeshBVHBuilder.d.ts +0 -0
- /package/Mesher/{Tools → Geomtry}/VoxelMeshBVHBuilder.js +0 -0
- /package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +0 -0
- /package/Mesher/Geomtry/{Buffers.js → VoxelMeshBuffers.js} +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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoxelFaceTransparentResultsIndex } from "../../Indexing/VoxelFaceTransparentResultsIndex";
|
|
2
|
-
import {
|
|
2
|
+
import { VoxelModelRuleBuilderRegister } from "../VoxelModelRuleBuilderRegister";
|
|
3
3
|
const isArgString = (data) => {
|
|
4
4
|
if (typeof data !== "string")
|
|
5
5
|
return;
|
|
@@ -24,21 +24,22 @@ export function BuildFinalInputs(model) {
|
|
|
24
24
|
const geoNodes = [];
|
|
25
25
|
const shapeStateNodes = model.data.shapeStatesNodes[state];
|
|
26
26
|
for (const node of shapeStateNodes) {
|
|
27
|
-
const geo =
|
|
27
|
+
const geo = VoxelModelRuleBuilderRegister.getGeomtryFromLink(node);
|
|
28
28
|
if (!geo)
|
|
29
29
|
throw new Error(`Geometry does not exist`);
|
|
30
30
|
geo.inputs.resetDefaults();
|
|
31
31
|
for (const geoArg in node.inputs) {
|
|
32
32
|
const constructorArg = node.inputs[geoArg];
|
|
33
33
|
if (isArgString(constructorArg)) {
|
|
34
|
-
geo.inputs[geoArg] =
|
|
34
|
+
geo.inputs[geoArg] =
|
|
35
|
+
modVoxelInput[constructorArg.replace("@", "")];
|
|
35
36
|
continue;
|
|
36
37
|
}
|
|
37
38
|
geo.inputs[geoArg] = constructorArg;
|
|
38
39
|
}
|
|
39
40
|
geoNodes[model.stateData.geometryLinkPalette[node.id]] =
|
|
40
41
|
geo.inputs.cloneArgs();
|
|
41
|
-
const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.shapeStateRelativeGeometryMap[model.stateData.shapeStateRecord[state]][
|
|
42
|
+
const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.shapeStateRelativeGeometryMap[model.stateData.shapeStateRecord[state]][VoxelModelRuleBuilderRegister.geometryPalette.getNumberId(VoxelModelRuleBuilderRegister.getGeometryLinkId(node))]];
|
|
42
43
|
if (geo.data.ogData.doNotBuildRules !== true) {
|
|
43
44
|
for (let i = 0; i < geo.inputs.faceTransparentIndex.length; i++) {
|
|
44
45
|
transparentIndex.setValue(modIndex, byteIndex, i, geo.inputs.faceTransparentIndex[i] ? 1 : 0);
|
|
@@ -56,20 +57,21 @@ export function BuildFinalInputs(model) {
|
|
|
56
57
|
const shapeStateNodes = model.data.shapeStatesConditonalNodes[state];
|
|
57
58
|
for (let i = 0; i < shapeStateNodes.length; i++) {
|
|
58
59
|
const node = shapeStateNodes[i];
|
|
59
|
-
const geo =
|
|
60
|
+
const geo = VoxelModelRuleBuilderRegister.getGeomtryFromLink(node);
|
|
60
61
|
if (!geo)
|
|
61
62
|
throw new Error(`Geometry does not exist`);
|
|
62
63
|
// geo.inputs.resetDefaults();
|
|
63
64
|
for (const geoArg in node.inputs) {
|
|
64
65
|
const constructorArg = node.inputs[geoArg];
|
|
65
66
|
if (isArgString(constructorArg)) {
|
|
66
|
-
geo.inputs[geoArg] =
|
|
67
|
+
geo.inputs[geoArg] =
|
|
68
|
+
modVoxelInput[constructorArg.replace("@", "")];
|
|
67
69
|
continue;
|
|
68
70
|
}
|
|
69
71
|
geo.inputs[geoArg] = constructorArg;
|
|
70
72
|
}
|
|
71
73
|
geoNodes[i] = geo.inputs.cloneArgs();
|
|
72
|
-
const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.condiotnalShapeStateRelativeGeometryMap[model.stateData.condiotnalShapeStateRecord[state]][
|
|
74
|
+
const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.condiotnalShapeStateRelativeGeometryMap[model.stateData.condiotnalShapeStateRecord[state]][VoxelModelRuleBuilderRegister.geometryPalette.getNumberId(VoxelModelRuleBuilderRegister.getGeometryLinkId(node))]];
|
|
73
75
|
if (geo.data.ogData.doNotBuildRules !== true) {
|
|
74
76
|
for (let i = 0; i < geo.inputs.faceTransparentIndex.length; i++) {
|
|
75
77
|
transparentIndex.setValue(modIndex, byteIndex, i, geo.inputs.faceTransparentIndex[i] ? 1 : 0);
|
|
@@ -63,6 +63,7 @@ const mapQuadUvs = (uvs, rotation = 0, transform) => {
|
|
|
63
63
|
export function BuildGeomtryInputs(geomtry) {
|
|
64
64
|
const inputObservers = new Map();
|
|
65
65
|
const onInput = (id, subscribe) => {
|
|
66
|
+
id = id.replace("@", "");
|
|
66
67
|
let obs = inputObservers.get(id);
|
|
67
68
|
if (!obs) {
|
|
68
69
|
obs = [];
|
|
@@ -109,6 +110,7 @@ export function BuildGeomtryInputs(geomtry) {
|
|
|
109
110
|
value));
|
|
110
111
|
}
|
|
111
112
|
if (isArgString(faceData.transparent)) {
|
|
113
|
+
faceTransparentIndex[relativeFaceCount + face] = false;
|
|
112
114
|
onInput(String(faceData.transparent), (value) => {
|
|
113
115
|
args[argsIndex][face][BoxVoxelGometryInputs.ArgIndexes.Transparent] = value;
|
|
114
116
|
faceTransparentIndex[relativeFaceCount + face] = Boolean(value);
|
|
@@ -228,15 +230,16 @@ export function BuildGeomtryInputs(geomtry) {
|
|
|
228
230
|
},
|
|
229
231
|
};
|
|
230
232
|
for (const arg in geomtry.data.ogData.arguments) {
|
|
231
|
-
|
|
232
|
-
if (!inputObservers.has(argKey))
|
|
233
|
+
if (!inputObservers.has(arg))
|
|
233
234
|
continue;
|
|
234
|
-
const obs = inputObservers.get(
|
|
235
|
+
const obs = inputObservers.get(arg);
|
|
235
236
|
const data = geomtry.data.ogData.arguments[arg];
|
|
236
|
-
Object.defineProperty(finalGeoInputs,
|
|
237
|
+
Object.defineProperty(finalGeoInputs, arg, {
|
|
237
238
|
set(value) {
|
|
238
239
|
if (data.type == "texture") {
|
|
239
|
-
|
|
240
|
+
const textureId = value;
|
|
241
|
+
value =
|
|
242
|
+
TextureManager.getTexture("dve_voxel")?.getTextureIndex(textureId);
|
|
240
243
|
}
|
|
241
244
|
for (const func of obs) {
|
|
242
245
|
func(value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VoxelRelativeCubeIndex } from "../../Indexing/VoxelRelativeCubeIndex";
|
|
2
2
|
import { Vector3Like } from "@amodx/math";
|
|
3
3
|
import { VoxelAOResultsIndex } from "../../Indexing/VoxelAOResultsIndex";
|
|
4
|
-
import {
|
|
4
|
+
import { VoxelModelRuleBuilderRegister } from "../VoxelModelRuleBuilderRegister";
|
|
5
5
|
import { VoxelFaceCullResultsIndex } from "../../Indexing/VoxelFaceCullResultsIndex";
|
|
6
6
|
class OcculsionBox {
|
|
7
7
|
p1;
|
|
@@ -132,7 +132,7 @@ export function BuildRules(main, geoPalette) {
|
|
|
132
132
|
faceByteCount: main.faceCount,
|
|
133
133
|
});
|
|
134
134
|
for (let otherNumberId = 0; otherNumberId < geoPalette.size; otherNumberId++) {
|
|
135
|
-
let other =
|
|
135
|
+
let other = VoxelModelRuleBuilderRegister.geometry.get(geoPalette._palette[otherNumberId]);
|
|
136
136
|
if (other.data.ogData.doNotBuildRules !== undefined)
|
|
137
137
|
continue;
|
|
138
138
|
if (other.id == main.id)
|
|
@@ -2,7 +2,7 @@ import { StringPalette } from "../../Util/StringPalette";
|
|
|
2
2
|
import { VoxelGeometryData, VoxelGeometryLinkData, VoxelModelConstructorData, VoxelModelData } from "../VoxelModel.types";
|
|
3
3
|
import { VoxelRuleGeometry } from "./Classes/VoxelRulesGeometry";
|
|
4
4
|
import { VoxelRulesModoel } from "./Classes/VoxelRulesModel";
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class VoxelModelRuleBuilderRegister {
|
|
6
6
|
static geometryPalette: StringPalette;
|
|
7
7
|
static getGeometryLinkId: (node: VoxelGeometryLinkData) => string;
|
|
8
8
|
static voxels: Map<string, {
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { VoxelFaceNameArray } from "../../Math";
|
|
2
|
+
import { StringPalette } from "../../Util/StringPalette";
|
|
3
|
+
import { VoxelRuleGeometry } from "./Classes/VoxelRulesGeometry";
|
|
4
|
+
import { VoxelRulesModoel } from "./Classes/VoxelRulesModel";
|
|
5
|
+
const addGeo = (model, stateId, nodes) => {
|
|
6
|
+
const registred = [];
|
|
7
|
+
for (const geoLinkNode of nodes) {
|
|
8
|
+
const geo = VoxelModelRuleBuilderRegister.geometry.get(geoLinkNode.geometryId);
|
|
9
|
+
if (!geo)
|
|
10
|
+
throw new Error(`Geometry ${geoLinkNode.geometryId} is not registered.`);
|
|
11
|
+
const newId = getGeometryLinkId(geoLinkNode);
|
|
12
|
+
if (VoxelModelRuleBuilderRegister.geometry.has(newId))
|
|
13
|
+
continue;
|
|
14
|
+
registred.push([stateId, newId]);
|
|
15
|
+
if (!VoxelModelRuleBuilderRegister.geometryPalette.isRegistered(newId))
|
|
16
|
+
VoxelModelRuleBuilderRegister.geometryPalette.register(newId);
|
|
17
|
+
const newData = structuredClone(geo.data);
|
|
18
|
+
for (const node of newData.nodes) {
|
|
19
|
+
node.tranform = {
|
|
20
|
+
...(geoLinkNode.position ? { position: geoLinkNode.position } : {}),
|
|
21
|
+
...(geoLinkNode.scale ? { scale: geoLinkNode.scale } : {}),
|
|
22
|
+
...(geoLinkNode.rotation ? { rotation: geoLinkNode.rotation } : {}),
|
|
23
|
+
...(geoLinkNode.rotationPivot
|
|
24
|
+
? { rotationPivot: geoLinkNode.rotationPivot }
|
|
25
|
+
: {}),
|
|
26
|
+
...(geoLinkNode.flip ? { flip: geoLinkNode.flip } : {}),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
VoxelModelRuleBuilderRegister.geometry.set(newId, new VoxelRuleGeometry(newId, newData));
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
return registred;
|
|
33
|
+
};
|
|
34
|
+
const getGeometryLinkId = (node) => {
|
|
35
|
+
return `${node.geometryId}${node.position ? `-p${node.position.toString()}` : ""}${node.rotation ? `-r${node.rotation.toString()}` : ""}${node.scale ? `-s${node.scale.toString()}` : ""}`.trim();
|
|
36
|
+
};
|
|
37
|
+
export class VoxelModelRuleBuilderRegister {
|
|
38
|
+
static geometryPalette = new StringPalette();
|
|
39
|
+
static getGeometryLinkId = getGeometryLinkId;
|
|
40
|
+
static voxels = new Map();
|
|
41
|
+
static geometry = new Map();
|
|
42
|
+
static models = new Map();
|
|
43
|
+
static registerGeometry(...geometry) {
|
|
44
|
+
for (const geo of geometry) {
|
|
45
|
+
if (!this.geometryPalette.isRegistered(geo.id))
|
|
46
|
+
this.geometryPalette.register(geo.id);
|
|
47
|
+
const divisor = geo.divisor ? geo.divisor : false;
|
|
48
|
+
if (divisor) {
|
|
49
|
+
for (const node of geo.nodes) {
|
|
50
|
+
if (node.type == "box") {
|
|
51
|
+
let d = node.divisor ? node.divisor : divisor;
|
|
52
|
+
node.points[0][0] /= d[0];
|
|
53
|
+
node.points[0][1] /= d[1];
|
|
54
|
+
node.points[0][2] /= d[2];
|
|
55
|
+
node.points[1][0] /= d[0];
|
|
56
|
+
node.points[1][1] /= d[1];
|
|
57
|
+
node.points[1][2] /= d[2];
|
|
58
|
+
for (const faceName of VoxelFaceNameArray) {
|
|
59
|
+
const data = node.faces[faceName];
|
|
60
|
+
if (Array.isArray(data.uv)) {
|
|
61
|
+
data.uv[0] /= d[0];
|
|
62
|
+
data.uv[1] /= d[1];
|
|
63
|
+
data.uv[2] /= d[0];
|
|
64
|
+
data.uv[3] /= d[1];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (node.type == "quad") {
|
|
69
|
+
let d = node.divisor ? node.divisor : divisor;
|
|
70
|
+
for (let i = 0; i < 4; i++) {
|
|
71
|
+
const point = node.points[i];
|
|
72
|
+
point[0] /= d[0];
|
|
73
|
+
point[1] /= d[1];
|
|
74
|
+
point[2] /= d[2];
|
|
75
|
+
}
|
|
76
|
+
if (Array.isArray(node.uv)) {
|
|
77
|
+
if (Array.isArray(node.uv[0])) {
|
|
78
|
+
let uvs = node.uv;
|
|
79
|
+
for (let i = 0; i < node.uv.length; i++) {
|
|
80
|
+
uvs[i][0] /= d[0];
|
|
81
|
+
uvs[i][1] /= d[1];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
let uvs = node.uv;
|
|
86
|
+
uvs[0] /= d[0];
|
|
87
|
+
uvs[1] /= d[1];
|
|
88
|
+
uvs[2] /= d[0];
|
|
89
|
+
uvs[3] /= d[1];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
this.geometry.set(geo.id, new VoxelRuleGeometry(geo.id, {
|
|
96
|
+
ogData: geo,
|
|
97
|
+
id: geo.id,
|
|
98
|
+
nodes: geo.nodes.map((node) => ({
|
|
99
|
+
node,
|
|
100
|
+
tranform: {},
|
|
101
|
+
})),
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
static getGeomtryFromLink(link) {
|
|
106
|
+
return this.geometry.get(getGeometryLinkId(link));
|
|
107
|
+
}
|
|
108
|
+
static registerModels(...models) {
|
|
109
|
+
for (const model of models) {
|
|
110
|
+
const rulesModel = new VoxelRulesModoel(model);
|
|
111
|
+
this.models.set(model.id, rulesModel);
|
|
112
|
+
const divisor = model.divisor ? model.divisor : null;
|
|
113
|
+
if (divisor) {
|
|
114
|
+
for (const stateId in model.shapeStatesNodes) {
|
|
115
|
+
const nodes = model.shapeStatesNodes[stateId];
|
|
116
|
+
for (const node of nodes) {
|
|
117
|
+
const d = "divisor" in node ? node.divisor : divisor;
|
|
118
|
+
if (node.position) {
|
|
119
|
+
node.position[0] /= d[0];
|
|
120
|
+
node.position[1] /= d[1];
|
|
121
|
+
node.position[2] /= d[2];
|
|
122
|
+
}
|
|
123
|
+
if (node.rotationPivot) {
|
|
124
|
+
node.rotationPivot[0] /= d[0];
|
|
125
|
+
node.rotationPivot[1] /= d[1];
|
|
126
|
+
node.rotationPivot[2] /= d[2];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const stateId in model.shapeStatesConditonalNodes) {
|
|
131
|
+
const nodes = model.shapeStatesConditonalNodes[stateId];
|
|
132
|
+
for (const node of nodes) {
|
|
133
|
+
const d = "divisor" in node ? node.divisor : divisor;
|
|
134
|
+
if (node.position) {
|
|
135
|
+
node.position[0] /= d[0];
|
|
136
|
+
node.position[1] /= d[1];
|
|
137
|
+
node.position[2] /= d[2];
|
|
138
|
+
}
|
|
139
|
+
if (node.rotationPivot) {
|
|
140
|
+
node.rotationPivot[0] /= d[0];
|
|
141
|
+
node.rotationPivot[1] /= d[1];
|
|
142
|
+
node.rotationPivot[2] /= d[2];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (model.effects) {
|
|
147
|
+
for (const effect of model.effects) {
|
|
148
|
+
if (effect.type == "fx-points") {
|
|
149
|
+
for (const state in effect.values) {
|
|
150
|
+
for (const point of effect.values[state]) {
|
|
151
|
+
point[0] /= divisor[0];
|
|
152
|
+
point[1] /= divisor[1];
|
|
153
|
+
point[2] /= divisor[2];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
for (const stateId in model.shapeStatesNodes) {
|
|
161
|
+
const nodes = model.shapeStatesNodes[stateId];
|
|
162
|
+
addGeo(model, stateId, nodes).forEach((_) => rulesModel.registerShapeState(..._));
|
|
163
|
+
}
|
|
164
|
+
for (const stateId in model.shapeStatesConditonalNodes) {
|
|
165
|
+
const nodes = model.shapeStatesConditonalNodes[stateId];
|
|
166
|
+
addGeo(model, stateId, nodes).forEach((_) => rulesModel.registerCondiotnalNode(..._));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
static registerVoxel(id, data) {
|
|
171
|
+
let voxelModels = this.voxels.get(data.id);
|
|
172
|
+
if (!voxelModels) {
|
|
173
|
+
voxelModels = [];
|
|
174
|
+
this.voxels.set(data.id, voxelModels);
|
|
175
|
+
}
|
|
176
|
+
voxelModels.push({ id, data });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -22,6 +22,8 @@ export interface VoxelCustomGeomtryNode {
|
|
|
22
22
|
}
|
|
23
23
|
export interface VoxelBoxGeometryNode {
|
|
24
24
|
type: "box";
|
|
25
|
+
/**Divisor used for transform of this specific node.*/
|
|
26
|
+
divisor?: Vec3Array;
|
|
25
27
|
noShade?: boolean;
|
|
26
28
|
points: [start: Vec3Array, end: Vec3Array];
|
|
27
29
|
rotation?: Vec3Array;
|
|
@@ -37,6 +39,8 @@ export interface VoxelBoxFaceData {
|
|
|
37
39
|
}
|
|
38
40
|
export interface VoxelQuadGeometryNode {
|
|
39
41
|
type: "quad";
|
|
42
|
+
/**Divisor used for transform of this specific node.*/
|
|
43
|
+
divisor?: Vec3Array;
|
|
40
44
|
doubleSided?: boolean | string;
|
|
41
45
|
points: [p1: Vec3Array, p2: Vec3Array, p3: Vec3Array, p4: Vec3Array];
|
|
42
46
|
transparent?: boolean | string;
|
|
@@ -46,6 +50,8 @@ export interface VoxelQuadGeometryNode {
|
|
|
46
50
|
}
|
|
47
51
|
export interface VoxelTriangleGeometryNode {
|
|
48
52
|
type: "triangle";
|
|
53
|
+
/**Divisor used for transform of this specific node.*/
|
|
54
|
+
divisor?: Vec3Array;
|
|
49
55
|
orientation?: 0 | 1;
|
|
50
56
|
doubleSided?: boolean;
|
|
51
57
|
points: [p1: Vec3Array, p2: Vec3Array, p3: Vec3Array];
|
|
@@ -91,6 +97,7 @@ export type VoxelGeometryNodes = VoxelCustomGeomtryNode | VoxelBoxGeometryNode |
|
|
|
91
97
|
export interface VoxelGeometryData {
|
|
92
98
|
id: string;
|
|
93
99
|
nodes: VoxelGeometryNodes[];
|
|
100
|
+
divisor?: Vec3Array;
|
|
94
101
|
/**
|
|
95
102
|
* If this is set the voxel geometry will not be included in the
|
|
96
103
|
* geometry rules and will be fall back to custom inputs.
|
|
@@ -99,7 +106,11 @@ export interface VoxelGeometryData {
|
|
|
99
106
|
doNotBuildRules?: true;
|
|
100
107
|
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument>;
|
|
101
108
|
}
|
|
102
|
-
export interface
|
|
109
|
+
export interface VoxelGeometryLinkData {
|
|
110
|
+
id: string;
|
|
111
|
+
geometryId: string;
|
|
112
|
+
/**Divisor used for transform of this specific node.*/
|
|
113
|
+
divisor?: Vec3Array;
|
|
103
114
|
inputs: Record<string, any>;
|
|
104
115
|
scale?: Vec3Array;
|
|
105
116
|
position?: Vec3Array;
|
|
@@ -107,12 +118,10 @@ export interface VoxelGeometryBaseLinkData {
|
|
|
107
118
|
rotationPivot?: Vec3Array;
|
|
108
119
|
flip?: [flipX: 0 | 1, flipY: 0 | 1, flipZ: 0 | 1];
|
|
109
120
|
}
|
|
110
|
-
export interface VoxelGeometryLinkData extends VoxelGeometryBaseLinkData {
|
|
111
|
-
id: string;
|
|
112
|
-
geometryId: string;
|
|
113
|
-
}
|
|
114
121
|
export interface VoxelModelData {
|
|
115
122
|
id: string;
|
|
123
|
+
/**Divisor used all transforms of geometry nodes. */
|
|
124
|
+
divisor?: Vec3Array;
|
|
116
125
|
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument>;
|
|
117
126
|
shapeStateSchema: (VoxelStateStringSchemaData | VoxelStateNumberSchemaData)[];
|
|
118
127
|
effects?: VoxelEffectData[];
|
|
@@ -4,8 +4,7 @@ export declare class SectorMesh {
|
|
|
4
4
|
location: LocationData;
|
|
5
5
|
sections: SectionMesh[];
|
|
6
6
|
constructor(location: LocationData);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
removeSection(y: number): false | SectionMesh;
|
|
7
|
+
getSection(x: number, y: number, z: number): SectionMesh;
|
|
8
|
+
addSection(x: number, y: number, z: number): SectionMesh;
|
|
9
|
+
removeSection(x: number, y: number, z: number): false | SectionMesh;
|
|
11
10
|
}
|
|
@@ -6,24 +6,19 @@ export class SectorMesh {
|
|
|
6
6
|
constructor(location) {
|
|
7
7
|
this.location = location;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const index = ry / WorldSpaces.section.bounds.y;
|
|
12
|
-
return index;
|
|
9
|
+
getSection(x, y, z) {
|
|
10
|
+
return this.sections[WorldSpaces.section.getIndex(x, y, z)];
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
addSection(y) {
|
|
18
|
-
const index = this.getIndex(y);
|
|
12
|
+
addSection(x, y, z) {
|
|
13
|
+
const index = WorldSpaces.section.getIndex(x, y, z);
|
|
19
14
|
if (this.sections[index])
|
|
20
15
|
return this.sections[index];
|
|
21
16
|
const section = new SectionMesh(this, index);
|
|
22
17
|
this.sections[index] = section;
|
|
23
18
|
return section;
|
|
24
19
|
}
|
|
25
|
-
removeSection(y) {
|
|
26
|
-
const index =
|
|
20
|
+
removeSection(x, y, z) {
|
|
21
|
+
const index = WorldSpaces.section.getIndex(x, y, z);
|
|
27
22
|
if (!this.sections[index])
|
|
28
23
|
return false;
|
|
29
24
|
const section = this.sections[index];
|
package/Renderer/InitTasks.js
CHANGED
|
@@ -8,16 +8,15 @@ export default function RendererTasks(threads) {
|
|
|
8
8
|
Threads.registerTask("set-section", (data, origin) => {
|
|
9
9
|
MeshManager.updateSection(data);
|
|
10
10
|
const tranfers = [];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
tranfers.push(mesh[
|
|
16
|
-
tranfers.push(mesh[2]);
|
|
11
|
+
if (data[1][0] == 0) {
|
|
12
|
+
const comp = data[1][1];
|
|
13
|
+
for (const mesh of comp) {
|
|
14
|
+
tranfers.push(mesh[1].buffer);
|
|
15
|
+
tranfers.push(mesh[2].buffer);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
if (!EngineSettings.settings.rendererSettings.cpuBound) {
|
|
20
|
-
origin.sendMessage(
|
|
19
|
+
origin.sendMessage([], tranfers);
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
22
|
Threads.registerTask("remove-sector", (data) => {
|
package/Renderer/MeshManager.js
CHANGED
|
@@ -12,9 +12,9 @@ export class MeshManager {
|
|
|
12
12
|
if (!sector) {
|
|
13
13
|
sector = MeshRegister.sectors.add(location);
|
|
14
14
|
}
|
|
15
|
-
let section = sector.getSection(location[2]);
|
|
15
|
+
let section = sector.getSection(location[1], location[2], location[3]);
|
|
16
16
|
if (!section) {
|
|
17
|
-
section = sector.addSection(location[2]);
|
|
17
|
+
section = sector.addSection(location[1], location[2], location[3]);
|
|
18
18
|
}
|
|
19
19
|
added.clear();
|
|
20
20
|
for (const [id, points] of effects) {
|
package/Renderer/MeshRegister.js
CHANGED
|
@@ -9,7 +9,7 @@ class Sectors {
|
|
|
9
9
|
location[0],
|
|
10
10
|
...WorldSpaces.sector.getPositionVec3Array(location[1], location[2], location[3]),
|
|
11
11
|
]);
|
|
12
|
-
dimension.set(WorldSpaces.hash.
|
|
12
|
+
dimension.set(WorldSpaces.hash.hashVec3(WorldSpaces.sector.getPosition(location[1], location[2], location[3])), sector);
|
|
13
13
|
return sector;
|
|
14
14
|
}
|
|
15
15
|
static remove(location) {
|
|
@@ -90,3 +90,4 @@ export class MeshRegister {
|
|
|
90
90
|
this._dimensions.set("main", new Map());
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
window.MeshRegister = MeshRegister;
|
|
@@ -12,11 +12,11 @@ type EngineSettingsEvents = {
|
|
|
12
12
|
declare class EngineSettingsClass extends TypedEventTarget<EngineSettingsEvents> {
|
|
13
13
|
enviorment: "node" | "browser";
|
|
14
14
|
settings: EngineSettingsData;
|
|
15
|
+
version: string;
|
|
15
16
|
get doSunPropagation(): boolean;
|
|
16
17
|
get doRGBPropagation(): boolean;
|
|
17
18
|
get doLight(): boolean;
|
|
18
19
|
get doFlow(): boolean;
|
|
19
|
-
get isClient(): boolean;
|
|
20
20
|
getSettings(): EngineSettingsData;
|
|
21
21
|
syncSettings(data: EngineSettingsData): void;
|
|
22
22
|
getSettingsCopy(): any;
|
|
@@ -8,11 +8,12 @@ import { TypedEventTarget } from "../Util/TypedEventTarget.js";
|
|
|
8
8
|
class EngineSettingsClass extends TypedEventTarget {
|
|
9
9
|
enviorment = Environment.isNode() ? "node" : "browser";
|
|
10
10
|
settings = new EngineSettingsData();
|
|
11
|
+
version = "0.0.72";
|
|
11
12
|
get doSunPropagation() {
|
|
12
|
-
return this.settings.lighting.
|
|
13
|
+
return this.settings.lighting.sunLightEnabled == true;
|
|
13
14
|
}
|
|
14
15
|
get doRGBPropagation() {
|
|
15
|
-
return this.settings.lighting.
|
|
16
|
+
return this.settings.lighting.rgbLightEnabled == true;
|
|
16
17
|
}
|
|
17
18
|
get doLight() {
|
|
18
19
|
return this.doRGBPropagation || this.doSunPropagation;
|
|
@@ -20,9 +21,6 @@ class EngineSettingsClass extends TypedEventTarget {
|
|
|
20
21
|
get doFlow() {
|
|
21
22
|
return this.settings.flow.enable;
|
|
22
23
|
}
|
|
23
|
-
get isClient() {
|
|
24
|
-
return this.enviorment != "browser";
|
|
25
|
-
}
|
|
26
24
|
getSettings() {
|
|
27
25
|
return this.settings;
|
|
28
26
|
}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
export interface MesherSettingsData {
|
|
3
|
+
}
|
|
4
|
+
export declare class MesherSettingsData {
|
|
5
|
+
/**Tell the mesher to shade voxel faces with sun light data. Disable if you are using a custom renderering pipeline. */
|
|
6
|
+
doSunLight: boolean;
|
|
7
|
+
/**Tell the mesher to use the built in AO system. Disable if you are using a custom renderering pipeline. */
|
|
8
|
+
doAO: boolean;
|
|
9
|
+
doColors: boolean;
|
|
10
|
+
}
|
|
2
11
|
export interface RenderSettingsData {
|
|
3
12
|
}
|
|
4
13
|
export declare class RenderSettingsData {
|
|
14
|
+
/**Set the mode to change how mesh data is generated based on the underlying rendering API. */
|
|
5
15
|
mode: "webgl" | "webgpu";
|
|
16
|
+
/**If set to try the engine will not try to send vertex buffers to woerks for GC. */
|
|
6
17
|
cpuBound: boolean;
|
|
7
18
|
}
|
|
8
|
-
export interface TextureSettings {
|
|
9
|
-
}
|
|
10
|
-
export declare class TextureSettings {
|
|
11
|
-
textureSize: number;
|
|
12
|
-
}
|
|
13
19
|
export interface UpdatingSettings {
|
|
14
20
|
}
|
|
15
21
|
export declare class UpdatingSettings {
|
|
22
|
+
/**Sector sections are marked as dirty so they can be processed later. */
|
|
23
|
+
dirtyMechanism: boolean;
|
|
24
|
+
/**Updated sector sections are auto rebuilt */
|
|
16
25
|
autoRebuild: boolean;
|
|
17
26
|
}
|
|
18
27
|
export interface WorldSettings {
|
|
@@ -31,34 +40,24 @@ export interface SectionSettings {
|
|
|
31
40
|
export declare class SectionSettings {
|
|
32
41
|
power2Size: Vector3Like;
|
|
33
42
|
}
|
|
34
|
-
export interface VoxelSettings {
|
|
35
|
-
}
|
|
36
|
-
export declare class VoxelSettings {
|
|
37
|
-
doColors: boolean;
|
|
38
|
-
}
|
|
39
43
|
export interface FlowSettings {
|
|
40
44
|
}
|
|
41
45
|
export declare class FlowSettings {
|
|
42
46
|
enable: boolean;
|
|
43
|
-
baseFlowLimit: number;
|
|
44
47
|
}
|
|
45
48
|
export interface LightingSettings {
|
|
46
49
|
}
|
|
47
50
|
export declare class LightingSettings {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
doRGBLight: boolean;
|
|
51
|
-
autoRGBLight: boolean;
|
|
52
|
-
autoSunLight: boolean;
|
|
51
|
+
rgbLightEnabled: boolean;
|
|
52
|
+
sunLightEnabled: boolean;
|
|
53
53
|
}
|
|
54
54
|
export declare class EngineSettingsData {
|
|
55
|
+
mesher: MesherSettingsData;
|
|
55
56
|
rendererSettings: RenderSettingsData;
|
|
56
|
-
textures: TextureSettings;
|
|
57
57
|
updating: UpdatingSettings;
|
|
58
58
|
world: WorldSettings;
|
|
59
59
|
sectors: SectorSettings;
|
|
60
60
|
sections: SectionSettings;
|
|
61
|
-
voxels: VoxelSettings;
|
|
62
61
|
flow: FlowSettings;
|
|
63
62
|
lighting: LightingSettings;
|
|
64
63
|
}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { Vector3Like } from "@amodx/math";
|
|
2
|
+
export class MesherSettingsData {
|
|
3
|
+
/**Tell the mesher to shade voxel faces with sun light data. Disable if you are using a custom renderering pipeline. */
|
|
4
|
+
doSunLight = true;
|
|
5
|
+
/**Tell the mesher to use the built in AO system. Disable if you are using a custom renderering pipeline. */
|
|
6
|
+
doAO = true;
|
|
7
|
+
doColors = true;
|
|
8
|
+
}
|
|
2
9
|
export class RenderSettingsData {
|
|
10
|
+
/**Set the mode to change how mesh data is generated based on the underlying rendering API. */
|
|
3
11
|
mode = "webgl";
|
|
12
|
+
/**If set to try the engine will not try to send vertex buffers to woerks for GC. */
|
|
4
13
|
cpuBound = false;
|
|
5
14
|
}
|
|
6
|
-
export class TextureSettings {
|
|
7
|
-
textureSize = 16;
|
|
8
|
-
}
|
|
9
15
|
export class UpdatingSettings {
|
|
10
|
-
|
|
16
|
+
/**Sector sections are marked as dirty so they can be processed later. */
|
|
17
|
+
dirtyMechanism = true;
|
|
18
|
+
/**Updated sector sections are auto rebuilt */
|
|
19
|
+
autoRebuild = false;
|
|
11
20
|
}
|
|
12
21
|
export class WorldSettings {
|
|
13
22
|
min = Vector3Like.Create(-Number.MAX_SAFE_INTEGER, 0, -Number.MAX_SAFE_INTEGER);
|
|
@@ -19,28 +28,20 @@ export class SectorSettings {
|
|
|
19
28
|
export class SectionSettings {
|
|
20
29
|
power2Size = Vector3Like.Create(4, 4, 4);
|
|
21
30
|
}
|
|
22
|
-
export class VoxelSettings {
|
|
23
|
-
doColors = true;
|
|
24
|
-
}
|
|
25
31
|
export class FlowSettings {
|
|
26
32
|
enable = true;
|
|
27
|
-
baseFlowLimit = 200;
|
|
28
33
|
}
|
|
29
34
|
export class LightingSettings {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
doRGBLight = true;
|
|
33
|
-
autoRGBLight = true;
|
|
34
|
-
autoSunLight = true;
|
|
35
|
+
rgbLightEnabled = true;
|
|
36
|
+
sunLightEnabled = true;
|
|
35
37
|
}
|
|
36
38
|
export class EngineSettingsData {
|
|
39
|
+
mesher = new MesherSettingsData();
|
|
37
40
|
rendererSettings = new RenderSettingsData();
|
|
38
|
-
textures = new TextureSettings();
|
|
39
41
|
updating = new UpdatingSettings();
|
|
40
42
|
world = new WorldSettings();
|
|
41
43
|
sectors = new SectorSettings();
|
|
42
44
|
sections = new SectionSettings();
|
|
43
|
-
voxels = new VoxelSettings();
|
|
44
45
|
flow = new FlowSettings();
|
|
45
46
|
lighting = new LightingSettings();
|
|
46
47
|
}
|
package/Tasks/IWG/IWG.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Thread, ThreadPool } from "@amodx/threads";
|
|
2
|
-
import { WorldStorageInterface } from "../../World/
|
|
2
|
+
import { WorldStorageInterface } from "../../World/Types/WorldStorage.interface";
|
|
3
3
|
import { Generator, GeneratorData } from "./Internal/Classes/Generator";
|
|
4
4
|
import { InitalLoad } from "./Procedures/InitalLoad";
|
|
5
5
|
import SaveAllSectors from "./Procedures/SaveAllSectors";
|
|
@@ -23,6 +23,7 @@ export declare class IWG {
|
|
|
23
23
|
static createGenerator(data: Partial<GeneratorData>): Generator;
|
|
24
24
|
static addGenerator(generator: Generator): void;
|
|
25
25
|
static removeGenerator(generator: Generator): boolean;
|
|
26
|
+
static tick(): void;
|
|
26
27
|
static update(): void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|