soonspacejs 3.0.0-alpha.0 → 3.0.0-alpha.1
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,7 @@ export declare class EntityCollection {
|
|
|
18
19
|
private pendingModels;
|
|
19
20
|
private selected;
|
|
20
21
|
private selectionDirty;
|
|
21
|
-
constructor(scene: Scene, requestRender: () => void, models: ModelResources);
|
|
22
|
+
constructor(scene: Scene, requestRender: () => void, models: ModelResources, sideVariants?: Pick<TransparentSideVariants, 'register' | 'unregister'>);
|
|
22
23
|
get roots(): readonly Entity[];
|
|
23
24
|
getById(id: string): Entity | undefined;
|
|
24
25
|
parentOf(entity: Entity): Entity | null;
|
|
@@ -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;
|
|
@@ -30,7 +32,7 @@ export declare class EntityRenderer {
|
|
|
30
32
|
private selectionDirty;
|
|
31
33
|
private highlights;
|
|
32
34
|
private highlightMaterial;
|
|
33
|
-
constructor();
|
|
35
|
+
constructor(sideVariants?: Pick<TransparentSideVariants, "register" | "unregister"> | undefined);
|
|
34
36
|
add(input: EntityRenderInput): void;
|
|
35
37
|
remove(entity: Entity): void;
|
|
36
38
|
setEnabled(enabled: boolean): void;
|
|
@@ -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,7 @@ export declare class EntityCollection {
|
|
|
2164
2164
|
private pendingModels;
|
|
2165
2165
|
private selected;
|
|
2166
2166
|
private selectionDirty;
|
|
2167
|
-
constructor(scene: Scene, requestRender: () => void, models: ModelResources);
|
|
2167
|
+
constructor(scene: Scene, requestRender: () => void, models: ModelResources, sideVariants?: Pick<TransparentSideVariants, 'register' | 'unregister'>);
|
|
2168
2168
|
get roots(): readonly Entity[];
|
|
2169
2169
|
getById(id: string): Entity | undefined;
|
|
2170
2170
|
parentOf(entity: Entity): Entity | null;
|
|
@@ -6487,6 +6487,33 @@ export declare interface Transition {
|
|
|
6487
6487
|
};
|
|
6488
6488
|
}
|
|
6489
6489
|
|
|
6490
|
+
/** Reuse immutable side-specific programs for Entity-owned Standard materials.
|
|
6491
|
+
* Only reuse materials with at least two registered supported users. Registration
|
|
6492
|
+
* count is not visible draw count: a hidden/culled second user still enables reuse.
|
|
6493
|
+
* Three still chooses each object's two passes and the complete render-list order.
|
|
6494
|
+
*/
|
|
6495
|
+
declare class TransparentSideVariants {
|
|
6496
|
+
private readonly renderer;
|
|
6497
|
+
private readonly objects;
|
|
6498
|
+
private readonly records;
|
|
6499
|
+
private sequence;
|
|
6500
|
+
private epoch;
|
|
6501
|
+
private enabled;
|
|
6502
|
+
private disposed;
|
|
6503
|
+
private readonly render;
|
|
6504
|
+
private readonly direct;
|
|
6505
|
+
private readonly wrappedRender;
|
|
6506
|
+
private readonly wrappedDirect;
|
|
6507
|
+
constructor(renderer: WebGLRenderer);
|
|
6508
|
+
private supported;
|
|
6509
|
+
register(mesh: Mesh): void;
|
|
6510
|
+
unregister(mesh: Mesh): void;
|
|
6511
|
+
private sync;
|
|
6512
|
+
setEnabled(enabled: boolean): void;
|
|
6513
|
+
private release;
|
|
6514
|
+
dispose(): void;
|
|
6515
|
+
}
|
|
6516
|
+
|
|
6490
6517
|
export declare interface TwoWaysLink {
|
|
6491
6518
|
pointAIndex: number;
|
|
6492
6519
|
pointBIndex: number;
|
|
@@ -6565,6 +6592,7 @@ declare class Viewport {
|
|
|
6565
6592
|
rendererCSS3D: CSS3DRenderer;
|
|
6566
6593
|
readonly models: ModelResources;
|
|
6567
6594
|
readonly entities: EntityCollection;
|
|
6595
|
+
private readonly transparentSideVariants;
|
|
6568
6596
|
pmremGenerator: PMREMGenerator;
|
|
6569
6597
|
info: Info;
|
|
6570
6598
|
stats: default_3;
|