@divinevoxel/vlox 0.0.73 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Contexts/Base/Remote/InitDataSync.js +4 -0
- package/Contexts/Base/Remote/InitWorldDataSync.js +1 -1
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +1 -0
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -0
- package/Init/StartConstructor.js +2 -0
- package/Math/index.d.ts +5 -1
- package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
- package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
- package/Mesher/Functions/MeshSection.d.ts +1 -1
- package/Mesher/Functions/MeshSection.js +15 -22
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
- package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
- package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +1 -1
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +118 -197
- package/Mesher/Geomtry/VoxelMesh.js +2 -2
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +8 -70
- package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +18 -183
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
- package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
- package/Mesher/Geomtry/VoxelMeshBuffers.js +2 -2
- package/Mesher/InitTask.js +5 -1
- package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
- package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
- package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
- package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +7 -7
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +22 -25
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
- package/Mesher/Models/VoxelConstructor.d.ts +3 -3
- package/Mesher/Models/VoxelConstructor.js +8 -8
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
- package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -9
- package/Mesher/Models/VoxelModelBuilder.js +1 -8
- package/Mesher/Types/Mesher.types.d.ts +1 -0
- package/Models/Defaults/CubeVoxelModels.js +16 -39
- package/Models/Defaults/LiquidVoxelModel.js +3 -3
- package/Models/Defaults/PanelVoxelModels.js +10 -36
- package/Models/Defaults/StairVoxelModel.js +6 -21
- package/Models/Examples.js +23 -44
- package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
- package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
- package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
- package/Models/Rules/Functions/BuildFinalInputs.js +13 -13
- package/Models/Rules/VoxelModelRuleBuilderRegister.js +8 -8
- package/Models/VoxelModel.types.d.ts +3 -3
- package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
- package/Renderer/InitTasks.js +1 -9
- package/Renderer/MeshManager.d.ts +1 -1
- package/Renderer/MeshManager.js +24 -23
- package/Renderer/MeshRegister.d.ts +5 -5
- package/Renderer/MeshRegister.js +2 -2
- package/Settings/EngineSettings.d.ts +1 -0
- package/Settings/EngineSettings.js +6 -3
- package/Settings/EngineSettings.types.d.ts +7 -21
- package/Settings/EngineSettings.types.js +6 -14
- package/Tasks/Logic/InitTasks.d.ts +1 -0
- package/Tasks/Logic/InitTasks.js +10 -0
- package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
- package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
- package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
- package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
- package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
- package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
- package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
- package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
- package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
- package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
- package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
- package/Tasks/Propagation/InitTasks.js +4 -4
- package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
- package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
- package/Tasks/Tasks.types.d.ts +2 -2
- package/Tasks/TasksIds.d.ts +2 -1
- package/Tasks/TasksIds.js +1 -0
- package/Tasks/Update/Common.d.ts +3 -0
- package/Tasks/Update/Common.js +41 -0
- package/Tasks/Update/EreaseUpdate.d.ts +3 -0
- package/Tasks/Update/EreaseUpdate.js +66 -0
- package/Tasks/Update/InitTasks.d.ts +2 -2
- package/Tasks/Update/InitTasks.js +3 -1
- package/Tasks/Update/PaintUpdate.d.ts +3 -0
- package/Tasks/Update/PaintUpdate.js +89 -0
- package/Tasks/Update/VoxelUpdate.d.ts +2 -5
- package/Tasks/Update/VoxelUpdate.js +5 -147
- package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +15 -7
- package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +20 -7
- package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
- package/Tasks/WorldGeneration/WorldGenBrush.js +2 -2
- package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
- package/Templates/Functions/CreateTemplate.d.ts +1 -1
- package/Tools/Brush/AdvancedBrushTool.js +1 -1
- package/Tools/Brush/Brush.d.ts +2 -2
- package/Tools/Brush/Brush.js +1 -1
- package/Tools/Tasks/TasksTool.d.ts +1 -0
- package/Tools/Tasks/TasksTool.js +2 -0
- package/Util/Binary/BinaryBuffer.d.ts +17 -11
- package/Util/Binary/BinaryBuffer.js +65 -59
- package/Util/Binary/BinaryTree.d.ts +46 -0
- package/Util/Binary/BinaryTree.js +104 -0
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +7 -2
- package/Voxels/Cursor/VoxelCursor.interface.js +46 -2
- package/Voxels/Cursor/VoxelLightData.js +1 -1
- package/Voxels/Data/VoxelTag.types.d.ts +17 -2
- package/Voxels/Data/VoxelTag.types.js +6 -1
- package/Voxels/Data/VoxelTagsRegister.js +5 -0
- package/Voxels/Functions/BuildStateData.d.ts +6 -6
- package/Voxels/Functions/BuildStateData.js +31 -31
- package/Voxels/Functions/BuildTagAndPaletteData.js +5 -0
- package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
- package/Voxels/Indexes/VoxelIndex.js +16 -18
- package/Voxels/InitVoxelData.js +12 -8
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
- package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
- package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
- package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
- package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
- package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
- package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
- package/Voxels/Logic/VoxelLogic.types.js +1 -0
- package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
- package/Voxels/Logic/VoxelLogicRegister.js +15 -0
- package/Voxels/State/SchemaRegister.js +10 -5
- package/Voxels/State/State.types.d.ts +1 -1
- package/Voxels/State/StateTreeReader.d.ts +1 -1
- package/Voxels/State/StateTreeReader.js +2 -3
- package/Voxels/Types/Voxel.types.d.ts +3 -0
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
- package/World/Archive/Archive.types.d.ts +31 -12
- package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
- package/World/Archive/Classes/ArchiveClasses.js +78 -0
- package/World/Archive/Classes/ImportedSection.d.ts +40 -0
- package/World/Archive/Classes/ImportedSection.js +307 -0
- package/World/Archive/Classes/ImportedSector.d.ts +23 -0
- package/World/Archive/Classes/ImportedSector.js +97 -0
- package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
- package/World/Archive/Functions/ArchiveArea.js +39 -36
- package/World/Archive/Functions/ArchiveSector.js +210 -404
- package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
- package/World/Archive/Functions/CreateArchivedSection.js +207 -0
- package/World/Archive/Functions/ImportSector.d.ts +1 -3
- package/World/Archive/Functions/ImportSector.js +13 -244
- package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
- package/World/Archive/Functions/RemoveDuplicates.js +92 -0
- package/World/Archive/Functions/Shared.d.ts +2 -2
- package/World/Archive/Functions/Shared.js +15 -40
- package/World/Archive/InitTasks.js +7 -10
- package/World/Cursor/SectionCursor.d.ts +1 -1
- package/World/Cursor/SectorCursor.d.ts +1 -1
- package/World/Cursor/WorldCursor.d.ts +4 -3
- package/World/Cursor/WorldCursor.js +16 -13
- package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
- package/World/Cursor/WorldVoxelCursor.js +23 -14
- package/World/Dimension/Dimension.d.ts +4 -1
- package/World/Dimension/Dimension.js +8 -1
- package/World/Section/Section.d.ts +17 -4
- package/World/Section/Section.js +68 -6
- package/World/Section/SectionState.d.ts +4 -2
- package/World/Section/SectionState.js +4 -2
- package/World/Sector/Sector.d.ts +7 -1
- package/World/Sector/Sector.js +37 -4
- package/World/Sector/SectorState.d.ts +3 -2
- package/World/Sector/SectorState.js +3 -2
- package/World/Types/WorldData.types.d.ts +2 -7
- package/World/WorldRegister.d.ts +9 -9
- package/World/WorldRegister.js +9 -6
- package/World/WorldSpaces.js +6 -6
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +6 -4
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +9 -5
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
- package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
- package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
- package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
- package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
- package/{Tasks/IWG/Internal/Classes/BuildQueue.js → WorldSimulation/Internal/Classes/TickQueue.js} +16 -7
- package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
- package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +6 -6
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
- package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
- package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +29 -19
- package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
- package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
- package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
- package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
- package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
- package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
- package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -14
- package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
- package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
- package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
- package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +5 -5
- package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +5 -5
- package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +21 -21
- package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
- package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
- package/package.json +1 -1
- package/Tasks/IWG/Internal/Classes/BuildQueue.d.ts +0 -11
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
- package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
- package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -30
- package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
- /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const simpleCube = {
|
|
2
2
|
id: "dve_simple_cube",
|
|
3
3
|
relationsSchema: [],
|
|
4
|
-
|
|
4
|
+
stateSchema: [],
|
|
5
5
|
arguments: {
|
|
6
6
|
texture: {
|
|
7
7
|
type: "texture",
|
|
@@ -11,8 +11,8 @@ export const simpleCube = {
|
|
|
11
11
|
default: false,
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
conditonalNodes: {},
|
|
15
|
+
stateNodes: {
|
|
16
16
|
"*": [
|
|
17
17
|
{
|
|
18
18
|
id: "cube",
|
|
@@ -38,28 +38,16 @@ export const simpleCube = {
|
|
|
38
38
|
export const orientedCube = {
|
|
39
39
|
id: "dve_oriented_cube",
|
|
40
40
|
relationsSchema: [],
|
|
41
|
-
|
|
41
|
+
stateSchema: [
|
|
42
42
|
{
|
|
43
43
|
name: "placement",
|
|
44
44
|
type: "string",
|
|
45
|
-
values:
|
|
46
|
-
0: "down",
|
|
47
|
-
1: "up",
|
|
48
|
-
2: "north",
|
|
49
|
-
3: "south",
|
|
50
|
-
4: "east",
|
|
51
|
-
5: "west",
|
|
52
|
-
},
|
|
45
|
+
values: ["down", "up", "north", "south", "east", "west"],
|
|
53
46
|
},
|
|
54
47
|
{
|
|
55
48
|
name: "direction",
|
|
56
49
|
type: "string",
|
|
57
|
-
values:
|
|
58
|
-
0: "north",
|
|
59
|
-
1: "south",
|
|
60
|
-
2: "east",
|
|
61
|
-
3: "west",
|
|
62
|
-
},
|
|
50
|
+
values: ["north", "south", "east", "west"],
|
|
63
51
|
},
|
|
64
52
|
],
|
|
65
53
|
arguments: {
|
|
@@ -82,8 +70,8 @@ export const orientedCube = {
|
|
|
82
70
|
type: "texture",
|
|
83
71
|
},
|
|
84
72
|
},
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
conditonalNodes: {},
|
|
74
|
+
stateNodes: {
|
|
87
75
|
"placement=down,direction=north": [
|
|
88
76
|
{
|
|
89
77
|
id: "cube",
|
|
@@ -553,18 +541,11 @@ export const orientedCube = {
|
|
|
553
541
|
export const simpleHalfCube = {
|
|
554
542
|
id: "dve_simple_half_cube",
|
|
555
543
|
relationsSchema: [],
|
|
556
|
-
|
|
544
|
+
stateSchema: [
|
|
557
545
|
{
|
|
558
546
|
name: "placement",
|
|
559
547
|
type: "string",
|
|
560
|
-
values:
|
|
561
|
-
0: "down",
|
|
562
|
-
1: "up",
|
|
563
|
-
2: "north",
|
|
564
|
-
3: "south",
|
|
565
|
-
4: "east",
|
|
566
|
-
5: "west",
|
|
567
|
-
},
|
|
548
|
+
values: ["down", "up", "north", "south", "east", "west"],
|
|
568
549
|
},
|
|
569
550
|
],
|
|
570
551
|
arguments: {
|
|
@@ -575,8 +556,8 @@ export const simpleHalfCube = {
|
|
|
575
556
|
type: "texture",
|
|
576
557
|
},
|
|
577
558
|
},
|
|
578
|
-
|
|
579
|
-
|
|
559
|
+
conditonalNodes: {},
|
|
560
|
+
stateNodes: {
|
|
580
561
|
"placement=down": [
|
|
581
562
|
{
|
|
582
563
|
id: "half_cube",
|
|
@@ -724,15 +705,11 @@ export const pillarCube = {
|
|
|
724
705
|
],
|
|
725
706
|
},
|
|
726
707
|
],
|
|
727
|
-
|
|
708
|
+
stateSchema: [
|
|
728
709
|
{
|
|
729
710
|
name: "direction",
|
|
730
711
|
type: "string",
|
|
731
|
-
values:
|
|
732
|
-
0: "down-up",
|
|
733
|
-
1: "south-north",
|
|
734
|
-
2: "west-east",
|
|
735
|
-
},
|
|
712
|
+
values: ["down-up", "south-north", "west-east"],
|
|
736
713
|
},
|
|
737
714
|
],
|
|
738
715
|
arguments: {
|
|
@@ -755,8 +732,8 @@ export const pillarCube = {
|
|
|
755
732
|
type: "texture",
|
|
756
733
|
},
|
|
757
734
|
},
|
|
758
|
-
|
|
759
|
-
|
|
735
|
+
conditonalNodes: {},
|
|
736
|
+
stateNodes: {
|
|
760
737
|
"direction=down-up,same-down=false,same-up=false": [
|
|
761
738
|
{
|
|
762
739
|
id: "cube",
|
|
@@ -22,7 +22,7 @@ export const liquidGeometry = {
|
|
|
22
22
|
export const liquidModel = {
|
|
23
23
|
id: "dve_liquid",
|
|
24
24
|
relationsSchema: [],
|
|
25
|
-
|
|
25
|
+
stateSchema: [],
|
|
26
26
|
arguments: {
|
|
27
27
|
stillTexture: {
|
|
28
28
|
type: "texture",
|
|
@@ -31,8 +31,8 @@ export const liquidModel = {
|
|
|
31
31
|
type: "texture",
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
conditonalNodes: {},
|
|
35
|
+
stateNodes: {
|
|
36
36
|
"*": [
|
|
37
37
|
{
|
|
38
38
|
id: "liquid",
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
export const simpleThinPannel = {
|
|
2
2
|
id: "dve_simple_thin_panel",
|
|
3
3
|
relationsSchema: [],
|
|
4
|
-
|
|
4
|
+
stateSchema: [
|
|
5
5
|
{
|
|
6
6
|
name: "placement",
|
|
7
7
|
type: "string",
|
|
8
|
-
values:
|
|
9
|
-
0: "down",
|
|
10
|
-
1: "up",
|
|
11
|
-
2: "north",
|
|
12
|
-
3: "south",
|
|
13
|
-
4: "east",
|
|
14
|
-
5: "west",
|
|
15
|
-
},
|
|
8
|
+
values: ["down", "up", "north", "south", "east", "west"],
|
|
16
9
|
},
|
|
17
10
|
{
|
|
18
11
|
name: "direction",
|
|
19
12
|
type: "string",
|
|
20
|
-
values:
|
|
21
|
-
0: "north",
|
|
22
|
-
1: "south",
|
|
23
|
-
2: "east",
|
|
24
|
-
3: "west",
|
|
25
|
-
},
|
|
13
|
+
values: ["north", "south", "east", "west"],
|
|
26
14
|
},
|
|
27
15
|
],
|
|
28
16
|
arguments: {
|
|
@@ -37,9 +25,8 @@ export const simpleThinPannel = {
|
|
|
37
25
|
type: "texture",
|
|
38
26
|
},
|
|
39
27
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
shapeStatesNodes: {
|
|
28
|
+
conditonalNodes: {},
|
|
29
|
+
stateNodes: {
|
|
43
30
|
"placement=down,direction=south": [
|
|
44
31
|
{
|
|
45
32
|
id: "cube",
|
|
@@ -489,28 +476,16 @@ export const simpleThinPannel = {
|
|
|
489
476
|
export const simpleCrossedPannel = {
|
|
490
477
|
id: "dve_simple_crossed_panels",
|
|
491
478
|
relationsSchema: [],
|
|
492
|
-
|
|
479
|
+
stateSchema: [
|
|
493
480
|
{
|
|
494
481
|
name: "placement",
|
|
495
482
|
type: "string",
|
|
496
|
-
values:
|
|
497
|
-
0: "down",
|
|
498
|
-
1: "up",
|
|
499
|
-
2: "north",
|
|
500
|
-
3: "south",
|
|
501
|
-
4: "east",
|
|
502
|
-
5: "west",
|
|
503
|
-
},
|
|
483
|
+
values: ["down", "up", "north", "south", "east", "west"],
|
|
504
484
|
},
|
|
505
485
|
{
|
|
506
486
|
name: "direction",
|
|
507
487
|
type: "string",
|
|
508
|
-
values:
|
|
509
|
-
0: "north",
|
|
510
|
-
1: "south",
|
|
511
|
-
2: "east",
|
|
512
|
-
3: "west",
|
|
513
|
-
},
|
|
488
|
+
values: ["north", "south", "east", "west"],
|
|
514
489
|
},
|
|
515
490
|
],
|
|
516
491
|
arguments: {
|
|
@@ -526,9 +501,8 @@ export const simpleCrossedPannel = {
|
|
|
526
501
|
default: false,
|
|
527
502
|
},
|
|
528
503
|
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
shapeStatesNodes: {
|
|
504
|
+
conditonalNodes: {},
|
|
505
|
+
stateNodes: {
|
|
532
506
|
"placement=down,direction=north": [
|
|
533
507
|
{
|
|
534
508
|
id: "quad-1",
|
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
export const stair = {
|
|
2
2
|
id: "dve_simple_stair",
|
|
3
3
|
relationsSchema: [],
|
|
4
|
-
|
|
4
|
+
stateSchema: [
|
|
5
5
|
{
|
|
6
6
|
name: "placement",
|
|
7
7
|
type: "string",
|
|
8
|
-
values:
|
|
9
|
-
0: "down",
|
|
10
|
-
1: "up",
|
|
11
|
-
2: "north",
|
|
12
|
-
3: "south",
|
|
13
|
-
4: "east",
|
|
14
|
-
5: "west",
|
|
15
|
-
},
|
|
8
|
+
values: ["down", "up", "north", "south", "east", "west"],
|
|
16
9
|
},
|
|
17
10
|
{
|
|
18
11
|
name: "direction",
|
|
19
12
|
type: "string",
|
|
20
|
-
values:
|
|
21
|
-
0: "south",
|
|
22
|
-
1: "north",
|
|
23
|
-
2: "east",
|
|
24
|
-
3: "west",
|
|
25
|
-
},
|
|
13
|
+
values: ["south", "north", "east", "west"],
|
|
26
14
|
},
|
|
27
15
|
{
|
|
28
16
|
name: "connected",
|
|
29
17
|
type: "string",
|
|
30
|
-
values:
|
|
31
|
-
0: "false",
|
|
32
|
-
1: "true",
|
|
33
|
-
},
|
|
18
|
+
values: ["false", "true"],
|
|
34
19
|
},
|
|
35
20
|
],
|
|
36
21
|
arguments: {
|
|
@@ -38,8 +23,8 @@ export const stair = {
|
|
|
38
23
|
type: "texture",
|
|
39
24
|
},
|
|
40
25
|
},
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
conditonalNodes: {},
|
|
27
|
+
stateNodes: {
|
|
43
28
|
"placement=up,direction=north,connected=false": [
|
|
44
29
|
{
|
|
45
30
|
id: "base",
|
package/Models/Examples.js
CHANGED
|
@@ -42,19 +42,15 @@ export const chainModel = {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
relationsSchema: [],
|
|
45
|
-
|
|
45
|
+
stateSchema: [
|
|
46
46
|
{
|
|
47
47
|
name: "axis",
|
|
48
48
|
type: "string",
|
|
49
|
-
values:
|
|
50
|
-
0: "y",
|
|
51
|
-
1: "x",
|
|
52
|
-
2: "z",
|
|
53
|
-
},
|
|
49
|
+
values: ["y", "x", "z"],
|
|
54
50
|
},
|
|
55
51
|
],
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
conditonalNodes: {},
|
|
53
|
+
stateNodes: {
|
|
58
54
|
"axis=y": [
|
|
59
55
|
{
|
|
60
56
|
id: "main",
|
|
@@ -144,9 +140,9 @@ export const carpetModel = {
|
|
|
144
140
|
},
|
|
145
141
|
},
|
|
146
142
|
relationsSchema: [],
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
stateSchema: [],
|
|
144
|
+
conditonalNodes: {},
|
|
145
|
+
stateNodes: {
|
|
150
146
|
"*": [
|
|
151
147
|
{
|
|
152
148
|
id: "main",
|
|
@@ -404,6 +400,7 @@ export const fenceNorthsouth = {
|
|
|
404
400
|
};
|
|
405
401
|
export const fence = {
|
|
406
402
|
id: "dve_fence",
|
|
403
|
+
divisor: [16, 16, 16],
|
|
407
404
|
relationsSchema: [
|
|
408
405
|
{
|
|
409
406
|
name: "same-east",
|
|
@@ -442,7 +439,7 @@ export const fence = {
|
|
|
442
439
|
],
|
|
443
440
|
},
|
|
444
441
|
],
|
|
445
|
-
|
|
442
|
+
stateSchema: [],
|
|
446
443
|
arguments: {
|
|
447
444
|
southTex: {
|
|
448
445
|
type: "texture",
|
|
@@ -463,7 +460,7 @@ export const fence = {
|
|
|
463
460
|
type: "texture",
|
|
464
461
|
},
|
|
465
462
|
},
|
|
466
|
-
|
|
463
|
+
conditonalNodes: {
|
|
467
464
|
"same-south=true": [
|
|
468
465
|
{
|
|
469
466
|
id: "fence_connection_south",
|
|
@@ -523,7 +520,7 @@ export const fence = {
|
|
|
523
520
|
},
|
|
524
521
|
],
|
|
525
522
|
},
|
|
526
|
-
|
|
523
|
+
stateNodes: {
|
|
527
524
|
"*": [
|
|
528
525
|
{
|
|
529
526
|
id: "fence_post",
|
|
@@ -828,7 +825,7 @@ export const candlesModel = {
|
|
|
828
825
|
},
|
|
829
826
|
},
|
|
830
827
|
relationsSchema: [],
|
|
831
|
-
|
|
828
|
+
stateSchema: [
|
|
832
829
|
{
|
|
833
830
|
name: "num_candles",
|
|
834
831
|
type: "number",
|
|
@@ -837,10 +834,7 @@ export const candlesModel = {
|
|
|
837
834
|
{
|
|
838
835
|
name: "lit",
|
|
839
836
|
type: "string",
|
|
840
|
-
values:
|
|
841
|
-
0: "false",
|
|
842
|
-
1: "true",
|
|
843
|
-
},
|
|
837
|
+
values: ["false", "true"],
|
|
844
838
|
},
|
|
845
839
|
],
|
|
846
840
|
effects: [
|
|
@@ -881,8 +875,8 @@ export const candlesModel = {
|
|
|
881
875
|
},
|
|
882
876
|
},
|
|
883
877
|
],
|
|
884
|
-
|
|
885
|
-
|
|
878
|
+
conditonalNodes: {},
|
|
879
|
+
stateNodes: {
|
|
886
880
|
"num_candles=0,lit=false": [
|
|
887
881
|
{
|
|
888
882
|
id: "candel_1",
|
|
@@ -1161,40 +1155,25 @@ export const leverModel = {
|
|
|
1161
1155
|
},
|
|
1162
1156
|
},
|
|
1163
1157
|
relationsSchema: [],
|
|
1164
|
-
|
|
1158
|
+
stateSchema: [
|
|
1165
1159
|
{
|
|
1166
1160
|
name: "placement",
|
|
1167
1161
|
type: "string",
|
|
1168
|
-
values:
|
|
1169
|
-
0: "down",
|
|
1170
|
-
1: "up",
|
|
1171
|
-
2: "north",
|
|
1172
|
-
3: "south",
|
|
1173
|
-
4: "east",
|
|
1174
|
-
5: "west",
|
|
1175
|
-
},
|
|
1162
|
+
values: ["down", "up", "north", "south", "east", "west"],
|
|
1176
1163
|
},
|
|
1177
1164
|
{
|
|
1178
1165
|
name: "direction",
|
|
1179
1166
|
type: "string",
|
|
1180
|
-
values:
|
|
1181
|
-
0: "north",
|
|
1182
|
-
1: "south",
|
|
1183
|
-
2: "east",
|
|
1184
|
-
3: "west",
|
|
1185
|
-
},
|
|
1167
|
+
values: ["north", "south", "east", "west"],
|
|
1186
1168
|
},
|
|
1187
1169
|
{
|
|
1188
1170
|
name: "state",
|
|
1189
1171
|
type: "string",
|
|
1190
|
-
values:
|
|
1191
|
-
0: "off",
|
|
1192
|
-
1: "on",
|
|
1193
|
-
},
|
|
1172
|
+
values: ["off", "on"],
|
|
1194
1173
|
},
|
|
1195
1174
|
],
|
|
1196
|
-
|
|
1197
|
-
|
|
1175
|
+
conditonalNodes: {},
|
|
1176
|
+
stateNodes: {
|
|
1198
1177
|
"placement=down,direction=north,state=off": [
|
|
1199
1178
|
{
|
|
1200
1179
|
id: "lever_base",
|
|
@@ -1242,7 +1221,7 @@ export const leverModel = {
|
|
|
1242
1221
|
{
|
|
1243
1222
|
id: "lever",
|
|
1244
1223
|
geometryId: "dve_lever_model",
|
|
1245
|
-
position: [0,
|
|
1224
|
+
position: [0, -0.8, 3],
|
|
1246
1225
|
rotation: [45, 0, 0],
|
|
1247
1226
|
inputs: {
|
|
1248
1227
|
texture: "@leverTexture",
|
|
@@ -1260,7 +1239,7 @@ export const leverModel = {
|
|
|
1260
1239
|
{
|
|
1261
1240
|
id: "lever",
|
|
1262
1241
|
geometryId: "dve_lever_model",
|
|
1263
|
-
position: [0,
|
|
1242
|
+
position: [0, -0.8, -3],
|
|
1264
1243
|
rotation: [-45, 0, 0],
|
|
1265
1244
|
inputs: {
|
|
1266
1245
|
texture: "@leverTexture",
|
|
@@ -2,7 +2,7 @@ import { VoxelModelConstructorData, VoxelModelData } from "../../VoxelModel.type
|
|
|
2
2
|
import { BuildStateData } from "../../../Voxels/Functions/BuildStateData";
|
|
3
3
|
export declare class VoxelRulesModoel {
|
|
4
4
|
data: VoxelModelData;
|
|
5
|
-
|
|
5
|
+
states: Map<string, string[]>;
|
|
6
6
|
conditionalNodes: Map<string, string[]>;
|
|
7
7
|
stateData: ReturnType<typeof BuildStateData>;
|
|
8
8
|
voxels: Map<string, VoxelModelConstructorData>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class VoxelRulesModoel {
|
|
2
2
|
data;
|
|
3
|
-
|
|
3
|
+
states = new Map();
|
|
4
4
|
conditionalNodes = new Map();
|
|
5
5
|
stateData;
|
|
6
6
|
voxels = new Map();
|
|
@@ -9,10 +9,10 @@ export class VoxelRulesModoel {
|
|
|
9
9
|
this.data = data;
|
|
10
10
|
}
|
|
11
11
|
registerShapeState(id, geomtryId) {
|
|
12
|
-
let stateArray = this.
|
|
12
|
+
let stateArray = this.states.get(id);
|
|
13
13
|
if (!stateArray) {
|
|
14
14
|
stateArray = [];
|
|
15
|
-
this.
|
|
15
|
+
this.states.set(id, stateArray);
|
|
16
16
|
}
|
|
17
17
|
if (!stateArray.find((_) => _ == geomtryId))
|
|
18
18
|
stateArray.push(geomtryId);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VoxelFaceTransparentResultsIndex } from "../../Indexing/VoxelFaceTransparentResultsIndex";
|
|
2
2
|
import { VoxelRulesModoel } from "../Classes/VoxelRulesModel";
|
|
3
3
|
export declare function BuildFinalInputs(model: VoxelRulesModoel): {
|
|
4
|
-
|
|
4
|
+
stateVoxelInputs: Record<string, any[]>;
|
|
5
5
|
transparentVoxelFaceIndexes: Record<string, VoxelFaceTransparentResultsIndex>;
|
|
6
6
|
conditionalShapeStateVoxelInputs: Record<string, any[]>;
|
|
7
7
|
};
|
|
@@ -6,7 +6,7 @@ const isArgString = (data) => {
|
|
|
6
6
|
return data[0] == "@";
|
|
7
7
|
};
|
|
8
8
|
export function BuildFinalInputs(model) {
|
|
9
|
-
const
|
|
9
|
+
const stateVoxelInputs = {};
|
|
10
10
|
const transparentVoxelFaceIndexes = {};
|
|
11
11
|
const conditionalShapeStateVoxelInputs = {};
|
|
12
12
|
for (const [voxelId, voxel] of model.voxels) {
|
|
@@ -20,10 +20,10 @@ export function BuildFinalInputs(model) {
|
|
|
20
20
|
const modVoxelInput = voxel.inputs[modVoxelInputKey];
|
|
21
21
|
const modIndex = voxelModData.modRecord[modVoxelInputKey];
|
|
22
22
|
const baseStates = [];
|
|
23
|
-
for (const state in model.data.
|
|
23
|
+
for (const state in model.data.stateNodes) {
|
|
24
24
|
const geoNodes = [];
|
|
25
|
-
const
|
|
26
|
-
for (const node of
|
|
25
|
+
const stateNodes = model.data.stateNodes[state];
|
|
26
|
+
for (const node of stateNodes) {
|
|
27
27
|
const geo = VoxelModelRuleBuilderRegister.getGeomtryFromLink(node);
|
|
28
28
|
if (!geo)
|
|
29
29
|
throw new Error(`Geometry does not exist`);
|
|
@@ -39,24 +39,24 @@ export function BuildFinalInputs(model) {
|
|
|
39
39
|
}
|
|
40
40
|
geoNodes[model.stateData.geometryLinkPalette[node.id]] =
|
|
41
41
|
geo.inputs.cloneArgs();
|
|
42
|
-
const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.
|
|
42
|
+
const byteIndex = model.stateData.relativeGeometryByteIndexMap[model.stateData.stateRelativeGeometryMap[model.stateData.stateRecord[state]][VoxelModelRuleBuilderRegister.geometryPalette.getNumberId(VoxelModelRuleBuilderRegister.getGeometryLinkId(node))]];
|
|
43
43
|
if (geo.data.ogData.doNotBuildRules !== true) {
|
|
44
44
|
for (let i = 0; i < geo.inputs.faceTransparentIndex.length; i++) {
|
|
45
45
|
transparentIndex.setValue(modIndex, byteIndex, i, geo.inputs.faceTransparentIndex[i] ? 1 : 0);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
baseStates[model.stateData.
|
|
49
|
+
baseStates[model.stateData.stateRecord[state]] = geoNodes;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
stateVoxelInputs[voxelId] ??= [];
|
|
52
|
+
stateVoxelInputs[voxelId][voxelModData.modRecord[modVoxelInputKey]] =
|
|
53
53
|
baseStates;
|
|
54
54
|
const condiotnalStates = [];
|
|
55
|
-
for (const state in model.data.
|
|
55
|
+
for (const state in model.data.conditonalNodes) {
|
|
56
56
|
const geoNodes = [];
|
|
57
|
-
const
|
|
58
|
-
for (let i = 0; i <
|
|
59
|
-
const node =
|
|
57
|
+
const stateNodes = model.data.conditonalNodes[state];
|
|
58
|
+
for (let i = 0; i < stateNodes.length; i++) {
|
|
59
|
+
const node = stateNodes[i];
|
|
60
60
|
const geo = VoxelModelRuleBuilderRegister.getGeomtryFromLink(node);
|
|
61
61
|
if (!geo)
|
|
62
62
|
throw new Error(`Geometry does not exist`);
|
|
@@ -86,7 +86,7 @@ export function BuildFinalInputs(model) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
|
-
|
|
89
|
+
stateVoxelInputs,
|
|
90
90
|
transparentVoxelFaceIndexes,
|
|
91
91
|
conditionalShapeStateVoxelInputs,
|
|
92
92
|
};
|
|
@@ -111,8 +111,8 @@ export class VoxelModelRuleBuilderRegister {
|
|
|
111
111
|
this.models.set(model.id, rulesModel);
|
|
112
112
|
const divisor = model.divisor ? model.divisor : null;
|
|
113
113
|
if (divisor) {
|
|
114
|
-
for (const stateId in model.
|
|
115
|
-
const nodes = model.
|
|
114
|
+
for (const stateId in model.stateNodes) {
|
|
115
|
+
const nodes = model.stateNodes[stateId];
|
|
116
116
|
for (const node of nodes) {
|
|
117
117
|
const d = "divisor" in node ? node.divisor : divisor;
|
|
118
118
|
if (node.position) {
|
|
@@ -127,8 +127,8 @@ export class VoxelModelRuleBuilderRegister {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
for (const stateId in model.
|
|
131
|
-
const nodes = model.
|
|
130
|
+
for (const stateId in model.conditonalNodes) {
|
|
131
|
+
const nodes = model.conditonalNodes[stateId];
|
|
132
132
|
for (const node of nodes) {
|
|
133
133
|
const d = "divisor" in node ? node.divisor : divisor;
|
|
134
134
|
if (node.position) {
|
|
@@ -157,12 +157,12 @@ export class VoxelModelRuleBuilderRegister {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
for (const stateId in model.
|
|
161
|
-
const nodes = model.
|
|
160
|
+
for (const stateId in model.stateNodes) {
|
|
161
|
+
const nodes = model.stateNodes[stateId];
|
|
162
162
|
addGeo(model, stateId, nodes).forEach((_) => rulesModel.registerShapeState(..._));
|
|
163
163
|
}
|
|
164
|
-
for (const stateId in model.
|
|
165
|
-
const nodes = model.
|
|
164
|
+
for (const stateId in model.conditonalNodes) {
|
|
165
|
+
const nodes = model.conditonalNodes[stateId];
|
|
166
166
|
addGeo(model, stateId, nodes).forEach((_) => rulesModel.registerCondiotnalNode(..._));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -123,9 +123,9 @@ export interface VoxelModelData {
|
|
|
123
123
|
/**Divisor used all transforms of geometry nodes. */
|
|
124
124
|
divisor?: Vec3Array;
|
|
125
125
|
arguments: Record<string, VoxelGeometryTextureArgument | VoxelGeometryBoxUVArgument | VoxelGeometryVector3Argument | VoxelGeometryIntArgument | VoxelGeometryBooleanArgument | VoxelGeometryFloatArgument>;
|
|
126
|
-
|
|
126
|
+
stateSchema: (VoxelStateStringSchemaData | VoxelStateNumberSchemaData)[];
|
|
127
127
|
effects?: VoxelEffectData[];
|
|
128
128
|
relationsSchema: VoxelModelRelationsSchemaData[];
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
stateNodes: Record<string, VoxelGeometryLinkData[]>;
|
|
130
|
+
conditonalNodes: Record<string, VoxelGeometryLinkData[]>;
|
|
131
131
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Vec3Array } from "@amodx/math";
|
|
2
|
-
import { CompactMeshData } from "../../Mesher/Types/Mesher.types";
|
|
3
1
|
import { SectionMesh } from "./SectionMesh";
|
|
2
|
+
import { CompactedSectionVoxelMesh } from "../../Mesher/Geomtry/CompactedSectionVoxelMesh";
|
|
4
3
|
export declare abstract class DVESectionMeshes {
|
|
5
|
-
abstract updateVertexData(section: SectionMesh,
|
|
4
|
+
abstract updateVertexData(section: SectionMesh, data: CompactedSectionVoxelMesh): SectionMesh;
|
|
6
5
|
abstract returnMesh(mesh: any): void;
|
|
7
6
|
}
|
package/Renderer/InitTasks.js
CHANGED
|
@@ -7,16 +7,8 @@ export default function RendererTasks(threads) {
|
|
|
7
7
|
const tasks = new TaskTool(threads);
|
|
8
8
|
Threads.registerTask("set-section", (data, origin) => {
|
|
9
9
|
MeshManager.updateSection(data);
|
|
10
|
-
const tranfers = [];
|
|
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);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
10
|
if (!EngineSettings.settings.rendererSettings.cpuBound) {
|
|
19
|
-
origin.sendMessage([],
|
|
11
|
+
origin.sendMessage([], [data]);
|
|
20
12
|
}
|
|
21
13
|
});
|
|
22
14
|
Threads.registerTask("remove-sector", (data) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetSectionMeshTask } from "../
|
|
1
|
+
import type { SetSectionMeshTask } from "../Mesher/Types/Mesher.types";
|
|
2
2
|
import { LocationData } from "../Math/index.js";
|
|
3
3
|
import { DVESectionMeshes } from "./Classes/DVESectionMeshes";
|
|
4
4
|
export declare class MeshManager {
|