soonspacejs 3.0.0-alpha.2 → 3.0.0-alpha.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soonspacejs",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.3",
4
4
  "homepage": "https://www.xwbuilders.com/soonspacejs/",
5
5
  "description": "SoonSpace.js 3.0 alpha",
6
6
  "module": "./dist/index.esm.js",
@@ -56,6 +56,7 @@ export declare class EntityCollection {
56
56
  instancedBatches: number;
57
57
  batchedBatches: number;
58
58
  independentObjects: number;
59
+ lineBatches: number;
59
60
  };
60
61
  /** Selection identity is retained even when the optional visual overlay is disabled. */
61
62
  setSelection(entities: readonly Entity[], options?: {
@@ -34,6 +34,7 @@ export declare class EntityRenderer {
34
34
  private selectionDirty;
35
35
  private highlights;
36
36
  private highlightMaterial;
37
+ private highlightLineMaterial;
37
38
  constructor(sideVariants?: Pick<TransparentSideVariants, "register" | "unregister"> | undefined);
38
39
  add(input: EntityRenderInput): void;
39
40
  remove(entity: Entity): void;
@@ -46,6 +47,9 @@ export declare class EntityRenderer {
46
47
  private assignGroup;
47
48
  private rebuildGroup;
48
49
  private createBatch;
50
+ private createLineBatch;
51
+ private updateLineBatch;
52
+ private sortLineBatch;
49
53
  private updateBatch;
50
54
  pick(raycaster: Raycaster): EntityHit[];
51
55
  getBounds(entity: Entity): Box3;
@@ -56,6 +60,7 @@ export declare class EntityRenderer {
56
60
  instancedBatches: number;
57
61
  batchedBatches: number;
58
62
  independentObjects: number;
63
+ lineBatches: number;
59
64
  };
60
65
  private countBatch;
61
66
  private clearBatches;
@@ -1,6 +1,9 @@
1
1
  import { BufferGeometry, Material, Matrix4, Texture } from 'three';
2
2
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
3
3
  export interface ModelPart {
4
+ /** Omitted for triangle meshes. Basic line segments share the Entity lifecycle. */
5
+ kind?: 'mesh' | 'line-segments';
6
+ pickable?: boolean;
4
7
  geometry: BufferGeometry;
5
8
  material: Material | MaterialLease;
6
9
  matrix: Matrix4;
@@ -0,0 +1,28 @@
1
+ import { Object3D } from 'three';
2
+ import { ModelLease, ModelResources } from './ModelResources';
3
+ export interface StaticModelSnapshot {
4
+ object: Object3D;
5
+ model?: ModelLease;
6
+ empty?: boolean;
7
+ release: () => void;
8
+ }
9
+ export interface StaticModelExtraction extends StaticModelSnapshot {
10
+ restore: () => void;
11
+ }
12
+ /** Load-session cache. It owns snapshots, never resources borrowed from procedural factories. */
13
+ export declare class StaticModelPool {
14
+ private resources;
15
+ private options;
16
+ private materials;
17
+ private models;
18
+ private disposed;
19
+ constructor(resources: ModelResources, options?: {
20
+ pickableLines?: boolean;
21
+ ignoreRootVisibility?: boolean;
22
+ });
23
+ extract(root: Object3D): StaticModelExtraction;
24
+ /** Copy an immutable render snapshot without retaining/moving the source tree.
25
+ * The returned native remainder is owned by the snapshot, never the factory. */
26
+ snapshot(root: Object3D): StaticModelSnapshot;
27
+ dispose(): void;
28
+ }
@@ -1,4 +1,6 @@
1
1
  export { Entity, } from './Entity';
2
+ export { StaticModelPool, } from './StaticModelPool';
3
+ export type { StaticModelSnapshot, StaticModelExtraction, } from './StaticModelPool';
2
4
  export type { EntityOptions, EntityChange, } from './Entity';
3
5
  export { EntityCollection, } from './EntityCollection';
4
6
  export { ModelResources, ResourceLease, ModelResourceUnsupportedError, } from './ModelResources';
package/types/index.d.ts CHANGED
@@ -2201,6 +2201,7 @@ export declare class EntityCollection {
2201
2201
  instancedBatches: number;
2202
2202
  batchedBatches: number;
2203
2203
  independentObjects: number;
2204
+ lineBatches: number;
2204
2205
  };
2205
2206
  /** Selection identity is retained even when the optional visual overlay is disabled. */
2206
2207
  setSelection(entities: readonly Entity[], options?: {
@@ -3623,6 +3624,9 @@ declare class ModelManage extends DefaultManage {
3623
3624
  }
3624
3625
 
3625
3626
  export declare interface ModelPart {
3627
+ /** Omitted for triangle meshes. Basic line segments share the Entity lifecycle. */
3628
+ kind?: 'mesh' | 'line-segments';
3629
+ pickable?: boolean;
3626
3630
  geometry: BufferGeometry;
3627
3631
  material: Material | MaterialLease;
3628
3632
  matrix: Matrix4;
@@ -6114,6 +6118,35 @@ export declare interface State {
6114
6118
  };
6115
6119
  }
6116
6120
 
6121
+ export declare interface StaticModelExtraction extends StaticModelSnapshot {
6122
+ restore: () => void;
6123
+ }
6124
+
6125
+ /** Load-session cache. It owns snapshots, never resources borrowed from procedural factories. */
6126
+ export declare class StaticModelPool {
6127
+ private resources;
6128
+ private options;
6129
+ private materials;
6130
+ private models;
6131
+ private disposed;
6132
+ constructor(resources: ModelResources, options?: {
6133
+ pickableLines?: boolean;
6134
+ ignoreRootVisibility?: boolean;
6135
+ });
6136
+ extract(root: Object3D): StaticModelExtraction;
6137
+ /** Copy an immutable render snapshot without retaining/moving the source tree.
6138
+ * The returned native remainder is owned by the snapshot, never the factory. */
6139
+ snapshot(root: Object3D): StaticModelSnapshot;
6140
+ dispose(): void;
6141
+ }
6142
+
6143
+ export declare interface StaticModelSnapshot {
6144
+ object: Object3D;
6145
+ model?: ModelLease;
6146
+ empty?: boolean;
6147
+ release: () => void;
6148
+ }
6149
+
6117
6150
  export declare interface StrokeSelectOptions extends BaseSelectOptions {
6118
6151
  isOpacityShow?: boolean;
6119
6152
  edgeColor?: IColor;