soonspacejs 3.0.0-alpha.0 → 3.0.0-alpha.2
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/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { Box3, Matrix4, Object3D, Raycaster, Scene } from 'three';
|
|
|
2
2
|
import { Entity, EntityChange, EntityOptions } from './Entity';
|
|
3
3
|
import { EntityHit } from './EntityRenderer';
|
|
4
4
|
import { ModelResources, ModelLease, ModelLoadOptions } from './ModelResources';
|
|
5
|
+
import { TransparentSideVariants } from './TransparentSideVariants';
|
|
5
6
|
export declare class EntityCollection {
|
|
6
7
|
private scene;
|
|
7
8
|
private requestRender;
|
|
@@ -18,7 +19,8 @@ export declare class EntityCollection {
|
|
|
18
19
|
private pendingModels;
|
|
19
20
|
private selected;
|
|
20
21
|
private selectionDirty;
|
|
21
|
-
|
|
22
|
+
private selectionHighlight;
|
|
23
|
+
constructor(scene: Scene, requestRender: () => void, models: ModelResources, sideVariants?: Pick<TransparentSideVariants, 'register' | 'unregister'>);
|
|
22
24
|
get roots(): readonly Entity[];
|
|
23
25
|
getById(id: string): Entity | undefined;
|
|
24
26
|
parentOf(entity: Entity): Entity | null;
|
|
@@ -48,12 +50,17 @@ export declare class EntityCollection {
|
|
|
48
50
|
getStats(): {
|
|
49
51
|
updatedEntities: number;
|
|
50
52
|
entities: number;
|
|
53
|
+
sourceParts: number;
|
|
54
|
+
renderObjects: number;
|
|
55
|
+
rebuilds: number;
|
|
51
56
|
instancedBatches: number;
|
|
52
57
|
batchedBatches: number;
|
|
53
58
|
independentObjects: number;
|
|
54
|
-
rebuilds: number;
|
|
55
59
|
};
|
|
56
|
-
|
|
60
|
+
/** Selection identity is retained even when the optional visual overlay is disabled. */
|
|
61
|
+
setSelection(entities: readonly Entity[], options?: {
|
|
62
|
+
highlight?: boolean;
|
|
63
|
+
}): void;
|
|
57
64
|
getSelection(): readonly Entity[];
|
|
58
65
|
setInstancingEnabled(enabled: boolean): void;
|
|
59
66
|
setBatchedEnabled(enabled: boolean): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box3, Group, Matrix4, Raycaster, Intersection } from 'three';
|
|
2
2
|
import { Entity } from './Entity';
|
|
3
3
|
import { RegisteredPart } from './ModelResources';
|
|
4
|
+
import { TransparentSideVariants } from './TransparentSideVariants';
|
|
4
5
|
export interface EntityRenderInput {
|
|
5
6
|
entity: Entity;
|
|
6
7
|
parts: readonly RegisteredPart[];
|
|
@@ -14,6 +15,7 @@ export interface EntityHit extends Intersection {
|
|
|
14
15
|
attachment?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare class EntityRenderer {
|
|
18
|
+
private readonly sideVariants?;
|
|
17
19
|
readonly root: Group<import('three').Object3DEventMap>;
|
|
18
20
|
private entries;
|
|
19
21
|
private batches;
|
|
@@ -26,11 +28,13 @@ export declare class EntityRenderer {
|
|
|
26
28
|
private enabled;
|
|
27
29
|
private batchedEnabled;
|
|
28
30
|
private rebuilds;
|
|
31
|
+
private sourceParts;
|
|
32
|
+
private batchCounts;
|
|
29
33
|
private selection;
|
|
30
34
|
private selectionDirty;
|
|
31
35
|
private highlights;
|
|
32
36
|
private highlightMaterial;
|
|
33
|
-
constructor();
|
|
37
|
+
constructor(sideVariants?: Pick<TransparentSideVariants, "register" | "unregister"> | undefined);
|
|
34
38
|
add(input: EntityRenderInput): void;
|
|
35
39
|
remove(entity: Entity): void;
|
|
36
40
|
setEnabled(enabled: boolean): void;
|
|
@@ -46,11 +50,14 @@ export declare class EntityRenderer {
|
|
|
46
50
|
pick(raycaster: Raycaster): EntityHit[];
|
|
47
51
|
getBounds(entity: Entity): Box3;
|
|
48
52
|
getStats(): {
|
|
53
|
+
sourceParts: number;
|
|
54
|
+
renderObjects: number;
|
|
55
|
+
rebuilds: number;
|
|
49
56
|
instancedBatches: number;
|
|
50
57
|
batchedBatches: number;
|
|
51
58
|
independentObjects: number;
|
|
52
|
-
rebuilds: number;
|
|
53
59
|
};
|
|
60
|
+
private countBatch;
|
|
54
61
|
private clearBatches;
|
|
55
62
|
dispose(): void;
|
|
56
63
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Mesh, WebGLRenderer } from 'three';
|
|
2
|
+
/** Reuse immutable side-specific programs for Entity-owned Standard materials.
|
|
3
|
+
* Only reuse materials with at least two registered supported users. Registration
|
|
4
|
+
* count is not visible draw count: a hidden/culled second user still enables reuse.
|
|
5
|
+
* Three still chooses each object's two passes and the complete render-list order.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TransparentSideVariants {
|
|
8
|
+
private readonly renderer;
|
|
9
|
+
private readonly objects;
|
|
10
|
+
private readonly records;
|
|
11
|
+
private sequence;
|
|
12
|
+
private epoch;
|
|
13
|
+
private enabled;
|
|
14
|
+
private disposed;
|
|
15
|
+
private readonly render;
|
|
16
|
+
private readonly direct;
|
|
17
|
+
private readonly wrappedRender;
|
|
18
|
+
private readonly wrappedDirect;
|
|
19
|
+
constructor(renderer: WebGLRenderer);
|
|
20
|
+
private supported;
|
|
21
|
+
register(mesh: Mesh): void;
|
|
22
|
+
unregister(mesh: Mesh): void;
|
|
23
|
+
private sync;
|
|
24
|
+
setEnabled(enabled: boolean): void;
|
|
25
|
+
private release;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -2164,7 +2164,8 @@ export declare class EntityCollection {
|
|
|
2164
2164
|
private pendingModels;
|
|
2165
2165
|
private selected;
|
|
2166
2166
|
private selectionDirty;
|
|
2167
|
-
|
|
2167
|
+
private selectionHighlight;
|
|
2168
|
+
constructor(scene: Scene, requestRender: () => void, models: ModelResources, sideVariants?: Pick<TransparentSideVariants, 'register' | 'unregister'>);
|
|
2168
2169
|
get roots(): readonly Entity[];
|
|
2169
2170
|
getById(id: string): Entity | undefined;
|
|
2170
2171
|
parentOf(entity: Entity): Entity | null;
|
|
@@ -2194,12 +2195,17 @@ export declare class EntityCollection {
|
|
|
2194
2195
|
getStats(): {
|
|
2195
2196
|
updatedEntities: number;
|
|
2196
2197
|
entities: number;
|
|
2198
|
+
sourceParts: number;
|
|
2199
|
+
renderObjects: number;
|
|
2200
|
+
rebuilds: number;
|
|
2197
2201
|
instancedBatches: number;
|
|
2198
2202
|
batchedBatches: number;
|
|
2199
2203
|
independentObjects: number;
|
|
2200
|
-
rebuilds: number;
|
|
2201
2204
|
};
|
|
2202
|
-
|
|
2205
|
+
/** Selection identity is retained even when the optional visual overlay is disabled. */
|
|
2206
|
+
setSelection(entities: readonly Entity[], options?: {
|
|
2207
|
+
highlight?: boolean;
|
|
2208
|
+
}): void;
|
|
2203
2209
|
getSelection(): readonly Entity[];
|
|
2204
2210
|
setInstancingEnabled(enabled: boolean): void;
|
|
2205
2211
|
setBatchedEnabled(enabled: boolean): void;
|
|
@@ -6487,6 +6493,33 @@ export declare interface Transition {
|
|
|
6487
6493
|
};
|
|
6488
6494
|
}
|
|
6489
6495
|
|
|
6496
|
+
/** Reuse immutable side-specific programs for Entity-owned Standard materials.
|
|
6497
|
+
* Only reuse materials with at least two registered supported users. Registration
|
|
6498
|
+
* count is not visible draw count: a hidden/culled second user still enables reuse.
|
|
6499
|
+
* Three still chooses each object's two passes and the complete render-list order.
|
|
6500
|
+
*/
|
|
6501
|
+
declare class TransparentSideVariants {
|
|
6502
|
+
private readonly renderer;
|
|
6503
|
+
private readonly objects;
|
|
6504
|
+
private readonly records;
|
|
6505
|
+
private sequence;
|
|
6506
|
+
private epoch;
|
|
6507
|
+
private enabled;
|
|
6508
|
+
private disposed;
|
|
6509
|
+
private readonly render;
|
|
6510
|
+
private readonly direct;
|
|
6511
|
+
private readonly wrappedRender;
|
|
6512
|
+
private readonly wrappedDirect;
|
|
6513
|
+
constructor(renderer: WebGLRenderer);
|
|
6514
|
+
private supported;
|
|
6515
|
+
register(mesh: Mesh): void;
|
|
6516
|
+
unregister(mesh: Mesh): void;
|
|
6517
|
+
private sync;
|
|
6518
|
+
setEnabled(enabled: boolean): void;
|
|
6519
|
+
private release;
|
|
6520
|
+
dispose(): void;
|
|
6521
|
+
}
|
|
6522
|
+
|
|
6490
6523
|
export declare interface TwoWaysLink {
|
|
6491
6524
|
pointAIndex: number;
|
|
6492
6525
|
pointBIndex: number;
|
|
@@ -6565,6 +6598,7 @@ declare class Viewport {
|
|
|
6565
6598
|
rendererCSS3D: CSS3DRenderer;
|
|
6566
6599
|
readonly models: ModelResources;
|
|
6567
6600
|
readonly entities: EntityCollection;
|
|
6601
|
+
private readonly transparentSideVariants;
|
|
6568
6602
|
pmremGenerator: PMREMGenerator;
|
|
6569
6603
|
info: Info;
|
|
6570
6604
|
stats: default_3;
|