@divinevoxel/vlox 0.0.71 → 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/Base/Main/InitDataGenerator.js +0 -9
- package/Contexts/Base/Remote/DataSync.types.d.ts +0 -5
- package/Contexts/Base/Remote/InitDataSync.js +17 -31
- package/Contexts/Render/DivineVoxelEngineRender.d.ts +1 -1
- package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -1
- package/Init/StartConstructor.js +7 -7
- package/Init/StartWorld.d.ts +1 -1
- package/Init/StartWorld.js +0 -12
- package/Math/Indexing.d.ts +12 -3
- package/Math/Indexing.js +24 -15
- package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
- package/Mesher/Functions/CompactVoxelMesh.js +4 -5
- package/Mesher/Functions/MeshSection.d.ts +1 -1
- package/Mesher/Functions/MeshSection.js +72 -66
- package/Mesher/Functions/MeshTexture.d.ts +1 -1
- package/Mesher/Functions/MeshTexture.js +3 -4
- package/Mesher/Functions/MeshVoxel.js +20 -26
- 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 +108 -125
- package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
- package/Mesher/Geomtry/VoxelMesh.js +2 -2
- package/Mesher/{Tools → Geomtry}/VoxelMeshBVHBuilder.d.ts +2 -9
- package/Mesher/{Tools → Geomtry}/VoxelMeshBVHBuilder.js +4 -16
- package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +9 -8
- package/Mesher/Geomtry/VoxelMeshBuffers.js +49 -0
- package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +10 -0
- package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +10 -0
- package/Mesher/Geomtry/index.d.ts +0 -1
- package/Mesher/Geomtry/index.js +0 -1
- package/Mesher/InitMesher.js +2 -11
- package/Mesher/InitTask.js +10 -22
- package/Mesher/Models/Common/BoundsFunctions.d.ts +1 -3
- package/Mesher/Models/Common/BoundsFunctions.js +0 -16
- package/Mesher/Models/Common/Calc/CalcConstants.js +14 -31
- package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -8
- package/Mesher/Models/Common/Calc/FaceDataCalc.js +50 -52
- 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.d.ts +1 -5
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +40 -42
- package/Mesher/Models/Nodes/GeometryNode.d.ts +3 -5
- package/Mesher/Models/Nodes/GeometryNode.js +1 -2
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +3 -6
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +55 -40
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +52 -51
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +18 -19
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +37 -40
- 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 +4 -5
- package/Mesher/Models/VoxelConstructor.js +23 -12
- package/Mesher/Models/{VoxelGeometryLookUp.d.ts → VoxelGeometryBuilderCacheSpace.d.ts} +6 -14
- package/Mesher/Models/{VoxelGeometryLookUp.js → VoxelGeometryBuilderCacheSpace.js} +26 -44
- package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +10 -8
- package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +44 -19
- package/Mesher/Models/VoxelModelConstructorRegister.js +3 -3
- 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/Indexing/VoxelAOResultsIndex.d.ts +4 -4
- package/Models/Indexing/VoxelAOResultsIndex.js +15 -9
- package/Models/Indexing/VoxelFaceCullResultsIndex.d.ts +3 -3
- package/Models/Indexing/VoxelFaceCullResultsIndex.js +14 -9
- package/Models/Indexing/VoxelFaceTransparentResultsIndex.d.ts +1 -1
- package/Models/Indexing/VoxelFaceTransparentResultsIndex.js +1 -1
- package/Models/Rules/Functions/BuildFinalInputs.js +9 -7
- package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
- package/Models/Rules/Functions/BuildRules.js +4 -4
- 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 +14 -2
- package/Tasks/IWG/Internal/Classes/IWGTaskBase.js +2 -2
- package/Tasks/IWG/Internal/Functions/getSectorState.js +4 -7
- package/Tasks/IWG/Internal/Functions/runBuildUpdate.js +21 -2
- package/Tasks/IWG/Internal/Functions/runWorldUpdate.js +5 -6
- package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -4
- package/Tasks/IWG/Internal/IWGTasks.js +12 -31
- package/Tasks/IWG/Internal/IWGTools.d.ts +1 -1
- package/Tasks/IWG/Procedures/SaveAllSectors.js +2 -0
- package/Tasks/Propagation/Flow/FlowManager.d.ts +0 -2
- package/Tasks/Propagation/Flow/FlowManager.js +86 -87
- package/Tasks/Propagation/Flow/WorldFlow.js +2 -3
- package/Tasks/Propagation/Illumanation/WorldRGB.js +1 -2
- package/Tasks/Update/InitTasks.d.ts +2 -1
- package/Tasks/Update/InitTasks.js +6 -6
- package/Tasks/Update/UpdateTask.d.ts +3 -1
- package/Tasks/Update/UpdateTask.js +28 -2
- package/Tasks/Update/VoxelUpdate.js +21 -7
- package/Tasks/WorldGeneration/WorldGenBrush.js +2 -1
- package/Templates/Cursor/TemplateCursor.d.ts +2 -2
- package/Templates/Cursor/TemplateCursor.js +1 -2
- package/Templates/Functions/CreateTemplate.js +1 -1
- package/Templates/VoxelTemplate.js +6 -8
- 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 -3
- package/Tools/Brush/Brush.js +43 -12
- 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/BinaryFunctions.d.ts +3 -0
- package/Util/Binary/BinaryFunctions.js +11 -0
- package/Util/StringPalette.d.ts +1 -0
- package/Util/StringPalette.js +8 -0
- package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
- package/Voxels/Cursor/VoxelCursor.d.ts +6 -6
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +11 -16
- package/Voxels/Cursor/VoxelCursor.interface.js +35 -58
- package/Voxels/Cursor/VoxelCursor.js +13 -12
- package/Voxels/Cursor/VoxelLightData.d.ts +3 -4
- package/Voxels/Cursor/VoxelLightData.js +8 -7
- package/Voxels/Data/VoxelPalettesRegister.d.ts +8 -0
- package/Voxels/Data/VoxelPalettesRegister.js +8 -0
- package/Voxels/Data/VoxelTag.types.d.ts +56 -0
- package/Voxels/Data/VoxelTag.types.js +23 -0
- package/Voxels/{State → Data}/VoxelTagStates.d.ts +2 -2
- package/Voxels/{State → Data}/VoxelTagStates.js +5 -5
- package/Voxels/Data/VoxelTagsRegister.d.ts +9 -0
- package/Voxels/Data/VoxelTagsRegister.js +32 -0
- package/Voxels/Functions/BuildStateData.js +12 -12
- package/Voxels/Functions/BuildTagAndPaletteData.d.ts +13 -0
- package/Voxels/Functions/BuildTagAndPaletteData.js +55 -0
- package/Voxels/Indexes/VoxelIndex.js +3 -3
- package/Voxels/InitVoxelData.js +31 -73
- package/Voxels/State/Schema/StateSchema.d.ts +1 -1
- package/Voxels/Types/Voxel.types.d.ts +20 -42
- package/Voxels/Types/Voxel.types.js +6 -17
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +11 -13
- package/Voxels/Types/VoxelSubstances.types.d.ts +2 -15
- package/Voxels/Types/VoxelSubstances.types.js +1 -9
- package/World/Archive/Archive.types.d.ts +38 -34
- package/World/Archive/Functions/ArchiveArea.js +18 -30
- package/World/Archive/Functions/ArchiveSector.js +484 -213
- package/World/Archive/Functions/ImportSector.d.ts +3 -3
- package/World/Archive/Functions/ImportSector.js +205 -151
- 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 +3 -2
- package/World/Cursor/SectionCursor.js +9 -4
- package/World/Cursor/SectorCursor.d.ts +3 -2
- package/World/Cursor/SectorCursor.js +5 -3
- package/World/Cursor/WorldCursor.d.ts +2 -2
- package/World/Cursor/WorldCursor.js +6 -3
- package/World/Cursor/WorldVoxelCursor.d.ts +7 -7
- package/World/Cursor/WorldVoxelCursor.js +21 -24
- package/World/InitTasks.d.ts +1 -1
- package/World/Lock/WorldLock.d.ts +1 -1
- package/World/Section/Section.d.ts +31 -23
- package/World/Section/Section.js +116 -18
- package/World/Section/SectionState.d.ts +10 -0
- package/World/Section/SectionState.js +11 -0
- package/World/Sector/Sector.d.ts +24 -9
- package/World/Sector/Sector.js +92 -21
- package/World/Sector/SectorHeightMap.js +3 -5
- package/World/Sector/SectorState.d.ts +21 -0
- package/World/Sector/SectorState.js +28 -0
- package/World/WorldRegister.d.ts +4 -0
- package/World/WorldRegister.js +15 -3
- package/World/WorldSpaces.d.ts +6 -0
- package/World/WorldSpaces.js +25 -6
- package/package.json +1 -1
- package/Data/Cursor/DataCursor.interface.d.ts +0 -5
- package/Data/Cursor/DataCursor.interface.js +0 -2
- package/Data/Register/MappedDataRegister.d.ts +0 -5
- package/Data/Register/MappedDataRegister.js +0 -9
- package/Data/Register/MappedRegisterBase.d.ts +0 -14
- package/Data/Register/MappedRegisterBase.js +0 -50
- package/Data/Structs/StructBuilder.d.ts +0 -34
- package/Data/Structs/StructBuilder.js +0 -157
- package/Data/Structs/StructBuilder.types.d.ts +0 -30
- package/Mesher/Functions/CompactMesh.d.ts +0 -2
- package/Mesher/Functions/CompactMesh.js +0 -42
- package/Mesher/Geomtry/Buffers.js +0 -81
- 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/Data/SubstanceDataTool.d.ts +0 -13
- package/Tools/Data/SubstanceDataTool.js +0 -51
- package/Voxels/Palettes/MaterialPalette.d.ts +0 -9
- package/Voxels/Palettes/MaterialPalette.js +0 -11
- package/Voxels/Palettes/SubstancePalette.d.ts +0 -9
- package/Voxels/Palettes/SubstancePalette.js +0 -11
- package/Voxels/Palettes/VoxelPalette.d.ts +0 -11
- package/Voxels/Palettes/VoxelPalette.js +0 -15
- package/Voxels/Segments/MaterialDataGenerator.d.ts +0 -6
- package/Voxels/Segments/MaterialDataGenerator.js +0 -12
- package/Voxels/Segments/SubstanceDataGenerator.d.ts +0 -6
- package/Voxels/Segments/SubstanceDataGenerator.js +0 -35
- package/Voxels/Segments/VoxelDataGenerator.d.ts +0 -10
- package/Voxels/Segments/VoxelDataGenerator.js +0 -56
- package/Voxels/Structs/Builder/SubstanceStructBuilder.d.ts +0 -2
- package/Voxels/Structs/Builder/SubstanceStructBuilder.js +0 -42
- package/Voxels/Structs/Builder/VoxelStructBuilder.d.ts +0 -2
- package/Voxels/Structs/Builder/VoxelStructBuilder.js +0 -68
- package/Voxels/Structs/SubstanceStruct.d.ts +0 -17
- package/Voxels/Structs/SubstanceStruct.js +0 -17
- package/Voxels/Structs/VoxelStruct.d.ts +0 -27
- package/Voxels/Structs/VoxelStruct.js +0 -29
- package/World/Section/SectionHeightMap.d.ts +0 -10
- package/World/Section/SectionHeightMap.js +0 -39
- package/World/Section/SectionStruct.d.ts +0 -8
- package/World/Section/SectionStruct.js +0 -29
- package/World/Section/SectionStructProperties.d.ts +0 -10
- package/World/Section/SectionStructProperties.js +0 -11
- package/World/Sector/SectorStruct.d.ts +0 -1
- package/World/Sector/SectorStruct.js +0 -46
- package/World/Sector/SectorStructIds.d.ts +0 -13
- package/World/Sector/SectorStructIds.js +0 -14
- package/World/Structs/WorldDataStructProperties.d.ts +0 -8
- package/World/Structs/WorldDataStructProperties.js +0 -9
- /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
- /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
- /package/{Data/Functions → Util/Binary}/Palettes.d.ts +0 -0
- /package/{Data/Functions → Util/Binary}/Palettes.js +0 -0
- /package/{Data/Structs/StructBuilder.types.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
- /package/Voxels/{VoxelLevelReader.d.ts → Cursor/VoxelLevelReader.d.ts} +0 -0
- /package/Voxels/{VoxelLevelReader.js → Cursor/VoxelLevelReader.js} +0 -0
- /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
- /package/World/{Storage → Types}/WorldStorage.interface.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ShapeStateRelationsNode } from "./ShapeStateRelationsNode";
|
|
2
2
|
import { BinarySchemaNode } from "./BinarySchemaNode";
|
|
3
3
|
import { VoxelModelStateSchemaData } from "../State.types";
|
|
4
|
-
import { DataCursorInterface } from "
|
|
4
|
+
import { DataCursorInterface } from "../../Cursor/DataCursor.interface";
|
|
5
5
|
import { Vector3Like } from "@amodx/math";
|
|
6
6
|
import { VoxelCursorInterface } from "../../Cursor/VoxelCursor.interface";
|
|
7
7
|
export declare class StateSchema {
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { TextureId } from "../../Textures/index";
|
|
2
2
|
import { VoxelModelConstructorData } from "../../Models/VoxelModel.types";
|
|
3
|
+
import { VoxelTags } from "../Data/VoxelTag.types";
|
|
4
|
+
export interface VoxelDataArrays {
|
|
5
|
+
/**The runtime numeric voxel ids */
|
|
6
|
+
ids: Uint16Array;
|
|
7
|
+
/**The light data for voxels stored as 4 nibbles. 0 -> sun light 1 -> red light 2 -> green light 3 -> blue light */
|
|
8
|
+
light: Uint16Array;
|
|
9
|
+
/**The levels of the voxel. Used mainly for waterflow now. */
|
|
10
|
+
level: Uint8Array;
|
|
11
|
+
/**The state of the voxel. Used mainly be the voxel model system to get the model shape. */
|
|
12
|
+
state: Uint16Array;
|
|
13
|
+
/**The mod state of the voxel. Used mainly by the voxel model system to change model inputs. */
|
|
14
|
+
mod: Uint16Array;
|
|
15
|
+
/**The secondary state of the voxel. Can be set to a voxel id to make things like water logged voxels.
|
|
16
|
+
* But the main voxel itself must not use state or mod because the secondary voxel will use the same state and mod.
|
|
17
|
+
*/
|
|
18
|
+
secondary: Uint16Array;
|
|
19
|
+
}
|
|
3
20
|
export type VoxelNamedStateData = {
|
|
4
21
|
id: string;
|
|
5
22
|
name?: string;
|
|
@@ -19,11 +36,13 @@ export type VoxelNamedStateData = {
|
|
|
19
36
|
};
|
|
20
37
|
export declare class PaintVoxelData {
|
|
21
38
|
id: string;
|
|
39
|
+
name: string;
|
|
22
40
|
mod: number;
|
|
23
41
|
state: number;
|
|
24
42
|
level: number;
|
|
25
43
|
levelState: number;
|
|
26
44
|
secondaryVoxelId: string;
|
|
45
|
+
secondaryVoxeName: string;
|
|
27
46
|
static Create(data: Partial<PaintVoxelData>): PaintVoxelData;
|
|
28
47
|
private constructor();
|
|
29
48
|
}
|
|
@@ -44,49 +63,8 @@ export type RawVoxelData = [
|
|
|
44
63
|
/**The secondary id of the voxel */
|
|
45
64
|
secondary: number
|
|
46
65
|
];
|
|
47
|
-
|
|
48
|
-
substance = "dve_substance",
|
|
49
|
-
renderedMaterial = "dve_rendered_material",
|
|
50
|
-
voxelMaterial = "dve_voxel_material",
|
|
51
|
-
hardness = "dve_hardness",
|
|
52
|
-
colliderID = "dve_collider_id",
|
|
53
|
-
checkCollisions = "dve_check_collisions",
|
|
54
|
-
isLightSource = "dve_is_light_source",
|
|
55
|
-
noAO = "dve_no_ao",
|
|
56
|
-
isTransparent = "dve_is_transparent",
|
|
57
|
-
lightValue = "dve_light_value",
|
|
58
|
-
isRich = "dve_is_rich",
|
|
59
|
-
canHaveSecondary = "dve_can_have_secondary"
|
|
60
|
-
}
|
|
61
|
-
interface VoxelProperties {
|
|
66
|
+
interface VoxelProperties extends Partial<VoxelTags> {
|
|
62
67
|
[key: string]: any;
|
|
63
|
-
/** The material used to render the voxel. Used by the engine to assign meshes to the proper material. */
|
|
64
|
-
[VoxelStructIds.renderedMaterial]?: string;
|
|
65
|
-
/** A description of the material used for the voxel. Not used by the engine directly. */
|
|
66
|
-
[VoxelStructIds.voxelMaterial]?: string;
|
|
67
|
-
/** Specifies the substance of the voxel.
|
|
68
|
-
* The voxel will inherit properties from the substance and change how it acts in the world.
|
|
69
|
-
* Properties include being solid or liquid.
|
|
70
|
-
* */
|
|
71
|
-
[VoxelStructIds.substance]?: string;
|
|
72
|
-
/** Indicates whether the voxel is a light source. */
|
|
73
|
-
[VoxelStructIds.isLightSource]?: boolean;
|
|
74
|
-
/** Indicates if the voxel lets light through */
|
|
75
|
-
[VoxelStructIds.isTransparent]?: boolean;
|
|
76
|
-
/** Disables ambient occlusion for this voxel if set to true. */
|
|
77
|
-
[VoxelStructIds.noAO]?: boolean;
|
|
78
|
-
/** Defines the light value emitted by the voxel (r, g, z). */
|
|
79
|
-
[VoxelStructIds.lightValue]?: [r: number, g: number, z: number];
|
|
80
|
-
/** The collider ID for the voxel, used for collision detection. */
|
|
81
|
-
[VoxelStructIds.colliderID]?: string;
|
|
82
|
-
/** Specifies if the voxel participates in collision checks. */
|
|
83
|
-
[VoxelStructIds.checkCollisions]?: boolean;
|
|
84
|
-
/** Indicates if the voxel can have a secondary voxel. */
|
|
85
|
-
[VoxelStructIds.canHaveSecondary]?: boolean;
|
|
86
|
-
/** The hardness level of the voxel, affecting how it is broken or interacted with. */
|
|
87
|
-
[VoxelStructIds.hardness]?: number;
|
|
88
|
-
/** Marks the voxel as "rich" for specialized interactions or rendering. */
|
|
89
|
-
[VoxelStructIds.isRich]?: boolean;
|
|
90
68
|
/** Named states associated with the voxel. */
|
|
91
69
|
dve_named_states?: VoxelNamedStateData[];
|
|
92
70
|
/** Model data used to construct the voxel's appearance. */
|
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
export class PaintVoxelData {
|
|
2
2
|
id;
|
|
3
|
+
name;
|
|
3
4
|
mod;
|
|
4
5
|
state;
|
|
5
6
|
level;
|
|
6
7
|
levelState;
|
|
7
8
|
secondaryVoxelId;
|
|
9
|
+
secondaryVoxeName;
|
|
8
10
|
static Create(data) {
|
|
9
|
-
return new PaintVoxelData(data.id, data.mod, data.state, data.level, data.levelState, data.secondaryVoxelId);
|
|
11
|
+
return new PaintVoxelData(data.id, data.name, data.mod, data.state, data.level, data.levelState, data.secondaryVoxelId, data.secondaryVoxeName);
|
|
10
12
|
}
|
|
11
|
-
constructor(id = "dve_air", mod = 0, state = 0, level = 0, levelState = 0, secondaryVoxelId = "dve_air") {
|
|
13
|
+
constructor(id = "dve_air", name = "", mod = 0, state = 0, level = 0, levelState = 0, secondaryVoxelId = "dve_air", secondaryVoxeName = "") {
|
|
12
14
|
this.id = id;
|
|
15
|
+
this.name = name;
|
|
13
16
|
this.mod = mod;
|
|
14
17
|
this.state = state;
|
|
15
18
|
this.level = level;
|
|
16
19
|
this.levelState = levelState;
|
|
17
20
|
this.secondaryVoxelId = secondaryVoxelId;
|
|
21
|
+
this.secondaryVoxeName = secondaryVoxeName;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
|
-
export var VoxelStructIds;
|
|
21
|
-
(function (VoxelStructIds) {
|
|
22
|
-
VoxelStructIds["substance"] = "dve_substance";
|
|
23
|
-
VoxelStructIds["renderedMaterial"] = "dve_rendered_material";
|
|
24
|
-
VoxelStructIds["voxelMaterial"] = "dve_voxel_material";
|
|
25
|
-
VoxelStructIds["hardness"] = "dve_hardness";
|
|
26
|
-
VoxelStructIds["colliderID"] = "dve_collider_id";
|
|
27
|
-
VoxelStructIds["checkCollisions"] = "dve_check_collisions";
|
|
28
|
-
VoxelStructIds["isLightSource"] = "dve_is_light_source";
|
|
29
|
-
VoxelStructIds["noAO"] = "dve_no_ao";
|
|
30
|
-
VoxelStructIds["isTransparent"] = "dve_is_transparent";
|
|
31
|
-
VoxelStructIds["lightValue"] = "dve_light_value";
|
|
32
|
-
VoxelStructIds["isRich"] = "dve_is_rich";
|
|
33
|
-
VoxelStructIds["canHaveSecondary"] = "dve_can_have_secondary";
|
|
34
|
-
})(VoxelStructIds || (VoxelStructIds = {}));
|
|
@@ -5,29 +5,26 @@ import { VoxelFaceTransparentResultsIndexData } from "../../Models/Indexing/Voxe
|
|
|
5
5
|
import { VoxelModelStateSchemaData, StateLogicStatement } from "../State/State.types";
|
|
6
6
|
import { VoxelGeometryData, VoxelGeometryNodes } from "../../Models/VoxelModel.types";
|
|
7
7
|
import { VoxelEffectSyncData } from "../Effects/VoxelEffects.types";
|
|
8
|
-
import { VoxelTagStatesData } from "../
|
|
9
|
-
import {
|
|
10
|
-
export type
|
|
11
|
-
models: FinalCompiledVoxelModelData;
|
|
8
|
+
import { VoxelTagStatesData } from "../Data/VoxelTagStates";
|
|
9
|
+
import { VoxelSubstanceTags, VoxelTags } from "../Data/VoxelTag.types";
|
|
10
|
+
export type CompiledVoxelTagAndPaletteData = {
|
|
12
11
|
data: {
|
|
13
|
-
|
|
14
|
-
index: Uint16Array;
|
|
12
|
+
tags: VoxelTags[];
|
|
15
13
|
palette: string[];
|
|
16
|
-
nameToIdMap:
|
|
17
|
-
idToNameMap:
|
|
18
|
-
stringMaps: Record<string, string[]>;
|
|
19
|
-
objectMaps: Record<string, any[]>;
|
|
14
|
+
nameToIdMap: [string, string][];
|
|
15
|
+
idToNameMap: [string, string][];
|
|
20
16
|
};
|
|
21
17
|
substances: {
|
|
22
|
-
|
|
18
|
+
tags: VoxelSubstanceTags[];
|
|
23
19
|
palette: string[];
|
|
24
|
-
stringMaps: Record<string, string[]>;
|
|
25
|
-
objectMaps: Record<string, any[]>;
|
|
26
20
|
};
|
|
27
21
|
materials: {
|
|
28
22
|
palette: string[];
|
|
29
23
|
};
|
|
30
24
|
};
|
|
25
|
+
export type CompiledVoxelData = {
|
|
26
|
+
models: FinalCompiledVoxelModelData;
|
|
27
|
+
} & CompiledVoxelTagAndPaletteData;
|
|
31
28
|
export interface CompiledVoxelGeometryNodes {
|
|
32
29
|
node: VoxelGeometryNodes;
|
|
33
30
|
tranform: VoxelGeometryTransform;
|
|
@@ -77,6 +74,7 @@ export interface CompiledVoxelModelData {
|
|
|
77
74
|
}
|
|
78
75
|
export interface CompiledVoxelModelInputData {
|
|
79
76
|
id: string;
|
|
77
|
+
materialId: string;
|
|
80
78
|
modelId: string;
|
|
81
79
|
transparentFaceIndex: VoxelFaceTransparentResultsIndexData;
|
|
82
80
|
modSchema: VoxelModelStateSchemaData[];
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
isSolid = "dve_is_solid",
|
|
4
|
-
isTransparent = "dve_is_transparent",
|
|
5
|
-
isLiquid = "dve_is_liquid",
|
|
6
|
-
flowRate = "dve_flow_rate",
|
|
7
|
-
isWindAffected = "dve_is_wind_affected"
|
|
8
|
-
}
|
|
9
|
-
export interface VoxelSubstanceDataProperties {
|
|
1
|
+
import { VoxelSubstanceTags } from "../Data/VoxelTag.types";
|
|
2
|
+
export interface VoxelSubstanceDataProperties extends Partial<VoxelSubstanceTags> {
|
|
10
3
|
[key: string]: any;
|
|
11
|
-
[SubstanceStructIds.parent]?: string;
|
|
12
|
-
[SubstanceStructIds.isTransparent]?: boolean;
|
|
13
|
-
[SubstanceStructIds.isSolid]?: boolean;
|
|
14
|
-
[SubstanceStructIds.isLiquid]?: boolean;
|
|
15
|
-
[SubstanceStructIds.flowRate]?: number;
|
|
16
|
-
[SubstanceStructIds.isWindAffected]?: boolean;
|
|
17
4
|
}
|
|
18
5
|
export type VoxelSubstanceData = {
|
|
19
6
|
id: string;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (SubstanceStructIds) {
|
|
3
|
-
SubstanceStructIds["parent"] = "dve_parent_substance";
|
|
4
|
-
SubstanceStructIds["isSolid"] = "dve_is_solid";
|
|
5
|
-
SubstanceStructIds["isTransparent"] = "dve_is_transparent";
|
|
6
|
-
SubstanceStructIds["isLiquid"] = "dve_is_liquid";
|
|
7
|
-
SubstanceStructIds["flowRate"] = "dve_flow_rate";
|
|
8
|
-
SubstanceStructIds["isWindAffected"] = "dve_is_wind_affected";
|
|
9
|
-
})(SubstanceStructIds || (SubstanceStructIds = {}));
|
|
1
|
+
export {};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { Vec3Array } from "@amodx/math";
|
|
2
2
|
import { LocationData } from "../../Math";
|
|
3
|
+
import { BinaryBufferData } from "../../Util/Binary/BinaryBuffer";
|
|
4
|
+
export type ArchivedLightSegments = "sun" | "red" | "green" | "blue";
|
|
3
5
|
/**
|
|
4
6
|
* Interface for an archived sector.
|
|
5
7
|
*/
|
|
6
8
|
export interface ArchivedSectorData {
|
|
7
|
-
/**
|
|
9
|
+
/** A user provided version of the data. */
|
|
8
10
|
version: string;
|
|
11
|
+
/** The version of vlox the data was stored in. */
|
|
12
|
+
vloxVersion: string;
|
|
9
13
|
/** The location of the sector in the world. */
|
|
10
14
|
location: LocationData;
|
|
11
|
-
/** Record of the sector's
|
|
12
|
-
|
|
15
|
+
/** Record of the sector's bit flags. */
|
|
16
|
+
flags: Record<string, boolean>;
|
|
17
|
+
/** Record of the sector's timestamps. */
|
|
18
|
+
timestamps: Record<string, number>;
|
|
13
19
|
/** The palette data used within the sector. */
|
|
14
20
|
palettes: ArchivedSectorPaletteData;
|
|
15
21
|
/** Placeholder for future buffer data. */
|
|
16
22
|
buffers: ArchivedSectorBuffersData;
|
|
17
|
-
|
|
18
|
-
keys: ArchivedSectorKeysData;
|
|
23
|
+
duplicates: ArchivedSectorDuplicteData;
|
|
19
24
|
/** Array of archived section data within the sector. */
|
|
20
|
-
sections: ArchivedSectionData[];
|
|
25
|
+
sections: (ArchivedSectionData | string)[];
|
|
26
|
+
}
|
|
27
|
+
export interface ArchivedSectorDuplicteData {
|
|
28
|
+
sections?: Record<string, ArchivedSectionData>;
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
31
|
* Interface for the palettes of an archived sector.
|
|
24
32
|
*/
|
|
25
33
|
export interface ArchivedSectorPaletteData {
|
|
26
34
|
id: string[];
|
|
27
|
-
secondaryId
|
|
28
|
-
level?: Uint8Array;
|
|
29
|
-
stateMap: Record<number, any[]>;
|
|
30
|
-
modMap: Record<number, any[]>;
|
|
35
|
+
secondaryId: string[];
|
|
31
36
|
state: Uint16Array;
|
|
37
|
+
stateMap: Record<number, any[]>;
|
|
32
38
|
mod: Uint16Array;
|
|
33
|
-
|
|
39
|
+
modMap: Record<number, any[]>;
|
|
40
|
+
level?: Uint8Array;
|
|
41
|
+
light: Partial<Record<ArchivedLightSegments, Uint8Array>>;
|
|
34
42
|
secondaryState?: Uint16Array;
|
|
35
43
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Interface for the keys of an archived sector.
|
|
38
|
-
*/
|
|
39
|
-
export interface ArchivedSectorKeysData {
|
|
40
|
-
/** Array of strings that are the keys for the section state struct. */
|
|
41
|
-
sectionState: string[];
|
|
42
|
-
}
|
|
43
44
|
/**
|
|
44
45
|
* Placeholder interface for future buffer data in a sector.
|
|
45
46
|
*/
|
|
@@ -49,10 +50,10 @@ export interface ArchivedSectorBuffersData {
|
|
|
49
50
|
* Interface for an archived section.
|
|
50
51
|
*/
|
|
51
52
|
export interface ArchivedSectionData {
|
|
52
|
-
/**
|
|
53
|
-
|
|
53
|
+
/** Record of the sections's bit flags. */
|
|
54
|
+
flags?: Record<string, boolean>;
|
|
54
55
|
/** Palette data used within the section. */
|
|
55
|
-
palettes
|
|
56
|
+
palettes?: ArchivedSectionPaletteData;
|
|
56
57
|
/** Buffer data for the section, holding voxel type identifiers, light data, state, and secondary state. */
|
|
57
58
|
buffers: ArchivedSectionBuffers;
|
|
58
59
|
}
|
|
@@ -61,7 +62,7 @@ export interface ArchivedSectionData {
|
|
|
61
62
|
*/
|
|
62
63
|
export interface ArchivedSectionPaletteData {
|
|
63
64
|
id?: Uint16Array;
|
|
64
|
-
light?:
|
|
65
|
+
light?: Partial<Record<ArchivedLightSegments, Uint8Array>>;
|
|
65
66
|
level?: Uint8Array;
|
|
66
67
|
secondaryId?: Uint16Array;
|
|
67
68
|
state?: Uint16Array;
|
|
@@ -72,12 +73,15 @@ export interface ArchivedSectionPaletteData {
|
|
|
72
73
|
* Interface representing the buffer data for a section.
|
|
73
74
|
*/
|
|
74
75
|
export interface ArchivedSectionBuffers {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
buried?: Uint8Array | number;
|
|
77
|
+
voxelMap?: Uint8Array | number;
|
|
78
|
+
dirtyMap?: Uint8Array | number;
|
|
79
|
+
id?: BinaryBufferData | number;
|
|
80
|
+
light?: Partial<Record<ArchivedLightSegments, BinaryBufferData | number>>;
|
|
81
|
+
level?: BinaryBufferData | number;
|
|
82
|
+
state?: BinaryBufferData | number;
|
|
83
|
+
mod?: BinaryBufferData | number;
|
|
84
|
+
secondary?: BinaryBufferData | number;
|
|
81
85
|
}
|
|
82
86
|
/**
|
|
83
87
|
* Interface for an archived area.
|
|
@@ -133,14 +137,14 @@ export interface ArchivedAreaKeysData {
|
|
|
133
137
|
*/
|
|
134
138
|
export interface ArchivedAreaSectorPaletteData {
|
|
135
139
|
id: string[];
|
|
136
|
-
light
|
|
137
|
-
level
|
|
138
|
-
state
|
|
139
|
-
mod
|
|
140
|
+
light: Uint16Array;
|
|
141
|
+
level: Uint8Array;
|
|
142
|
+
state: Uint16Array;
|
|
143
|
+
mod: Uint16Array;
|
|
140
144
|
stateMap: Record<number, any[]>;
|
|
141
145
|
modMap: Record<number, any[]>;
|
|
142
|
-
secondaryId
|
|
143
|
-
secondaryState
|
|
146
|
+
secondaryId: string[];
|
|
147
|
+
secondaryState: Uint16Array;
|
|
144
148
|
}
|
|
145
149
|
/**
|
|
146
150
|
* Interface representing the archived data for a sector within an area.
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { BinaryObject } from "@amodx/binary";
|
|
2
|
-
import {
|
|
3
|
-
const charset = "0123456789ABCDEF";
|
|
4
|
-
function uint16To4CharString(value) {
|
|
5
|
-
if (value < 0 || value > 0xffff) {
|
|
6
|
-
throw new RangeError("Value must be a 16-bit unsigned integer.");
|
|
7
|
-
}
|
|
8
|
-
const chars = [];
|
|
9
|
-
for (let i = 0; i < 4; i++) {
|
|
10
|
-
const charCode = (value >> (i * 4)) & 0x0f;
|
|
11
|
-
chars.unshift(charset[charCode]);
|
|
12
|
-
}
|
|
13
|
-
const result = chars.join("").replace(/^0+(?!$)/, "");
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
let sectorStructInstance;
|
|
2
|
+
import { uint16To4CharString } from "./Shared";
|
|
17
3
|
const processPalettes = (archiveData) => {
|
|
18
4
|
const allRegistered = new Set();
|
|
19
5
|
for (const sector of archiveData.sectors) {
|
|
@@ -107,7 +93,7 @@ const buildSectorState = (archiveData) => {
|
|
|
107
93
|
const maped = new Map();
|
|
108
94
|
const binaryObjects = new Map();
|
|
109
95
|
let count = 0;
|
|
110
|
-
const sectorStateKeys =
|
|
96
|
+
const sectorStateKeys = [];
|
|
111
97
|
const created = new Map();
|
|
112
98
|
const processSectorState = (sector, sectorStateMap) => {
|
|
113
99
|
if (typeof sector.sectorState == "string")
|
|
@@ -227,8 +213,7 @@ function SectorToArchivedAreaSector(sector) {
|
|
|
227
213
|
palettes.id = sector.palettes.id;
|
|
228
214
|
if (sector.palettes.secondaryId)
|
|
229
215
|
palettes.secondaryId = sector.palettes.secondaryId;
|
|
230
|
-
if (sector.palettes.light)
|
|
231
|
-
palettes.light = sector.palettes.light;
|
|
216
|
+
// if (sector.palettes.light) palettes.light = sector.palettes.light;
|
|
232
217
|
if (sector.palettes.secondaryState)
|
|
233
218
|
palettes.secondaryState = sector.palettes.secondaryState;
|
|
234
219
|
if (sector.palettes.state)
|
|
@@ -239,16 +224,14 @@ function SectorToArchivedAreaSector(sector) {
|
|
|
239
224
|
sector.palettes.modMap = sector.palettes.modMap;
|
|
240
225
|
return {
|
|
241
226
|
position: [sector.location[1], sector.location[2], sector.location[3]],
|
|
242
|
-
sectorState: sector.
|
|
227
|
+
sectorState: sector.flags,
|
|
243
228
|
buffers: sector.buffers,
|
|
244
229
|
palettes,
|
|
245
230
|
sections: sector.sections,
|
|
246
231
|
};
|
|
247
232
|
}
|
|
248
233
|
export default function CreateArchiveArea(archiveData) {
|
|
249
|
-
|
|
250
|
-
sectorStructInstance = Sector.StateStruct.instantiate();
|
|
251
|
-
const sectorStateKeys = sectorStructInstance.getKeys();
|
|
234
|
+
const sectorStateKeys = [];
|
|
252
235
|
const sectors = [];
|
|
253
236
|
for (const sector of archiveData.sectors) {
|
|
254
237
|
sectors.push(SectorToArchivedAreaSector(sector));
|
|
@@ -258,7 +241,8 @@ export default function CreateArchiveArea(archiveData) {
|
|
|
258
241
|
version: "",
|
|
259
242
|
keys: {
|
|
260
243
|
sectorState: sectorStateKeys,
|
|
261
|
-
sectionState:
|
|
244
|
+
sectionState: []
|
|
245
|
+
// sectionState: archiveData.sectors[0].keys.sectionState,
|
|
262
246
|
},
|
|
263
247
|
maps: {
|
|
264
248
|
sectorState: buildSectorState(archiveData),
|
|
@@ -289,10 +273,11 @@ export function CreateSectorFromArea(area, sector) {
|
|
|
289
273
|
id[i] = area.maps.id[i];
|
|
290
274
|
}
|
|
291
275
|
palettes.id = id;
|
|
292
|
-
palettes.light =
|
|
276
|
+
/* palettes.light =
|
|
293
277
|
typeof sector.palettes.light == "string"
|
|
294
|
-
|
|
295
|
-
|
|
278
|
+
? area.maps.lightPalette[sector.palettes.light]
|
|
279
|
+
: sector.palettes.light;
|
|
280
|
+
*/
|
|
296
281
|
palettes.level =
|
|
297
282
|
typeof sector.palettes.level == "string"
|
|
298
283
|
? area.maps.levelPalette[sector.palettes.level]
|
|
@@ -333,11 +318,14 @@ export function CreateSectorFromArea(area, sector) {
|
|
|
333
318
|
}
|
|
334
319
|
return {
|
|
335
320
|
version: area.version,
|
|
321
|
+
vloxVersion: area.version,
|
|
336
322
|
location: [area.dimension, ...sector.position],
|
|
337
|
-
sectorState,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
323
|
+
flags: sectorState,
|
|
324
|
+
timestamps: {},
|
|
325
|
+
/* keys: {
|
|
326
|
+
sectionState: area.keys.sectionState,
|
|
327
|
+
}, */
|
|
328
|
+
duplicates: {},
|
|
341
329
|
palettes,
|
|
342
330
|
buffers: sector.buffers,
|
|
343
331
|
sections,
|