@divinevoxel/vlox 0.0.79 → 0.0.81
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/Builder/Tools/Brush/BrushTool.d.ts +12 -2
- package/Builder/Tools/Brush/BrushTool.js +53 -28
- package/Builder/Tools/Debug/DebugTool.d.ts +18 -0
- package/Builder/Tools/Debug/DebugTool.js +36 -0
- package/Builder/Tools/Path/PahtTool.d.ts +1 -1
- package/Builder/Tools/Path/PahtTool.js +1 -1
- package/Builder/Tools/Sculpt/SculptTool.js +8 -0
- package/Builder/Tools/Wrench/WrenchTool.js +10 -23
- package/Builder/Util/SurfaceBoxSelection.js +2 -0
- package/Builder/VoxelBuildSpace.js +3 -3
- package/Contexts/Base/Remote/InitDataSync.js +1 -1
- package/Math/UtilFunctions.js +7 -8
- package/Math/VoxelFaces.d.ts +2 -2
- package/Math/VoxelFaces.js +46 -55
- package/Math/WorldIndexing.d.ts +11 -0
- package/Math/WorldIndexing.js +34 -0
- package/Mesher/Geometry/Geometry.types.d.ts +2 -2
- package/Mesher/Geometry/Geometry.types.js +7 -20
- package/Mesher/Geometry/Primitives/QuadVertexData.js +118 -119
- package/Mesher/Geometry/Primitives/TriangleVertexData.js +89 -90
- package/Mesher/Geometry/Proto/ProtoMesh.d.ts +1 -1
- package/Mesher/Geometry/Proto/ProtoMesh.js +22 -29
- package/Mesher/Geometry/Proto/ProtoMeshBuffer.d.ts +4 -2
- package/Mesher/Geometry/Proto/ProtoMeshBuffer.js +14 -6
- package/Mesher/Geometry/Shapes/Box.js +6 -7
- package/Mesher/Geometry/Transform/TransformBox.js +8 -9
- package/Mesher/Geometry/Transform/TransformQuad.js +4 -5
- package/Mesher/Geometry/Transform/TransformTriangle.js +3 -4
- package/Mesher/InitMesher.js +4 -9
- package/Mesher/Items/Geometry/ItemGeometryBuilder.js +7 -8
- package/Mesher/Items/MeshTexture.js +125 -57
- package/Mesher/Voxels/Base/BuildVoxel.d.ts +6 -0
- package/Mesher/Voxels/Base/BuildVoxel.js +101 -0
- package/Mesher/Voxels/Base/CompactVoxelSectionMesh.js +1 -21
- package/Mesher/Voxels/Base/MeshSectionBase.js +3 -26
- package/Mesher/Voxels/Geometry/VoxelGeometryBuilder.js +33 -31
- package/Mesher/Voxels/Geometry/VoxelShaderData.js +3 -7
- package/Mesher/Voxels/MeshTemplate.js +6 -26
- package/Mesher/Voxels/MeshVoxel.js +5 -10
- package/Mesher/Voxels/Models/Common/Calc/CalcConstants.js +41 -42
- package/Mesher/Voxels/Models/Common/Calc/FaceDataCalc.js +6 -9
- package/Mesher/Voxels/Models/Common/Faces/CullRulledFace.js +64 -47
- package/Mesher/Voxels/Models/Common/Faces/ShadeRulledFace.js +57 -43
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/FlowGradient.js +4 -5
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/LiquidGeometryNode.d.ts +1 -1
- package/Mesher/Voxels/Models/Nodes/Custom/Liquid/LiquidGeometryNode.js +116 -118
- package/Mesher/Voxels/Models/Nodes/Default/QuadVoxelGeometryNode.js +4 -4
- package/Mesher/Voxels/Models/Nodes/VoxelGeometryConstructor.js +2 -2
- package/Mesher/Voxels/Models/Procedures/Default/OutlinedTextureProcedure.js +19 -21
- package/Mesher/Voxels/Models/Procedures/Default/PillarTextureProcedure.js +45 -38
- package/Mesher/Voxels/Models/RenderedMaterials.d.ts +1 -1
- package/Mesher/Voxels/Models/RenderedMaterials.js +8 -5
- package/Mesher/Voxels/Models/VoxelGeometryBuilderCacheSpace.d.ts +18 -4
- package/Mesher/Voxels/Models/VoxelGeometryBuilderCacheSpace.js +135 -22
- package/Mesher/Voxels/Models/VoxelGeometryBuilderCacheSpaceN.d.ts +33 -0
- package/Mesher/Voxels/Models/VoxelGeometryBuilderCacheSpaceN.js +204 -0
- package/Mesher/Voxels/Models/{VoxelModelConstructorRegister.d.ts → VoxelGeometryConstructorRegister.d.ts} +1 -6
- package/Mesher/Voxels/Models/VoxelGeometryConstructorRegister.js +20 -0
- package/Mesher/Voxels/Models/VoxelModelBuilder.js +15 -16
- package/Mesher/Voxels/Models/VoxelModelEffect.d.ts +1 -3
- package/Mesher/Voxels/Models/VoxelModelEffect.js +1 -3
- package/Renderer/DVERenderNode.types.d.ts +1 -0
- package/Renderer/InitTasks.js +2 -0
- package/Tasks/Paint/Erase/EraseVoxel.js +1 -1
- package/Tasks/Propagation/Illumanation/RGBUpdate.js +191 -48
- package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +1 -1
- package/Tasks/Propagation/Illumanation/SunUpdate.js +167 -63
- package/Tasks/Propagation/Illumanation/WorldSun.js +96 -60
- package/Tasks/WorldGeneration/WorldGenBrush.d.ts +2 -0
- package/Tasks/WorldGeneration/WorldGenBrush.js +31 -0
- package/Templates/Archive/ArchivedVoxelTemplate.js +1 -1
- package/Templates/Archive/Functions/CreateArchivedTemplate.js +1 -1
- package/Templates/Archive/Functions/CreateArchivedTemplateFromFull.d.ts +6 -0
- package/Templates/Archive/Functions/CreateArchivedTemplateFromFull.js +174 -0
- package/Textures/Classes/CompactedTextureReader.d.ts +22 -0
- package/Textures/Classes/CompactedTextureReader.js +90 -0
- package/Textures/Classes/CompiledTexture.d.ts +4 -1
- package/Textures/Classes/CompiledTexture.js +36 -8
- package/Textures/Classes/TextureAtlasIndex.d.ts +7 -0
- package/Textures/Classes/TextureAtlasIndex.js +14 -0
- package/Textures/Classes/TextureLoader.d.ts +20 -0
- package/Textures/Classes/TextureLoader.js +95 -0
- package/Textures/Functions/BuildTextureData.d.ts +1 -1
- package/Textures/Functions/BuildTextureData.js +19 -122
- package/Textures/Functions/CreateCompactedTexture.d.ts +6 -0
- package/Textures/Functions/CreateCompactedTexture.js +105 -0
- package/Textures/Functions/ReadCompactedTexture.d.ts +2 -0
- package/Textures/Functions/ReadCompactedTexture.js +42 -0
- package/Textures/Texture.types.d.ts +14 -0
- package/Textures/TextureManager.d.ts +7 -1
- package/Textures/TextureManager.js +13 -0
- package/Tools/Brush/Brush.d.ts +4 -2
- package/Tools/Brush/Brush.js +28 -6
- package/Util/BinaryBuffer/Functions/BinaryBufferConvert.d.ts +1 -1
- package/Util/TickInterval.d.ts +3 -0
- package/Util/TickInterval.js +31 -3
- package/Voxels/Archive/VoxelPaletteArchiveReader.d.ts +1 -0
- package/Voxels/Archive/VoxelPaletteArchiveReader.js +9 -10
- package/Voxels/Archive/VoxelPaletteArechive.js +5 -4
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +1 -1
- package/Voxels/Cursor/VoxelCursor.interface.js +22 -16
- package/Voxels/Data/VoxelLUT.d.ts +69 -42
- package/Voxels/Data/VoxelLUT.js +110 -53
- package/Voxels/Functions/BuildLUTs.js +100 -45
- package/Voxels/Functions/Geometry/CalcFunctions.js +6 -7
- package/Voxels/Functions/Geometry/Compile/BuildCompiled.d.ts +1 -1
- package/Voxels/Functions/Geometry/Inputs/BuildBoxInputs.d.ts +1 -1
- package/Voxels/Functions/Geometry/Inputs/BuildCustomInputs.d.ts +1 -1
- package/Voxels/Functions/Geometry/Inputs/BuildQuadInputs.d.ts +1 -1
- package/Voxels/Functions/Geometry/Inputs/BuildTriangleInputs.d.ts +1 -1
- package/Voxels/Functions/Geometry/Inputs/BuildTriangleInputs.js +3 -0
- package/Voxels/Indexes/VoxelIndex.js +3 -1
- package/Voxels/InitVoxelData.js +3 -1
- package/Voxels/Interaction/Functions/PickVoxel.js +3 -5
- package/Voxels/Interaction/Functions/PickVoxelWorld.js +4 -6
- package/Voxels/Models/Defaults/Examples.d.ts +2 -0
- package/Voxels/Models/Defaults/Examples.js +151 -2
- package/Voxels/State/Reltional/ReltionalStateBuilder.js +2 -0
- package/Voxels/State/Schema/BinarySchema.d.ts +1 -0
- package/Voxels/State/Schema/BinarySchema.js +14 -0
- package/Voxels/State/VoxelSchemas.d.ts +11 -4
- package/Voxels/State/VoxelSchemas.js +42 -9
- package/Voxels/Types/PaintVoxelData.js +6 -2
- package/World/Archive/Classes/ImportedSection.js +1 -1
- package/World/Archive/Classes/ImportedSector.js +0 -1
- package/World/Archive/Functions/Sector/ArchiveSector.js +2 -2
- package/World/Archive/Functions/Sector/ImportSector.d.ts +1 -0
- package/World/Archive/Functions/Sector/ImportSector.js +183 -7
- package/World/Cursor/SectorCursor.js +1 -4
- package/World/Cursor/WorldCursor.d.ts +12 -3
- package/World/Cursor/WorldCursor.js +60 -30
- package/World/InitTasks.js +1 -1
- package/World/Lock/Function/LockSectors.js +5 -1
- package/World/Lock/Function/UnLockSectors.js +5 -1
- package/World/SnapShot/SectionSnapShot.d.ts +7 -3
- package/World/SnapShot/SectionSnapShot.js +47 -21
- package/World/SnapShot/SectionSnapShotCursor.d.ts +4 -2
- package/World/SnapShot/SectionSnapShotCursor.js +23 -11
- package/World/SnapShot/SnapShots.d.ts +1 -2
- package/World/SnapShot/SnapShots.js +3 -3
- package/World/WorldSpaces.d.ts +7 -0
- package/World/WorldSpaces.js +35 -13
- package/WorldSimulation/Dimensions/DimensionSegment.d.ts +2 -0
- package/WorldSimulation/Dimensions/DimensionSegment.js +9 -1
- package/WorldSimulation/Dimensions/DimensionSimulation.js +6 -7
- package/WorldSimulation/Dimensions/Generator.d.ts +4 -0
- package/WorldSimulation/Dimensions/Generator.js +15 -1
- package/WorldSimulation/Dimensions/SimulationSector.d.ts +1 -0
- package/WorldSimulation/Dimensions/SimulationSector.js +18 -0
- package/WorldSimulation/Internal/WorldSimulationTasks.js +11 -7
- package/WorldSimulation/Procedures/InitalLoad.d.ts +1 -0
- package/WorldSimulation/Procedures/InitalLoad.js +18 -8
- package/WorldSimulation/Tasks/SimulationTaskBase.d.ts +4 -1
- package/WorldSimulation/Tasks/SimulationTaskBase.js +13 -2
- package/WorldSimulation/Tasks/TaskSegment.d.ts +4 -2
- package/WorldSimulation/Tasks/TaskSegment.js +36 -22
- package/WorldSimulation/Voxels/Ticks/Types/LiquidVoxelUpdate.js +1 -2
- package/WorldSimulation/WorldSimulation.d.ts +6 -3
- package/WorldSimulation/WorldSimulation.js +44 -20
- package/package.json +1 -1
- package/Mesher/Items/MeshTextureO.d.ts +0 -1
- package/Mesher/Items/MeshTextureO.js +0 -277
- package/Mesher/Voxels/Models/VoxelConstructor.d.ts +0 -8
- package/Mesher/Voxels/Models/VoxelConstructor.js +0 -78
- package/Mesher/Voxels/Models/VoxelModelConstructorRegister.js +0 -37
- package/WorldSimulation/Procedures/BuildOnly.d.ts +0 -10
- package/WorldSimulation/Procedures/BuildOnly.js +0 -55
|
@@ -4,6 +4,7 @@ import { VoxelSchemas } from "../State/VoxelSchemas";
|
|
|
4
4
|
import { EngineStats } from "../../Stats/EngineStats";
|
|
5
5
|
import { BuildGeomeetryLUT } from "./Geometry/BuildGeometryLUT";
|
|
6
6
|
import { ReltionalStateBuilder } from "../State/Reltional/ReltionalStateBuilder";
|
|
7
|
+
import { EngineSettings } from "../../Settings/EngineSettings";
|
|
7
8
|
function recurse(index, current, result, valuePairs) {
|
|
8
9
|
if (index === valuePairs.length) {
|
|
9
10
|
result.push(current.join(","));
|
|
@@ -22,10 +23,17 @@ function getAllCombinations(valuePairs) {
|
|
|
22
23
|
return result;
|
|
23
24
|
}
|
|
24
25
|
function buildScehmas(voxels, models) {
|
|
26
|
+
const totalModelStates = new Map();
|
|
27
|
+
const totalModelRelationalStates = new Map();
|
|
28
|
+
VoxelLUT.models.register("dve_air");
|
|
29
|
+
VoxelLUT.modelsIndex[0] = 0;
|
|
30
|
+
VoxelLUT.modelStateMaps[0] = new Map([[0, 0]]);
|
|
31
|
+
VoxelLUT.modelRelationalStateMaps[0] = new Map([[0, 0]]);
|
|
32
|
+
VoxelLUT.voxelModMaps[0] = new Map([[0, 0]]);
|
|
33
|
+
VoxelLUT.voxelRelationalModMaps[0] = new Map([[0, 0]]);
|
|
25
34
|
//build state schemas
|
|
26
35
|
for (const model of models) {
|
|
27
36
|
VoxelLUT.models.register(model.id);
|
|
28
|
-
//build state schema
|
|
29
37
|
const schemaNodes = [];
|
|
30
38
|
for (const schemaNode of model.stateSchema) {
|
|
31
39
|
const node = {
|
|
@@ -40,6 +48,7 @@ function buildScehmas(voxels, models) {
|
|
|
40
48
|
}
|
|
41
49
|
const stateSchema = new BinarySchema(schemaNodes);
|
|
42
50
|
VoxelSchemas.state.set(model.id, stateSchema);
|
|
51
|
+
totalModelStates.set(model.id, stateSchema.totalStates());
|
|
43
52
|
//build reltional state schema
|
|
44
53
|
const reltionalSchemaNodes = [];
|
|
45
54
|
let bitIndex = 0;
|
|
@@ -54,7 +63,8 @@ function buildScehmas(voxels, models) {
|
|
|
54
63
|
reltionalSchemaNodes.push(node);
|
|
55
64
|
}
|
|
56
65
|
const reltionalStateSchema = new BinarySchema(reltionalSchemaNodes);
|
|
57
|
-
VoxelSchemas.
|
|
66
|
+
VoxelSchemas.relationalState.set(model.id, reltionalStateSchema);
|
|
67
|
+
totalModelRelationalStates.set(model.id, stateSchema.totalStates());
|
|
58
68
|
const reltionalStateBuilder = new ReltionalStateBuilder(reltionalStateSchema, model.relationsSchema);
|
|
59
69
|
VoxelSchemas.reltionalStateBuilder.set(model.id, reltionalStateBuilder);
|
|
60
70
|
}
|
|
@@ -62,8 +72,10 @@ function buildScehmas(voxels, models) {
|
|
|
62
72
|
for (const voxel of voxels) {
|
|
63
73
|
const modelData = voxel.properties["dve_model_data"];
|
|
64
74
|
const trueVoxelId = VoxelLUT.voxelIds.register(voxel.id);
|
|
75
|
+
VoxelLUT.voxelIdToNameMap.set(voxel.id, voxel.name || voxel.id);
|
|
76
|
+
VoxelLUT.voxelNametoIdMap.set(voxel.name || voxel.id, voxel.id);
|
|
65
77
|
VoxelLUT.materialMap[trueVoxelId] = VoxelLUT.material.getNumberId(voxel.properties["dve_rendered_material"] || "dve_solid");
|
|
66
|
-
VoxelLUT.substanceMap[trueVoxelId] = VoxelLUT.
|
|
78
|
+
VoxelLUT.substanceMap[trueVoxelId] = VoxelLUT.substance.getNumberId(voxel.properties["dve_substance"] || "dve_solid");
|
|
67
79
|
if (!modelData)
|
|
68
80
|
continue;
|
|
69
81
|
VoxelLUT.modelsIndex[trueVoxelId] = VoxelLUT.models.getNumberId(modelData.id);
|
|
@@ -84,6 +96,9 @@ function buildScehmas(voxels, models) {
|
|
|
84
96
|
}
|
|
85
97
|
const stateSchema = new BinarySchema(schemaNodes);
|
|
86
98
|
VoxelSchemas.mod.set(voxel.id, stateSchema);
|
|
99
|
+
VoxelLUT.totalVoxelIds +=
|
|
100
|
+
(totalModelStates.get(modelData.id) || 1) *
|
|
101
|
+
(stateSchema.totalStates() || 1);
|
|
87
102
|
//build reltional mod schema
|
|
88
103
|
const reltionalSchemaNodes = [];
|
|
89
104
|
if (modelData.modRelationSchema) {
|
|
@@ -100,13 +115,29 @@ function buildScehmas(voxels, models) {
|
|
|
100
115
|
}
|
|
101
116
|
}
|
|
102
117
|
const reltionalStateSchema = new BinarySchema(reltionalSchemaNodes);
|
|
103
|
-
VoxelSchemas.
|
|
118
|
+
VoxelSchemas.relationalMod.set(voxel.id, reltionalStateSchema);
|
|
119
|
+
VoxelLUT.totalRelationalVoxelIds +=
|
|
120
|
+
(totalModelRelationalStates.get(modelData.id) || 1) *
|
|
121
|
+
(reltionalStateSchema.totalStates() || 1);
|
|
104
122
|
const reltionalModBuilder = new ReltionalStateBuilder(reltionalStateSchema, modelData.modRelationSchema || []);
|
|
105
123
|
VoxelSchemas.reltionalModBuilder.set(voxel.id, reltionalModBuilder);
|
|
106
124
|
}
|
|
125
|
+
VoxelSchemas.buildMaps();
|
|
126
|
+
}
|
|
127
|
+
function getUint16Buffer(size) {
|
|
128
|
+
if (EngineSettings.settings.memoryAndCPU.useSharedMemory)
|
|
129
|
+
return new SharedArrayBuffer(size * 2);
|
|
130
|
+
return new ArrayBuffer(size * 2);
|
|
107
131
|
}
|
|
108
132
|
function buildStatePalette(voxels, models) {
|
|
109
133
|
const modelStateArray = new Map();
|
|
134
|
+
VoxelLUT.totalMods = new Uint16Array(getUint16Buffer(VoxelLUT.voxelIds.size));
|
|
135
|
+
VoxelLUT.totalStates = new Uint16Array(getUint16Buffer(VoxelLUT.voxelIds.size));
|
|
136
|
+
VoxelLUT.voxelIdToTrueId = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
137
|
+
VoxelLUT.voxelIdToState = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
138
|
+
VoxelLUT.voxelIdToMod = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
139
|
+
VoxelLUT.voxelRecordStartIndex = new Uint16Array(getUint16Buffer(VoxelLUT.voxelIds.size));
|
|
140
|
+
VoxelLUT.voxelRecord = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
110
141
|
for (const model of models) {
|
|
111
142
|
const schema = VoxelSchemas.state.get(model.id);
|
|
112
143
|
const valuePairs = [];
|
|
@@ -125,10 +156,15 @@ function buildStatePalette(voxels, models) {
|
|
|
125
156
|
statePalette.push(value);
|
|
126
157
|
}
|
|
127
158
|
modelStateArray.set(model.id, statePalette);
|
|
159
|
+
const stateMap = new Map();
|
|
160
|
+
for (let i = 0; i < statePalette.length; i++) {
|
|
161
|
+
stateMap.set(statePalette[i], i);
|
|
162
|
+
}
|
|
163
|
+
const modelId = VoxelLUT.models.getNumberId(model.id);
|
|
164
|
+
VoxelLUT.modelStateMaps[modelId] = stateMap;
|
|
128
165
|
}
|
|
129
|
-
const finalPalette = [[0, 0, 0]];
|
|
130
|
-
const finalPaletteRecord = [[[0]]];
|
|
131
166
|
let voxelIdCount = 1;
|
|
167
|
+
let voxelRecordStateIndex = 0;
|
|
132
168
|
for (const voxel of voxels) {
|
|
133
169
|
const modelData = voxel.properties["dve_model_data"];
|
|
134
170
|
if (!modelData)
|
|
@@ -157,32 +193,41 @@ function buildStatePalette(voxels, models) {
|
|
|
157
193
|
modPalette.push(0);
|
|
158
194
|
}
|
|
159
195
|
const voxelId = VoxelLUT.voxelIds.getNumberId(voxel.id);
|
|
196
|
+
const modMap = new Map();
|
|
197
|
+
for (let i = 0; i < modPalette.length; i++) {
|
|
198
|
+
modMap.set(modPalette[i], i);
|
|
199
|
+
}
|
|
200
|
+
VoxelLUT.voxelModMaps[voxelId] = modMap;
|
|
160
201
|
const statePalette = modelStateArray.get(modelData.id);
|
|
161
202
|
VoxelLUT.totalStates[voxelId] = statePalette.length;
|
|
162
203
|
VoxelLUT.totalMods[voxelId] = modPalette.length;
|
|
163
|
-
|
|
204
|
+
VoxelLUT.voxelRecordStartIndex[voxelId] = voxelRecordStateIndex;
|
|
164
205
|
for (let modIndex = 0; modIndex < modPalette.length; modIndex++) {
|
|
165
|
-
finalPaletteRecord[voxelId][modPalette[modIndex]] = new Array(statePalette.length).fill(-1);
|
|
166
206
|
for (let stateIndex = 0; stateIndex < statePalette.length; stateIndex++) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
finalPaletteRecord[voxelId][modPalette[modIndex]][statePalette[stateIndex]] = voxelIdCount;
|
|
173
|
-
VoxelLUT.voxelIdToModelState[voxelIdCount] = statePalette[stateIndex];
|
|
207
|
+
VoxelLUT.voxelIdToTrueId[voxelIdCount] = voxelId;
|
|
208
|
+
VoxelLUT.voxelIdToState[voxelIdCount] = statePalette[stateIndex];
|
|
209
|
+
VoxelLUT.voxelIdToMod[voxelIdCount] = modPalette[modIndex];
|
|
210
|
+
VoxelLUT.voxelRecord[voxelRecordStateIndex +
|
|
211
|
+
VoxelLUT.getStateIndex(stateIndex, modIndex, statePalette.length)] = voxelIdCount;
|
|
174
212
|
voxelIdCount++;
|
|
175
213
|
}
|
|
176
214
|
}
|
|
215
|
+
voxelRecordStateIndex +=
|
|
216
|
+
(modPalette.length || 1) * (statePalette.length || 1);
|
|
177
217
|
}
|
|
178
|
-
EngineStats.palette.paletteSize =
|
|
179
|
-
VoxelLUT.voxels = finalPalette;
|
|
180
|
-
VoxelLUT.voxelRecord = finalPaletteRecord;
|
|
218
|
+
EngineStats.palette.paletteSize = VoxelLUT.totalVoxelIds;
|
|
181
219
|
}
|
|
182
220
|
function buildReltionalStatePalette(voxels, models) {
|
|
183
221
|
const modelStateArray = new Map();
|
|
222
|
+
VoxelLUT.totalReltionalMods = new Uint16Array(getUint16Buffer(VoxelLUT.voxelIds.size));
|
|
223
|
+
VoxelLUT.totalReltionalStates = new Uint16Array(getUint16Buffer(VoxelLUT.voxelIds.size));
|
|
224
|
+
VoxelLUT.relationalVoxelIdToTrueId = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
225
|
+
VoxelLUT.relationalVoxelIdToState = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
226
|
+
VoxelLUT.relationalVoxelIdToMod = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
227
|
+
VoxelLUT.relationalVoxelRecordStartIndex = new Uint16Array(getUint16Buffer(VoxelLUT.voxelIds.size));
|
|
228
|
+
VoxelLUT.relationalVoxelRecord = new Uint16Array(getUint16Buffer(VoxelLUT.totalVoxelIds));
|
|
184
229
|
for (const model of models) {
|
|
185
|
-
const schema = VoxelSchemas.
|
|
230
|
+
const schema = VoxelSchemas.relationalState.get(model.id);
|
|
186
231
|
const valuePairs = [];
|
|
187
232
|
for (const node of schema.nodes) {
|
|
188
233
|
valuePairs.push([node.name, ["false", "true"]]);
|
|
@@ -194,15 +239,20 @@ function buildReltionalStatePalette(voxels, models) {
|
|
|
194
239
|
statePalette.push(value);
|
|
195
240
|
}
|
|
196
241
|
modelStateArray.set(model.id, statePalette);
|
|
242
|
+
const stateMap = new Map();
|
|
243
|
+
for (let i = 0; i < statePalette.length; i++) {
|
|
244
|
+
stateMap.set(statePalette[i], i);
|
|
245
|
+
}
|
|
246
|
+
const modelId = VoxelLUT.models.getNumberId(model.id);
|
|
247
|
+
VoxelLUT.modelRelationalStateMaps[modelId] = stateMap;
|
|
197
248
|
}
|
|
198
|
-
const finalPalette = [[0, 0, 0]];
|
|
199
|
-
const finalPaletteRecord = [[[0]]];
|
|
200
249
|
let voxelIdCount = 1;
|
|
250
|
+
let voxelRecordStateIndex = 0;
|
|
201
251
|
for (const voxel of voxels) {
|
|
202
252
|
const modelData = voxel.properties["dve_model_data"];
|
|
203
253
|
if (!modelData)
|
|
204
254
|
continue;
|
|
205
|
-
const schema = VoxelSchemas.
|
|
255
|
+
const schema = VoxelSchemas.relationalMod.get(voxel.id);
|
|
206
256
|
const valuePairs = [];
|
|
207
257
|
if (schema) {
|
|
208
258
|
for (const node of schema.nodes) {
|
|
@@ -221,26 +271,30 @@ function buildReltionalStatePalette(voxels, models) {
|
|
|
221
271
|
modPalette.push(0);
|
|
222
272
|
}
|
|
223
273
|
const voxelId = VoxelLUT.voxelIds.getNumberId(voxel.id);
|
|
274
|
+
const modMap = new Map();
|
|
275
|
+
for (let i = 0; i < modPalette.length; i++) {
|
|
276
|
+
modMap.set(modPalette[i], i);
|
|
277
|
+
}
|
|
278
|
+
VoxelLUT.voxelRelationalModMaps[voxelId] = modMap;
|
|
224
279
|
const statePalette = modelStateArray.get(modelData.id);
|
|
225
280
|
VoxelLUT.totalReltionalStates[voxelId] = statePalette.length;
|
|
226
281
|
VoxelLUT.totalReltionalMods[voxelId] = modPalette.length;
|
|
227
|
-
|
|
282
|
+
VoxelLUT.relationalVoxelRecordStartIndex[voxelId] = voxelRecordStateIndex;
|
|
228
283
|
for (let modIndex = 0; modIndex < modPalette.length; modIndex++) {
|
|
229
|
-
finalPaletteRecord[voxelId][modPalette[modIndex]] = new Array(statePalette.length).fill(-1);
|
|
230
284
|
for (let stateIndex = 0; stateIndex < statePalette.length; stateIndex++) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
statePalette[stateIndex]
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
285
|
+
VoxelLUT.relationalVoxelIdToTrueId[voxelIdCount] = voxelId;
|
|
286
|
+
VoxelLUT.relationalVoxelIdToState[voxelIdCount] =
|
|
287
|
+
statePalette[stateIndex];
|
|
288
|
+
VoxelLUT.relationalVoxelIdToMod[voxelIdCount] = modPalette[modIndex];
|
|
289
|
+
VoxelLUT.relationalVoxelRecord[voxelRecordStateIndex +
|
|
290
|
+
VoxelLUT.getStateIndex(stateIndex, modIndex, statePalette.length)] = voxelIdCount;
|
|
237
291
|
voxelIdCount++;
|
|
238
292
|
}
|
|
239
293
|
}
|
|
294
|
+
voxelRecordStateIndex +=
|
|
295
|
+
(modPalette.length || 1) * (statePalette.length || 1);
|
|
240
296
|
}
|
|
241
|
-
EngineStats.palette.reltionalPaletteSize =
|
|
242
|
-
VoxelLUT.reltioanlVoxels = finalPalette;
|
|
243
|
-
VoxelLUT.reltionalVoxelRecord = finalPaletteRecord;
|
|
297
|
+
EngineStats.palette.reltionalPaletteSize = VoxelLUT.totalRelationalVoxelIds;
|
|
244
298
|
}
|
|
245
299
|
export function BuildLUTs(materials, substances, voxels, geometry, models) {
|
|
246
300
|
for (const material of materials) {
|
|
@@ -252,6 +306,10 @@ export function BuildLUTs(materials, substances, voxels, geometry, models) {
|
|
|
252
306
|
buildScehmas(voxels, models);
|
|
253
307
|
buildStatePalette(voxels, models);
|
|
254
308
|
buildReltionalStatePalette(voxels, models);
|
|
309
|
+
VoxelLUT.totalCombinedIds =
|
|
310
|
+
VoxelLUT.totalVoxelIds * VoxelLUT.totalRelationalVoxelIds;
|
|
311
|
+
VoxelLUT.geometryIndex = new Uint16Array(getUint16Buffer(VoxelLUT.totalCombinedIds));
|
|
312
|
+
VoxelLUT.geometryInputsIndex = new Uint16Array(getUint16Buffer(VoxelLUT.totalCombinedIds));
|
|
255
313
|
const { finalModelStateMap, finalModelConditionalMap, finalVoxelStateInputMap, finalVoxelConditionalInputMap, } = BuildGeomeetryLUT(voxels, geometry, models);
|
|
256
314
|
for (const voxel of voxels) {
|
|
257
315
|
const voxelModelData = voxel.properties["dve_model_data"];
|
|
@@ -261,9 +319,9 @@ export function BuildLUTs(materials, substances, voxels, geometry, models) {
|
|
|
261
319
|
const modelStateMap = finalModelStateMap.get(voxelModelData.id);
|
|
262
320
|
const modelConditonalMap = finalModelConditionalMap.get(voxelModelData.id);
|
|
263
321
|
const stateSchema = VoxelSchemas.state.get(voxelModelData.id);
|
|
264
|
-
const reltionalStateSchema = VoxelSchemas.
|
|
322
|
+
const reltionalStateSchema = VoxelSchemas.relationalState.get(voxelModelData.id);
|
|
265
323
|
const modSchema = VoxelSchemas.mod.get(voxel.id);
|
|
266
|
-
const reltionalModSchema = VoxelSchemas.
|
|
324
|
+
const reltionalModSchema = VoxelSchemas.relationalMod.get(voxel.id);
|
|
267
325
|
const inputs = finalVoxelStateInputMap.get(voxel.id);
|
|
268
326
|
const conditonalInputs = finalVoxelConditionalInputMap.get(voxel.id);
|
|
269
327
|
for (const modKey in voxelModelData.inputs) {
|
|
@@ -282,22 +340,18 @@ export function BuildLUTs(materials, substances, voxels, geometry, models) {
|
|
|
282
340
|
: 0;
|
|
283
341
|
const voxelId = VoxelLUT.getVoxelId(trueVoxelId, stateValue, modValue);
|
|
284
342
|
const reltionalVoxelId = VoxelLUT.getReltionalVoxelId(trueVoxelId, reltionalStateValue, reltionalModValue);
|
|
285
|
-
VoxelLUT.geometryIndex[voxelId] ??= [];
|
|
286
|
-
VoxelLUT.geometryInputsIndex[voxelId] ??= [];
|
|
287
343
|
const totalReltionalStates = reltionalStateSchema
|
|
288
344
|
? Math.pow(2, reltionalStateSchema.nodes.length)
|
|
289
345
|
: 0;
|
|
290
346
|
if (!totalReltionalStates) {
|
|
291
|
-
VoxelLUT.geometryIndex[voxelId
|
|
292
|
-
|
|
293
|
-
VoxelLUT.geometryInputsIndex[voxelId][reltionalVoxelId] =
|
|
294
|
-
inputs[modKey][stateKey];
|
|
347
|
+
VoxelLUT.geometryIndex[VoxelLUT.getStateIndex(voxelId, reltionalVoxelId, VoxelLUT.totalVoxelIds)] = modelStateMap[stateKey];
|
|
348
|
+
VoxelLUT.geometryInputsIndex[VoxelLUT.getStateIndex(voxelId, reltionalVoxelId, VoxelLUT.totalVoxelIds)] = inputs[modKey][stateKey];
|
|
295
349
|
}
|
|
296
350
|
else {
|
|
297
351
|
const baseReltionalVoxelId = VoxelLUT.getReltionalVoxelId(trueVoxelId, 0, 0);
|
|
298
352
|
for (let i = baseReltionalVoxelId; i < baseReltionalVoxelId + totalReltionalStates; i++) {
|
|
299
|
-
VoxelLUT.geometryIndex[voxelId
|
|
300
|
-
VoxelLUT.geometryInputsIndex[voxelId
|
|
353
|
+
VoxelLUT.geometryIndex[VoxelLUT.getStateIndex(voxelId, i, VoxelLUT.totalVoxelIds)] = modelStateMap[stateKey];
|
|
354
|
+
VoxelLUT.geometryInputsIndex[VoxelLUT.getStateIndex(voxelId, i, VoxelLUT.totalVoxelIds)] = inputs[modKey][stateKey];
|
|
301
355
|
}
|
|
302
356
|
}
|
|
303
357
|
}
|
|
@@ -350,8 +404,9 @@ export function BuildLUTs(materials, substances, voxels, geometry, models) {
|
|
|
350
404
|
}
|
|
351
405
|
}
|
|
352
406
|
}
|
|
353
|
-
VoxelLUT.
|
|
354
|
-
VoxelLUT.conditionalGeometryIndex[
|
|
407
|
+
const modelId = VoxelLUT.models.getNumberId(voxelModelData.id);
|
|
408
|
+
VoxelLUT.conditionalGeometryIndex[modelId] ??= [];
|
|
409
|
+
VoxelLUT.conditionalGeometryIndex[modelId].push([
|
|
355
410
|
modelConditonalMap[stateKey],
|
|
356
411
|
stateValue,
|
|
357
412
|
enabledArray,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { VoxelFaces } from "../../../Math";
|
|
2
1
|
import { QuadVerticiesArray, } from "../../../Mesher/Geometry/Geometry.types";
|
|
3
2
|
import { Matrix2x2Like, Vec2ArrayLike, AMath, } from "@amodx/math";
|
|
4
3
|
function getInterpolationWeights(x, y, flip = false) {
|
|
@@ -14,29 +13,29 @@ export function getVertexWeights(face, x, y, z) {
|
|
|
14
13
|
let flip = false;
|
|
15
14
|
let u, v;
|
|
16
15
|
switch (face) {
|
|
17
|
-
case VoxelFaces.Up
|
|
16
|
+
case 0 /* VoxelFaces.Up */:
|
|
18
17
|
u = x;
|
|
19
18
|
v = z;
|
|
20
19
|
break;
|
|
21
|
-
case VoxelFaces.Down
|
|
20
|
+
case 1 /* VoxelFaces.Down */:
|
|
22
21
|
u = x;
|
|
23
22
|
v = z;
|
|
24
23
|
flip = true;
|
|
25
24
|
break;
|
|
26
|
-
case VoxelFaces.North
|
|
25
|
+
case 2 /* VoxelFaces.North */:
|
|
27
26
|
u = x;
|
|
28
27
|
v = y;
|
|
29
28
|
flip = true;
|
|
30
29
|
break;
|
|
31
|
-
case VoxelFaces.South
|
|
30
|
+
case 3 /* VoxelFaces.South */:
|
|
32
31
|
u = x;
|
|
33
32
|
v = y;
|
|
34
33
|
break;
|
|
35
|
-
case VoxelFaces.East
|
|
34
|
+
case 4 /* VoxelFaces.East */:
|
|
36
35
|
u = z;
|
|
37
36
|
v = y;
|
|
38
37
|
break;
|
|
39
|
-
case VoxelFaces.West
|
|
38
|
+
case 5 /* VoxelFaces.West */:
|
|
40
39
|
u = z;
|
|
41
40
|
v = y;
|
|
42
41
|
flip = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelGeometryLinkData } from "
|
|
1
|
+
import { VoxelGeometryLinkData } from "../../../Models/VoxelModel.types";
|
|
2
2
|
import { VoxelGeometryData } from "../../../Geometry/VoxelGeometry.types";
|
|
3
3
|
import { CompiledGeometryNodes } from "../../../../Mesher/Voxels/Models/Nodes/Types/GeometryNode.types";
|
|
4
4
|
export declare function BuildCompiled(geoLink: VoxelGeometryLinkData, geometry: VoxelGeometryData): CompiledGeometryNodes[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelModelData } from "
|
|
1
|
+
import { VoxelModelData } from "../../../Models/VoxelModel.types";
|
|
2
2
|
import { VoxelModelInputs } from "../GeometryLUT.types";
|
|
3
3
|
import { VoxelBoxGeometryNode, VoxelGeometryData } from "../../../Geometry/VoxelGeometry.types";
|
|
4
4
|
import { VoxelGeometryTransform } from "../../../../Mesher/Geometry/Geometry.types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelModelData } from "
|
|
1
|
+
import { VoxelModelData } from "../../../Models/VoxelModel.types";
|
|
2
2
|
import { VoxelModelInputs } from "../GeometryLUT.types";
|
|
3
3
|
import { VoxelCustomGeometryNode, VoxelGeometryData } from "../../../Geometry/VoxelGeometry.types";
|
|
4
4
|
import { VoxelGeometryTransform } from "../../../../Mesher/Geometry/Geometry.types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelModelData } from "
|
|
1
|
+
import { VoxelModelData } from "../../../Models/VoxelModel.types";
|
|
2
2
|
import { VoxelModelInputs } from "../GeometryLUT.types";
|
|
3
3
|
import { BaseVoxelQuadData, VoxelGeometryData } from "../../../Geometry/VoxelGeometry.types";
|
|
4
4
|
import { VoxelGeometryTransform } from "../../../../Mesher/Geometry/Geometry.types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VoxelModelData } from "
|
|
1
|
+
import { VoxelModelData } from "../../../Models/VoxelModel.types";
|
|
2
2
|
import { VoxelModelInputs } from "../GeometryLUT.types";
|
|
3
3
|
import { BaseVoxelTriangleData, VoxelGeometryData } from "../../../Geometry/VoxelGeometry.types";
|
|
4
4
|
import { VoxelGeometryTransform } from "../../../../Mesher/Geometry/Geometry.types";
|
|
@@ -93,6 +93,9 @@ export function BuildTriangleInputs(args, transform, data, tri, model, geometry)
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
else if (Array.isArray(tri.uv)) {
|
|
97
|
+
uvs = tri.uv;
|
|
98
|
+
}
|
|
96
99
|
inputs[ArgIndexes.UVs] = uvs;
|
|
97
100
|
/**@TODO updae the tri uvs if it is rotated or transformed */
|
|
98
101
|
if (inputs[ArgIndexes.Rotation]) {
|
|
@@ -115,7 +115,9 @@ export class VoxelIndex {
|
|
|
115
115
|
}
|
|
116
116
|
getStateFromRawData(data) {
|
|
117
117
|
const [id, light, secondary] = data;
|
|
118
|
-
const
|
|
118
|
+
const trueId = VoxelLUT.voxelIdToTrueId[id];
|
|
119
|
+
const state = VoxelLUT.voxelIdToState[id];
|
|
120
|
+
const mod = VoxelLUT.voxelIdToMod[id];
|
|
119
121
|
const conatiner = this.states.get(VoxelLUT.voxelIds.getStringId(trueId));
|
|
120
122
|
if (!conatiner)
|
|
121
123
|
return false;
|
package/Voxels/InitVoxelData.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, candlesModel, carpetGeometry, carpetModel, chainGeometry, chainModel, fence, fenceEastWest, fenceNorthsouth, fencePost, leverGeometry, leverModel, } from "./Models/Defaults/Examples";
|
|
1
|
+
import { candlesGeometry1, candlesGeometry2, candlesGeometry3, candlesGeometry4, candlesModel, carpetGeometry, carpetModel, chainGeometry, chainModel, fence, fenceEastWest, fenceNorthsouth, fencePost, leverGeometry, leverModel, diamondGeometry, diamondModel } from "./Models/Defaults/Examples";
|
|
2
2
|
import { cube, halfDownCube, eighthCube, quaterCubeSouthNorth, quaterCubeUpDown, quaterCubeWestEast, halfSouthCube, halfWestCube, } from "./Models/Defaults/CubeVoxelGeometry";
|
|
3
3
|
import { orientedCube, pillarCube, simpleCube, simpleNoCulledCube, simpleHalfCube, simpleTransparentCube, fullTextureCube, } from "./Models/Defaults/CubeVoxelModels";
|
|
4
4
|
import { diagonalFlatPanelEastWest, diagonalFlatPanelWestEast, thinPanel, } from "./Models/Defaults/PanelVoxelGeometry";
|
|
@@ -36,6 +36,7 @@ const geometry = [
|
|
|
36
36
|
liquidGeometry,
|
|
37
37
|
...leverGeometry,
|
|
38
38
|
...farmGeometry,
|
|
39
|
+
diamondGeometry
|
|
39
40
|
];
|
|
40
41
|
const models = [
|
|
41
42
|
simpleCube,
|
|
@@ -56,6 +57,7 @@ const models = [
|
|
|
56
57
|
fence,
|
|
57
58
|
liquidModel,
|
|
58
59
|
...farmModels,
|
|
60
|
+
diamondModel
|
|
59
61
|
];
|
|
60
62
|
export function InitVoxelData(data) {
|
|
61
63
|
const lightData = new VoxelLightData();
|
|
@@ -2,7 +2,6 @@ import { Vector3Like } from "@amodx/math";
|
|
|
2
2
|
import { VoxelPickResult } from "../VoxelPickResult";
|
|
3
3
|
import { closestUnitNormal, closestVoxelFace, } from "../../../Math/UtilFunctions";
|
|
4
4
|
import { BoundingBox } from "@amodx/math/Geometry/Bounds/BoundingBox";
|
|
5
|
-
const epsilon = 1e-5;
|
|
6
5
|
const bounds = new BoundingBox();
|
|
7
6
|
export default function PickVoxel(cursor, rayStart, rayDirection, rayLength) {
|
|
8
7
|
const rayDir = Vector3Like.Create(...rayDirection);
|
|
@@ -11,10 +10,9 @@ export default function PickVoxel(cursor, rayStart, rayDirection, rayLength) {
|
|
|
11
10
|
? cursor.volumePosition
|
|
12
11
|
: Vector3Like.Create();
|
|
13
12
|
bounds.setMinMax(Vector3Like.Add(cursor.volumeBounds.min, offset), Vector3Like.Add(cursor.volumeBounds.max, offset));
|
|
14
|
-
const
|
|
15
|
-
const invDir = Vector3Like.Divide(Vector3Like.Create(1, 1, 1), safeDirection);
|
|
13
|
+
const invDir = Vector3Like.Divide(Vector3Like.Create(1, 1, 1), rayDir);
|
|
16
14
|
const tDelta = Vector3Like.Create(Math.abs(invDir.x), Math.abs(invDir.y), Math.abs(invDir.z));
|
|
17
|
-
const tEnter = bounds.rayIntersection(rayOrigin,
|
|
15
|
+
const tEnter = bounds.rayIntersection(rayOrigin, rayDir);
|
|
18
16
|
if (!isFinite(tEnter)) {
|
|
19
17
|
return null;
|
|
20
18
|
}
|
|
@@ -66,7 +64,7 @@ export default function PickVoxel(cursor, rayStart, rayDirection, rayLength) {
|
|
|
66
64
|
normal.y = 0;
|
|
67
65
|
normal.z = -step.z;
|
|
68
66
|
}
|
|
69
|
-
if (traveled
|
|
67
|
+
if (traveled > maxDist) {
|
|
70
68
|
break;
|
|
71
69
|
}
|
|
72
70
|
}
|
|
@@ -3,7 +3,6 @@ import PickVoxel from "./PickVoxel";
|
|
|
3
3
|
import { WorldSpaces } from "../../../World/WorldSpaces";
|
|
4
4
|
import { WorldRegister } from "../../../World/WorldRegister";
|
|
5
5
|
import { SectorCursor } from "../../../World/Cursor/SectorCursor";
|
|
6
|
-
const epsilon = 1e-5;
|
|
7
6
|
/**# PickVoxelWorld
|
|
8
7
|
* Will pick the voxel world and make sure each sector is available before picking it.
|
|
9
8
|
*
|
|
@@ -11,16 +10,15 @@ const epsilon = 1e-5;
|
|
|
11
10
|
*/
|
|
12
11
|
export default async function PickVoxelWorld(cursor, rayStart, rayDirection, rayLength) {
|
|
13
12
|
let t = 0;
|
|
14
|
-
const d =
|
|
13
|
+
const d = 4;
|
|
15
14
|
const rayDir = Vector3Like.Create(...rayDirection);
|
|
16
15
|
const rayPosition = Vector3Like.Create();
|
|
17
16
|
const visited = new Set();
|
|
18
17
|
const sectorCursor = new SectorCursor();
|
|
19
|
-
const safeDirection = Vector3Like.Create(Math.abs(rayDir.x) < epsilon ? epsilon : rayDir.x, Math.abs(rayDir.y) < epsilon ? epsilon : rayDir.y, Math.abs(rayDir.z) < epsilon ? epsilon : rayDir.z);
|
|
20
18
|
while (t < rayLength) {
|
|
21
|
-
rayPosition.x = rayStart[0] + t *
|
|
22
|
-
rayPosition.y = rayStart[1] + t *
|
|
23
|
-
rayPosition.z = rayStart[2] + t *
|
|
19
|
+
rayPosition.x = rayStart[0] + t * rayDir.x;
|
|
20
|
+
rayPosition.y = rayStart[1] + t * rayDir.y;
|
|
21
|
+
rayPosition.z = rayStart[2] + t * rayDir.z;
|
|
24
22
|
t += d;
|
|
25
23
|
const { x, y, z } = WorldSpaces.sector.transformPosition(rayPosition);
|
|
26
24
|
if (!WorldSpaces.world.inBounds(x, y, z))
|
|
@@ -17,3 +17,5 @@ export declare const leverGeometryBase: VoxelGeometryData;
|
|
|
17
17
|
export declare const leverGeometryDown: VoxelGeometryData;
|
|
18
18
|
export declare const leverGeometry: VoxelGeometryData[];
|
|
19
19
|
export declare const leverModel: VoxelModelData;
|
|
20
|
+
export declare const diamondGeometry: VoxelGeometryData;
|
|
21
|
+
export declare const diamondModel: VoxelModelData;
|
|
@@ -796,7 +796,7 @@ export const candlesGeometry4 = {
|
|
|
796
796
|
[9, 3, 7],
|
|
797
797
|
[7, 3, 9],
|
|
798
798
|
],
|
|
799
|
-
uv: [14, 14,
|
|
799
|
+
uv: [14, 14, 16, 16],
|
|
800
800
|
texture: "@candleTexture",
|
|
801
801
|
doubleSided: true,
|
|
802
802
|
},
|
|
@@ -808,7 +808,7 @@ export const candlesGeometry4 = {
|
|
|
808
808
|
[7, 3, 7],
|
|
809
809
|
[9, 3, 9],
|
|
810
810
|
],
|
|
811
|
-
uv: [14, 14,
|
|
811
|
+
uv: [14, 14, 16, 16],
|
|
812
812
|
texture: "@candleTexture",
|
|
813
813
|
doubleSided: true,
|
|
814
814
|
},
|
|
@@ -2073,3 +2073,152 @@ export const leverModel = {
|
|
|
2073
2073
|
],
|
|
2074
2074
|
},
|
|
2075
2075
|
};
|
|
2076
|
+
export const diamondGeometry = {
|
|
2077
|
+
id: "dve_diamond",
|
|
2078
|
+
doNotBuildRules: true,
|
|
2079
|
+
arguments: {
|
|
2080
|
+
texture: {
|
|
2081
|
+
type: "texture",
|
|
2082
|
+
},
|
|
2083
|
+
},
|
|
2084
|
+
nodes: [
|
|
2085
|
+
//top
|
|
2086
|
+
{
|
|
2087
|
+
type: "triangle",
|
|
2088
|
+
points: [
|
|
2089
|
+
[0.5, 0.5, 0],
|
|
2090
|
+
[0.5, 1, 0.5],
|
|
2091
|
+
[0, 0.5, 0.5],
|
|
2092
|
+
],
|
|
2093
|
+
texture: "@texture",
|
|
2094
|
+
uv: [
|
|
2095
|
+
[0.5, 0.5],
|
|
2096
|
+
[0.5, 1],
|
|
2097
|
+
[0, 0.5],
|
|
2098
|
+
],
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
type: "triangle",
|
|
2102
|
+
points: [
|
|
2103
|
+
[1, 0.5, 0.5],
|
|
2104
|
+
[0.5, 1, 0.5],
|
|
2105
|
+
[0.5, 0.5, 0],
|
|
2106
|
+
],
|
|
2107
|
+
texture: "@texture",
|
|
2108
|
+
uv: [
|
|
2109
|
+
[1, 0.5],
|
|
2110
|
+
[0.5, 1],
|
|
2111
|
+
[0.5, 0.5],
|
|
2112
|
+
],
|
|
2113
|
+
},
|
|
2114
|
+
{
|
|
2115
|
+
type: "triangle",
|
|
2116
|
+
points: [
|
|
2117
|
+
[0.5, 0.5, 1],
|
|
2118
|
+
[0.5, 1, 0.5],
|
|
2119
|
+
[1, 0.5, 0.5],
|
|
2120
|
+
],
|
|
2121
|
+
texture: "@texture",
|
|
2122
|
+
uv: [
|
|
2123
|
+
[0.5, 0.5],
|
|
2124
|
+
[1, 0.5],
|
|
2125
|
+
[0.5, 1],
|
|
2126
|
+
],
|
|
2127
|
+
},
|
|
2128
|
+
{
|
|
2129
|
+
type: "triangle",
|
|
2130
|
+
points: [
|
|
2131
|
+
[0, 0.5, 0.5],
|
|
2132
|
+
[0.5, 1, 0.5],
|
|
2133
|
+
[0.5, 0.5, 1],
|
|
2134
|
+
],
|
|
2135
|
+
texture: "@texture",
|
|
2136
|
+
uv: [
|
|
2137
|
+
[0, 0.5],
|
|
2138
|
+
[0.5, 1],
|
|
2139
|
+
[0.5, 0.5],
|
|
2140
|
+
],
|
|
2141
|
+
},
|
|
2142
|
+
//bottom
|
|
2143
|
+
{
|
|
2144
|
+
type: "triangle",
|
|
2145
|
+
points: [
|
|
2146
|
+
[0, 0.5, 0.5],
|
|
2147
|
+
[0.5, 0, 0.5],
|
|
2148
|
+
[0.5, 0.5, 0],
|
|
2149
|
+
],
|
|
2150
|
+
texture: "@texture",
|
|
2151
|
+
uv: [
|
|
2152
|
+
[0, 0.5],
|
|
2153
|
+
[0.5, 1],
|
|
2154
|
+
[0.5, 0.5],
|
|
2155
|
+
],
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
type: "triangle",
|
|
2159
|
+
points: [
|
|
2160
|
+
[0.5, 0.5, 0],
|
|
2161
|
+
[0.5, 0, 0.5],
|
|
2162
|
+
[1, 0.5, 0.5],
|
|
2163
|
+
],
|
|
2164
|
+
texture: "@texture",
|
|
2165
|
+
uv: [
|
|
2166
|
+
[0.5, 0.5],
|
|
2167
|
+
[0.5, 1],
|
|
2168
|
+
[1, 0.5],
|
|
2169
|
+
],
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
type: "triangle",
|
|
2173
|
+
points: [
|
|
2174
|
+
[1, 0.5, 0.5],
|
|
2175
|
+
[0.5, 0, 0.5],
|
|
2176
|
+
[0.5, 0.5, 1],
|
|
2177
|
+
],
|
|
2178
|
+
texture: "@texture",
|
|
2179
|
+
uv: [
|
|
2180
|
+
[0.5, 1],
|
|
2181
|
+
[1, 0.5],
|
|
2182
|
+
[0.5, 0.5],
|
|
2183
|
+
],
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
type: "triangle",
|
|
2187
|
+
points: [
|
|
2188
|
+
[0.5, 0.5, 1],
|
|
2189
|
+
[0.5, 0, 0.5],
|
|
2190
|
+
[0, 0.5, 0.5],
|
|
2191
|
+
],
|
|
2192
|
+
texture: "@texture",
|
|
2193
|
+
uv: [
|
|
2194
|
+
[0.5, 0.5],
|
|
2195
|
+
[0.5, 1],
|
|
2196
|
+
[0, 0.5],
|
|
2197
|
+
],
|
|
2198
|
+
},
|
|
2199
|
+
],
|
|
2200
|
+
};
|
|
2201
|
+
export const diamondModel = {
|
|
2202
|
+
id: "dve_diamond",
|
|
2203
|
+
relationsSchema: [],
|
|
2204
|
+
stateSchema: [],
|
|
2205
|
+
arguments: {
|
|
2206
|
+
texture: {
|
|
2207
|
+
type: "texture",
|
|
2208
|
+
},
|
|
2209
|
+
},
|
|
2210
|
+
conditonalNodes: {},
|
|
2211
|
+
properties: {
|
|
2212
|
+
dve_placing_strategy: "*",
|
|
2213
|
+
},
|
|
2214
|
+
stateNodes: {
|
|
2215
|
+
"*": [
|
|
2216
|
+
{
|
|
2217
|
+
geometryId: "dve_diamond",
|
|
2218
|
+
inputs: {
|
|
2219
|
+
texture: "@texture",
|
|
2220
|
+
},
|
|
2221
|
+
},
|
|
2222
|
+
],
|
|
2223
|
+
},
|
|
2224
|
+
};
|