@miris-inc/core 0.0.2 → 0.0.4
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/core.mjs +161926 -0
- package/package.json +1 -1
- package/api.ts +0 -207
- package/camera.ts +0 -114
- package/change.ts +0 -19
- package/chunk.ts +0 -70
- package/index.ts +0 -26
- package/lod.ts +0 -116
- package/matrix4x4.ts +0 -7
- package/miris.ts +0 -360
- package/scene.ts +0 -184
- package/stream.ts +0 -154
- package/vite.config.ts +0 -20
package/package.json
CHANGED
package/api.ts
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import "core-js/proposals/array-buffer-base64";
|
|
2
|
-
// @ts-expect-error
|
|
3
|
-
// import jsBase64 from "./AquaApi.js?url&inline";
|
|
4
|
-
// // @ts-expect-error
|
|
5
|
-
// import wasmBase64 from "./AquaApi.wasm?url&inline";
|
|
6
|
-
|
|
7
|
-
// Determine if we should use inline imports based on build configuration
|
|
8
|
-
// let isReleaseBuild = true; // Default to release (inline) if config is missing
|
|
9
|
-
// try {
|
|
10
|
-
// const { mirisConfig } = await import("./api.config.ts");
|
|
11
|
-
// isReleaseBuild = mirisConfig.isRelease;
|
|
12
|
-
// } catch {
|
|
13
|
-
// // Config file missing or import failed, default to release build
|
|
14
|
-
// isReleaseBuild = true;
|
|
15
|
-
// }
|
|
16
|
-
|
|
17
|
-
// let client;
|
|
18
|
-
// let cwrap;
|
|
19
|
-
|
|
20
|
-
// if (isReleaseBuild) {
|
|
21
|
-
// // Release build: use inline imports
|
|
22
|
-
// // @ts-expect-error
|
|
23
|
-
// const jsBase64 = await import("./AquaApi.js?url&inline");
|
|
24
|
-
// // @ts-expect-error
|
|
25
|
-
// const wasmBase64 = await import("./AquaApi.wasm?url&inline");
|
|
26
|
-
|
|
27
|
-
// @ts-expect-error
|
|
28
|
-
import jsUrl from "./AquaApi.js?url";
|
|
29
|
-
// @ts-expect-error
|
|
30
|
-
import wasmUrl from "./AquaApi.wasm?url";
|
|
31
|
-
|
|
32
|
-
// Fetch the JS file and create a blob URL for dynamic import
|
|
33
|
-
const jsResponse = await fetch(jsUrl);
|
|
34
|
-
const jsBlob = await jsResponse.blob();
|
|
35
|
-
const url = URL.createObjectURL(jsBlob);
|
|
36
|
-
|
|
37
|
-
// Provide the WASM URL directly - this avoids base64 encoding/decoding for large files
|
|
38
|
-
const options = { mainScriptUrlOrBlob: url, locateFile: () => wasmUrl };
|
|
39
|
-
const client = await (await import(/* @vite-ignore */ url)).default(options);
|
|
40
|
-
const { cwrap } = client;
|
|
41
|
-
// } else {
|
|
42
|
-
// // Debug build: use non-inline imports
|
|
43
|
-
// // @ts-expect-error
|
|
44
|
-
// const jsUrl = await import("./AquaApi.js?url");
|
|
45
|
-
// // @ts-expect-error
|
|
46
|
-
// const wasmUrl = await import("./AquaApi.wasm?url");
|
|
47
|
-
|
|
48
|
-
// const options = {
|
|
49
|
-
// mainScriptUrlOrBlob: jsUrl.default,
|
|
50
|
-
// locateFile: () => wasmUrl.default,
|
|
51
|
-
// };
|
|
52
|
-
// client = await (
|
|
53
|
-
// await import(/* @vite-ignore */ jsUrl.default)
|
|
54
|
-
// ).default(options);
|
|
55
|
-
// cwrap = client.cwrap;
|
|
56
|
-
// }
|
|
57
|
-
|
|
58
|
-
console.log(client);
|
|
59
|
-
|
|
60
|
-
export enum SceneObjectType {
|
|
61
|
-
AssetRootObject = 0,
|
|
62
|
-
SceneObject,
|
|
63
|
-
StreamObject,
|
|
64
|
-
GaussianSplats,
|
|
65
|
-
LodCollection,
|
|
66
|
-
PointsObject,
|
|
67
|
-
Camera,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export enum LogLevel {
|
|
71
|
-
Trace = 0,
|
|
72
|
-
Debug,
|
|
73
|
-
Info,
|
|
74
|
-
Warn,
|
|
75
|
-
Error,
|
|
76
|
-
Critical,
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const activatedObjectIdsView = client.activatedObjectIdsView;
|
|
80
|
-
export const addStream = cwrap("AddStream", "number", [
|
|
81
|
-
"number",
|
|
82
|
-
"string",
|
|
83
|
-
"string",
|
|
84
|
-
"number",
|
|
85
|
-
"number",
|
|
86
|
-
]);
|
|
87
|
-
export const addStreamById = cwrap("AddStreamById", "number", [
|
|
88
|
-
"number",
|
|
89
|
-
"string",
|
|
90
|
-
"string",
|
|
91
|
-
"number",
|
|
92
|
-
"number",
|
|
93
|
-
]);
|
|
94
|
-
export const allocateSceneChangesArrays = client.AllocateSceneChangesArrays;
|
|
95
|
-
export const { AttributeInfo } = client;
|
|
96
|
-
export const createClient = cwrap("CreateClient", "number", []);
|
|
97
|
-
export const createdObjectIdsView = client.createdObjectIdsView;
|
|
98
|
-
export const { dataPtrView } = client;
|
|
99
|
-
export const deactivatedObjectIdsView = client.deactivatedObjectIdsView;
|
|
100
|
-
export const destroyClient = cwrap("DestroyClient", null, ["number"]);
|
|
101
|
-
export const free = client._free;
|
|
102
|
-
export const getAssets = client.GetAssets; //cwrap("GetAssets", "array", ["number", "string"]);
|
|
103
|
-
|
|
104
|
-
export const getAttribute = cwrap("GetAttribute", null, [
|
|
105
|
-
"number",
|
|
106
|
-
"number",
|
|
107
|
-
"string",
|
|
108
|
-
"number",
|
|
109
|
-
]);
|
|
110
|
-
export const getAttributeCount = cwrap("GetAttributeCount", "number", [
|
|
111
|
-
"number",
|
|
112
|
-
"number",
|
|
113
|
-
]);
|
|
114
|
-
export const getBoundingBox = cwrap("GetBoundingBox", null, [
|
|
115
|
-
"number",
|
|
116
|
-
"number",
|
|
117
|
-
"number",
|
|
118
|
-
]);
|
|
119
|
-
export const getSceneChanges = client.GetSceneChanges;
|
|
120
|
-
export const getSceneChangesCounts = client.GetSceneChangesCounts;
|
|
121
|
-
export const getSceneObjectChildren = cwrap("GetSceneObjectChildren", null, [
|
|
122
|
-
"number",
|
|
123
|
-
"number",
|
|
124
|
-
"number",
|
|
125
|
-
]);
|
|
126
|
-
export const getSceneObjectChildrenCount = cwrap(
|
|
127
|
-
"GetSceneObjectChildrenCount",
|
|
128
|
-
"number",
|
|
129
|
-
["number", "number"],
|
|
130
|
-
);
|
|
131
|
-
export const getSceneObjectParent = cwrap("GetSceneObjectParent", "number", [
|
|
132
|
-
"number",
|
|
133
|
-
"number",
|
|
134
|
-
]);
|
|
135
|
-
export const getSceneObjectType = cwrap("GetSceneObjectType", "number", [
|
|
136
|
-
"number",
|
|
137
|
-
"number",
|
|
138
|
-
]);
|
|
139
|
-
export const hasAttribute = cwrap("HasAttribute", "boolean", [
|
|
140
|
-
"number",
|
|
141
|
-
"number",
|
|
142
|
-
"string",
|
|
143
|
-
]);
|
|
144
|
-
export const isSceneObjectAncestorOf = cwrap(
|
|
145
|
-
"IsSceneObjectAncestorOf",
|
|
146
|
-
"boolean",
|
|
147
|
-
["number", "number", "number"],
|
|
148
|
-
);
|
|
149
|
-
export const heap32 = client.HEAP32;
|
|
150
|
-
export const heap8 = client.HEAP8;
|
|
151
|
-
export const heapF32 = client.HEAPF32;
|
|
152
|
-
export const heapU32 = client.HEAPU32;
|
|
153
|
-
export const heapU8 = client.HEAPU8;
|
|
154
|
-
export const lengthBytesUTF8 = client.lengthBytesUTF8;
|
|
155
|
-
export const lockScene = cwrap("LockScene", "boolean", ["number"]);
|
|
156
|
-
export const malloc = client._malloc;
|
|
157
|
-
export const modifiedObjectIdsView = client.modifiedObjectIdsView;
|
|
158
|
-
export const removeStream = cwrap("RemoveStream", "boolean", [
|
|
159
|
-
"number",
|
|
160
|
-
"number",
|
|
161
|
-
]);
|
|
162
|
-
export const { SceneChangeIds } = client;
|
|
163
|
-
export const setAssetViewerKey = cwrap("SetAssetViewerKey", null, [
|
|
164
|
-
"number",
|
|
165
|
-
"string",
|
|
166
|
-
]);
|
|
167
|
-
export const setMainCameraViewFrustum = cwrap(
|
|
168
|
-
"SetMainCameraViewFrustum",
|
|
169
|
-
null,
|
|
170
|
-
["number", "number", "number", "number", "number"],
|
|
171
|
-
);
|
|
172
|
-
export const setMainCameraTransform = cwrap("SetMainCameraTransform", null, [
|
|
173
|
-
"number",
|
|
174
|
-
"number",
|
|
175
|
-
]);
|
|
176
|
-
export const setSceneObjectTransform = cwrap("SetSceneObjectTransform", null, [
|
|
177
|
-
"number",
|
|
178
|
-
"number",
|
|
179
|
-
"number",
|
|
180
|
-
]);
|
|
181
|
-
export const stringToUTF8 = client.stringToUTF8;
|
|
182
|
-
export const unlockScene = cwrap("UnlockScene", null, ["number"]);
|
|
183
|
-
export const updateSceneExecution = cwrap("UpdateSceneExecution", null, [
|
|
184
|
-
"number",
|
|
185
|
-
]);
|
|
186
|
-
export const StringVector = client.StringVector;
|
|
187
|
-
export const setLogLevel = cwrap("SetLogLevel", null, ["number"]);
|
|
188
|
-
export const getLodIndex = cwrap("GetLodIndex", "number", ["number", "number"]);
|
|
189
|
-
export const getTransform = cwrap("GetTransform", null, [
|
|
190
|
-
"number",
|
|
191
|
-
"number",
|
|
192
|
-
"number",
|
|
193
|
-
]);
|
|
194
|
-
|
|
195
|
-
export const { SpatialFormat } = client;
|
|
196
|
-
export const { UpAxis } = client;
|
|
197
|
-
export const { MatrixOrder } = client;
|
|
198
|
-
export const { Handedness } = client;
|
|
199
|
-
export const { SetClientSpatialFormat } = client;
|
|
200
|
-
export const getAvailableEnvironments = client.GetAvailableEnvironments;
|
|
201
|
-
export const setServerEnvironment = cwrap("SetServerEnvironment", "boolean", [
|
|
202
|
-
"number",
|
|
203
|
-
"string",
|
|
204
|
-
]);
|
|
205
|
-
export const getDefaultEnvironment = cwrap("GetDefaultEnvironment", "string", [
|
|
206
|
-
"number",
|
|
207
|
-
]);
|
package/camera.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
free,
|
|
3
|
-
heapF32,
|
|
4
|
-
malloc,
|
|
5
|
-
setMainCameraViewFrustum,
|
|
6
|
-
setMainCameraTransform,
|
|
7
|
-
} from "./api";
|
|
8
|
-
import type { Matrix4x4Tuple } from "./matrix4x4";
|
|
9
|
-
import type Scene from "./scene";
|
|
10
|
-
|
|
11
|
-
type CameraInit = {
|
|
12
|
-
aspect: number;
|
|
13
|
-
fov: number;
|
|
14
|
-
near: number;
|
|
15
|
-
far: number;
|
|
16
|
-
matrix: Matrix4x4Tuple;
|
|
17
|
-
scene: Scene;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default class Camera {
|
|
21
|
-
static #idMap = new Map<number, Camera>();
|
|
22
|
-
|
|
23
|
-
static #keyMap = new Map<any, Camera>();
|
|
24
|
-
|
|
25
|
-
static forId(id?: number) {
|
|
26
|
-
if (!id) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
return this.#idMap.get(id);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static forKey(key: any) {
|
|
33
|
-
return this.#keyMap.get(key);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
declare readonly id: number;
|
|
37
|
-
|
|
38
|
-
update() {
|
|
39
|
-
const matrixBuffer = malloc(this.#matrix.length * 4);
|
|
40
|
-
heapF32.set(Float32Array.from(this.#matrix), matrixBuffer / 4);
|
|
41
|
-
setMainCameraTransform(this.scene.handle, matrixBuffer);
|
|
42
|
-
free(matrixBuffer);
|
|
43
|
-
|
|
44
|
-
setMainCameraViewFrustum(
|
|
45
|
-
this.scene.handle,
|
|
46
|
-
this.#aspect,
|
|
47
|
-
this.#fov,
|
|
48
|
-
this.#near,
|
|
49
|
-
this.#far
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
#aspect: number;
|
|
54
|
-
|
|
55
|
-
get aspect() {
|
|
56
|
-
return this.#aspect;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
set aspect(aspect) {
|
|
60
|
-
this.#aspect = aspect;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
#fov: number;
|
|
64
|
-
|
|
65
|
-
get fov() {
|
|
66
|
-
return this.#fov;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
set fov(fov) {
|
|
70
|
-
this.#fov = fov;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
#near: number;
|
|
74
|
-
|
|
75
|
-
get near() {
|
|
76
|
-
return this.#near;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
set near(near) {
|
|
80
|
-
this.#near = near;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
#far: number;
|
|
84
|
-
|
|
85
|
-
get far() {
|
|
86
|
-
return this.#far;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
set far(far) {
|
|
90
|
-
this.#far = far;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
#matrix: Matrix4x4Tuple;
|
|
94
|
-
|
|
95
|
-
get matrix() {
|
|
96
|
-
return this.#matrix;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
set matrix(matrix) {
|
|
100
|
-
this.#matrix = matrix;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
declare readonly scene: Scene;
|
|
104
|
-
|
|
105
|
-
constructor({ aspect, fov, near, far, matrix, scene }: CameraInit) {
|
|
106
|
-
this.#aspect = aspect;
|
|
107
|
-
this.#fov = fov;
|
|
108
|
-
this.#near = near;
|
|
109
|
-
this.#far = far;
|
|
110
|
-
this.#matrix = matrix;
|
|
111
|
-
|
|
112
|
-
Object.defineProperty(this, "scene", { value: scene });
|
|
113
|
-
}
|
|
114
|
-
}
|
package/change.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import Lod from "./lod";
|
|
2
|
-
|
|
3
|
-
export type ChangeInit = {
|
|
4
|
-
type: "created" | "activated" | "modified" | "deactivated";
|
|
5
|
-
lod: Lod;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export default class Change {
|
|
9
|
-
declare readonly type: ChangeInit["type"];
|
|
10
|
-
|
|
11
|
-
declare readonly lod: ChangeInit["lod"];
|
|
12
|
-
|
|
13
|
-
constructor({ type, lod }: ChangeInit) {
|
|
14
|
-
Object.defineProperties(this, {
|
|
15
|
-
type: { value: type },
|
|
16
|
-
lod: { value: lod },
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
package/chunk.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type Stream from "./stream";
|
|
2
|
-
import type Lod from "./lod";
|
|
3
|
-
|
|
4
|
-
export type ChunkInit = {
|
|
5
|
-
id: number;
|
|
6
|
-
stream: Stream;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default class Chunk {
|
|
10
|
-
static #keyMap = new Map<any, Chunk>();
|
|
11
|
-
|
|
12
|
-
static #idMap = new Map<number, Chunk>();
|
|
13
|
-
|
|
14
|
-
static forKey(key: any) {
|
|
15
|
-
return this.#keyMap.get(key);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static forId(id: number) {
|
|
19
|
-
return this.#idMap.get(id);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
declare readonly id: ChunkInit["id"];
|
|
23
|
-
|
|
24
|
-
#key: any;
|
|
25
|
-
|
|
26
|
-
get key() {
|
|
27
|
-
return this.#key ?? null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
set key(key) {
|
|
31
|
-
Chunk.#keyMap.delete(this.key);
|
|
32
|
-
|
|
33
|
-
if (key || 0 === key) {
|
|
34
|
-
Chunk.#keyMap.set(key, this);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
this.#key = key;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
#lods = new Set<Lod>();
|
|
41
|
-
|
|
42
|
-
get lods() {
|
|
43
|
-
return this.#lods;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
#transform: Float32Array;
|
|
47
|
-
|
|
48
|
-
set transform(transform: Float32Array) {
|
|
49
|
-
this.#transform = transform;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get transform(): Float32Array {
|
|
53
|
-
return this.#transform;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
declare readonly stream: Stream;
|
|
57
|
-
|
|
58
|
-
constructor({ id, stream }: ChunkInit) {
|
|
59
|
-
Object.defineProperties(this, {
|
|
60
|
-
id: { value: id },
|
|
61
|
-
stream: { value: stream },
|
|
62
|
-
});
|
|
63
|
-
Chunk.#idMap.set(id, this);
|
|
64
|
-
stream.add(this);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
add(lod: Lod) {
|
|
68
|
-
this.#lods.add(lod);
|
|
69
|
-
}
|
|
70
|
-
}
|
package/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export { default as Miris } from "./miris";
|
|
2
|
-
export * from "./miris";
|
|
3
|
-
|
|
4
|
-
export { default as Camera } from "./camera";
|
|
5
|
-
export * from "./camera";
|
|
6
|
-
|
|
7
|
-
export type { default as Change } from "./change";
|
|
8
|
-
export type * from "./change";
|
|
9
|
-
|
|
10
|
-
export { default as Chunk } from "./chunk";
|
|
11
|
-
export * from "./chunk";
|
|
12
|
-
|
|
13
|
-
export { default as Lod } from "./lod";
|
|
14
|
-
export * from "./lod";
|
|
15
|
-
|
|
16
|
-
export { default as Scene } from "./scene";
|
|
17
|
-
export * from "./scene";
|
|
18
|
-
|
|
19
|
-
export { default as Stream } from "./stream";
|
|
20
|
-
export * from "./stream";
|
|
21
|
-
|
|
22
|
-
const aquaConfigModules = import.meta.glob("./aqua-config.json", {
|
|
23
|
-
eager: true,
|
|
24
|
-
import: "default",
|
|
25
|
-
}) as Record<string, any>;
|
|
26
|
-
export const aquaConfig = aquaConfigModules["./aqua-config.json"] ?? {};
|
package/lod.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type Chunk from "./chunk";
|
|
2
|
-
|
|
3
|
-
export type LodInit = {
|
|
4
|
-
id: number;
|
|
5
|
-
chunk: Chunk;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export default class Lod {
|
|
9
|
-
static #keyMap = new Map<any, Lod>();
|
|
10
|
-
|
|
11
|
-
static #idMap = new Map<number, Lod>();
|
|
12
|
-
|
|
13
|
-
static forKey(key: any) {
|
|
14
|
-
return this.#keyMap.get(key);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static forId(id: number) {
|
|
18
|
-
return this.#idMap.get(id);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare readonly id: LodInit["id"];
|
|
22
|
-
|
|
23
|
-
#key: any;
|
|
24
|
-
#splats: Uint32Array;
|
|
25
|
-
#bounds: Float32Array;
|
|
26
|
-
#transform: Float32Array;
|
|
27
|
-
#lodIndex: number;
|
|
28
|
-
|
|
29
|
-
sh1Data: Uint32Array = null;
|
|
30
|
-
sh1Min: number = -1;
|
|
31
|
-
sh1Max: number = 1;
|
|
32
|
-
|
|
33
|
-
sh2Data: Uint32Array = null;
|
|
34
|
-
sh2Min: number = -1;
|
|
35
|
-
sh2Max: number = 1;
|
|
36
|
-
|
|
37
|
-
sh3Data: Uint32Array = null;
|
|
38
|
-
sh3Min: number = -1;
|
|
39
|
-
sh3Max: number = 1;
|
|
40
|
-
|
|
41
|
-
get key() {
|
|
42
|
-
return this.#key ?? null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
set key(key) {
|
|
46
|
-
Lod.#keyMap.delete(this.key);
|
|
47
|
-
|
|
48
|
-
if (key || 0 === key) {
|
|
49
|
-
Lod.#keyMap.set(key, this);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
this.#key = key;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare readonly chunk: Chunk;
|
|
56
|
-
|
|
57
|
-
set splats(splats: Uint32Array) {
|
|
58
|
-
this.#splats = splats;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
get splats(): Uint32Array {
|
|
62
|
-
return this.#splats;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
set bounds(bounds: Float32Array) {
|
|
66
|
-
this.#bounds = bounds;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
get bounds(): Float32Array {
|
|
70
|
-
return this.#bounds;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
set lodIndex(index: number) {
|
|
74
|
-
this.#lodIndex = index;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
get lodIndex(): number {
|
|
78
|
-
return this.#lodIndex;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
set transform(transform: Float32Array) {
|
|
82
|
-
this.#transform = transform;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
get transform(): Float32Array {
|
|
86
|
-
return this.#transform;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
setSh1(sh1Data: Uint32Array, sh1Min: number, sh1Max: number) {
|
|
90
|
-
this.sh1Data = sh1Data;
|
|
91
|
-
this.sh1Min = sh1Min;
|
|
92
|
-
this.sh1Max = sh1Max;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
setSh2(sh2Data: Uint32Array, sh2Min: number, sh2Max: number) {
|
|
96
|
-
this.sh2Data = sh2Data;
|
|
97
|
-
this.sh2Min = sh2Min;
|
|
98
|
-
this.sh2Max = sh2Max;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
setSh3(sh3Data: Uint32Array, sh3Min: number, sh3Max: number) {
|
|
102
|
-
this.sh3Data = sh3Data;
|
|
103
|
-
this.sh3Min = sh3Min;
|
|
104
|
-
this.sh3Max = sh3Max;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
constructor({ id, chunk }: LodInit) {
|
|
108
|
-
Object.defineProperties(this, {
|
|
109
|
-
id: { value: id },
|
|
110
|
-
chunk: { value: chunk },
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
Lod.#idMap.set(id, this);
|
|
114
|
-
chunk.add(this);
|
|
115
|
-
}
|
|
116
|
-
}
|