soonspacejs 2.16.8 → 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.
@@ -1,23 +0,0 @@
1
- import { BatchedMesh, Material, Mesh } from 'three';
2
- export interface AutoBatchedCandidate<T> {
3
- source: Mesh;
4
- value: T;
5
- }
6
- export interface AutoBatchedMeshBatch<T> {
7
- proxy: BatchedMesh;
8
- values: T[];
9
- usesInstanceColor: boolean;
10
- ownedMaterial?: Material;
11
- }
12
- interface CreateAutoBatchedMeshOptions {
13
- minInstances: number;
14
- maxInstancesPerBatch: number;
15
- }
16
- export interface AutoBatchedMeshResult<T> {
17
- batches: AutoBatchedMeshBatch<T>[];
18
- batchedValues: Set<T>;
19
- }
20
- export declare function getAutoBatchedMaterialKey(source: Mesh): string | null;
21
- export declare function getAutoBatchedMaterialColor(source: Mesh): number | null;
22
- export declare function createAutoBatchedMeshes<T>(candidates: AutoBatchedCandidate<T>[], options: CreateAutoBatchedMeshOptions): AutoBatchedMeshResult<T>;
23
- export {};
@@ -1,118 +0,0 @@
1
- import { Box3, Group as ThreeGroup, Mesh, Object3D, Raycaster, Intersection } from 'three';
2
- import { default as Viewport } from '.';
3
- export interface AutoInstancingOptions {
4
- /**
5
- * 同步策略。safe 保持 render 时全量兜底,signal 仅处理显式变更信号。
6
- */
7
- syncMode?: 'safe' | 'signal';
8
- /**
9
- * 同一批次至少包含多少个 Mesh 时才创建 InstancedMesh。
10
- */
11
- minInstances?: number;
12
- /**
13
- * 单个 InstancedMesh 批次允许包含的最大实例数。
14
- * 限制批次规模可以降低动态更新和包围体重算的成本。
15
- */
16
- maxInstancesPerBatch?: number;
17
- /**
18
- * 连续多少帧发生局部变换后,将对象从静态批次提升为独立代理。
19
- */
20
- dynamicPromotionFrames?: number;
21
- /**
22
- * 透明双面代理是否使用单通道绘制。
23
- * 仅在代理渲染期间生效,不修改源材质的持久状态。
24
- */
25
- transparentSinglePass?: boolean;
26
- /**
27
- * 是否跳过 image 为空但已标记更新的纹理上传。
28
- * 仅在代理渲染期间临时复位纹理版本,避免 WebGLRenderer 每帧重复重试和告警。
29
- */
30
- skipEmptyTextureUploads?: boolean;
31
- }
32
- export interface AutoInstancingStats {
33
- active: boolean;
34
- sourceObjects: number;
35
- sourceRenderables: number;
36
- instancedBatches: number;
37
- instancedObjects: number;
38
- mergedBatches: number;
39
- mergedObjects: number;
40
- batchedBatches: number;
41
- batchedObjects: number;
42
- passthroughObjects: number;
43
- unsupportedObjects: number;
44
- multiDrawSupported: boolean;
45
- }
46
- declare class AutoInstancingManager {
47
- readonly viewport: Viewport;
48
- readonly proxyRoot: ThreeGroup<import('three').Object3DEventMap>;
49
- private roots;
50
- private pendingRoots;
51
- private pendingRootSyncRequested;
52
- private sourceToProxy;
53
- private sourceBindings;
54
- private proxyBindings;
55
- private dynamicSources;
56
- private excludedRoots;
57
- private excludedSubtrees;
58
- private outlineIndependentSources;
59
- private outlineSources;
60
- private outlineSourceSet;
61
- private safeBeforeRenderListeners;
62
- private beforeRenderListenerBaseline;
63
- private activeEmptyTextureVersions;
64
- private autoMode;
65
- private autoModeOptions;
66
- private isRendering;
67
- constructor(viewport: Viewport);
68
- setEnabled(enabled: boolean, options?: AutoInstancingOptions): AutoInstancingStats[];
69
- registerRoot(root: Object3D, options?: AutoInstancingOptions): AutoInstancingStats | null;
70
- unregisterRoot(root: Object3D, excludeFromAutoMode?: boolean): void;
71
- getStats(root?: Object3D): AutoInstancingStats | AutoInstancingStats[] | null;
72
- getBounds(root: Object3D): Box3 | null;
73
- requestSync(): void;
74
- markBeforeRenderListenerSafe(listener: () => void): void;
75
- unmarkBeforeRenderListenerSafe(listener: () => void): void;
76
- clearSafeBeforeRenderListeners(): void;
77
- hasUnsafeBeforeRenderListeners(numListeners: number): boolean;
78
- setOutlineSelection(sources: Mesh[]): Mesh[];
79
- getOutlineSelection(): Mesh[];
80
- withRenderProxies<T>(render: () => T): T;
81
- beginRender(forceSourceSync?: boolean): void;
82
- endRender(): void;
83
- getRaycastObjects(objects: Object3D | Object3D[]): Object3D | Object3D[];
84
- resolveIntersection<TObject extends Object3D = Object3D>(intersection: Intersection<TObject>, raycaster?: Raycaster, sourceIntersections?: Map<Object3D<import('three').Object3DEventMap>, Intersection<Object3D<import('three').Object3DEventMap>>[]>): Intersection<TObject> | null;
85
- resolveIntersections<TObject extends Object3D = Object3D>(intersections: Intersection<TObject>[], raycaster?: Raycaster): Intersection<TObject>[];
86
- clear(): void;
87
- dispose(): void;
88
- restoreSignalListeners(): void;
89
- private _createBinding;
90
- private _syncRoot;
91
- private _updateRootBounds;
92
- private _updateProxyBindings;
93
- private _syncInstancedMeshBounds;
94
- private _isSourceWorldVisible;
95
- private _syncOwnedProxyMaterials;
96
- private _ensureOutlineProxy;
97
- private _removeOutlineProxy;
98
- private _promoteDynamicDescendants;
99
- private _isTrackedDescendant;
100
- private _requiresPartialRendering;
101
- private _hideManagedSources;
102
- private _restoreRoot;
103
- private _removeBinding;
104
- private _rebuildDirtyRoots;
105
- private _supportsMultiDraw;
106
- private _applyEmptyTextureGuards;
107
- private _restoreEmptyTextureVersions;
108
- private _normalizeOptions;
109
- private _registerSceneRoots;
110
- private _removeInvalidRoots;
111
- private _partitionNestedRoots;
112
- private _handleObjectAdded;
113
- private _handleObjectRemoved;
114
- private _handleSourceChanged;
115
- private _handleMaterialChanged;
116
- private _retryPendingRoots;
117
- }
118
- export default AutoInstancingManager;
@@ -1,21 +0,0 @@
1
- import { Mesh } from 'three';
2
- export interface AutoMergedCandidate<T> {
3
- source: Mesh;
4
- value: T;
5
- }
6
- export interface AutoMergedMeshBatch<T> {
7
- proxy: Mesh;
8
- values: T[];
9
- faceEnds: number[];
10
- }
11
- interface CreateAutoMergedMeshOptions {
12
- minInstances: number;
13
- maxInstancesPerBatch: number;
14
- maxRootBytes: number;
15
- }
16
- export interface AutoMergedMeshResult<T> {
17
- batches: AutoMergedMeshBatch<T>[];
18
- mergedValues: Set<T>;
19
- }
20
- export declare function createAutoMergedMeshes<T>(candidates: AutoMergedCandidate<T>[], options: CreateAutoMergedMeshOptions): AutoMergedMeshResult<T>;
21
- export {};