@pilotdev/pilot-web-3d 24.19.0 → 24.21.0

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.
Files changed (2) hide show
  1. package/index.d.ts +79 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -985,6 +985,12 @@ export interface IIntersectionChecker<TOptions> {
985
985
  * @param options - (optional) intersection check options.
986
986
  */
987
987
  getAllIntersectionsByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
988
+ /**
989
+ * Gets bounding box of the model elements.
990
+ * @param elements
991
+ * @param options
992
+ */
993
+ getObjectsBoundingBox(elements: ModelElementIds[], options?: TOptions): THREE.Box3;
988
994
  }
989
995
  export interface ISceneIntersectionChecker extends IIntersectionChecker<SceneCheckOptions> {
990
996
  /** Gets the bounding box of the scene*/
@@ -1354,6 +1360,12 @@ export class GizmoBuilder {
1354
1360
  static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
1355
1361
  static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
1356
1362
  }
1363
+ export interface MergeableMaterial extends THREE.ShaderMaterial {
1364
+ readonly isMergeable?: boolean;
1365
+ color?: THREE.Color;
1366
+ mergeableHash?: number;
1367
+ hash?: number;
1368
+ }
1357
1369
  export abstract class CustomMaterial extends THREE.ShaderMaterial {
1358
1370
 
1359
1371
  constructor();
@@ -1365,16 +1377,19 @@ export abstract class CustomMaterial extends THREE.ShaderMaterial {
1365
1377
  protected onBeforeCompileCallback(shader: THREE.Shader): void;
1366
1378
  protected refreshTransformUniform(map: THREE.Texture, uniform: THREE.IUniform): void;
1367
1379
  protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
1380
+ protected materialHash(opacity?: number, color?: THREE.Color): number;
1368
1381
  }
1369
1382
  export interface CustomMeshLambertMaterialParameters extends THREE.ShaderMaterialParameters {
1370
1383
  instancing?: boolean | undefined;
1371
1384
  instancingColor?: boolean | undefined;
1372
1385
  color?: THREE.ColorRepresentation | undefined;
1373
1386
  }
1374
- export class CustomMeshLambertMaterial extends CustomMaterial {
1387
+ export class CustomMeshLambertMaterial extends CustomMaterial implements MergeableMaterial {
1375
1388
  type: string;
1389
+ isMergeable: boolean;
1376
1390
 
1377
1391
  constructor(parameters?: CustomMeshLambertMaterialParameters);
1392
+ get mergeableHash(): number;
1378
1393
  /**
1379
1394
  * @default false
1380
1395
  */
@@ -1402,10 +1417,12 @@ export interface CustomLineMaterialParameters extends THREE.ShaderMaterialParame
1402
1417
  instancingColor?: boolean | undefined;
1403
1418
  color?: THREE.ColorRepresentation | undefined;
1404
1419
  }
1405
- export class CustomLineMaterial extends CustomMaterial {
1420
+ export class CustomLineMaterial extends CustomMaterial implements MergeableMaterial {
1406
1421
  type: string;
1422
+ isMergeable: boolean;
1407
1423
 
1408
1424
  constructor(parameters?: CustomLineMaterialParameters);
1425
+ get mergeableHash(): number;
1409
1426
  /**
1410
1427
  * @default false
1411
1428
  */
@@ -3022,6 +3039,66 @@ export class Viewer3DConfiguration extends ViewerConfiguration {
3022
3039
  constructor(appearance?: ViewerSettings, render?: ViewerSettings);
3023
3040
  }
3024
3041
  export const defaultViewer3DSettings: ViewerSettings;
3042
+ export interface IBatchedMaterial extends CustomMaterial {
3043
+ textureSize: number;
3044
+ blockPosTexture: DataTexture;
3045
+ colorTexture: DataTexture;
3046
+ useBlockPosTexture: boolean;
3047
+ useBlockColorTexture: boolean;
3048
+ }
3049
+ export interface BatchedMaterialParameters extends THREE.ShaderMaterialParameters {
3050
+ textureSize?: number;
3051
+ useBlockColorTexture: boolean;
3052
+ useBlockPosTexture: boolean;
3053
+ }
3054
+ class BatchedMaterialBase extends CustomMaterial implements IBatchedMaterial {
3055
+
3056
+ constructor(parameters?: BatchedMaterialParameters);
3057
+ /**
3058
+ * @default 64
3059
+ */
3060
+ textureSize: number;
3061
+ /**
3062
+ * @default null
3063
+ */
3064
+ blockPosTexture: DataTexture;
3065
+ /**
3066
+ * @default null
3067
+ */
3068
+ colorTexture: DataTexture;
3069
+ /**
3070
+ * @default true
3071
+ */
3072
+ get useBlockPosTexture(): boolean;
3073
+ set useBlockPosTexture(value: boolean);
3074
+ /**
3075
+ * @default true
3076
+ */
3077
+ get useBlockColorTexture(): boolean;
3078
+ set useBlockColorTexture(value: boolean);
3079
+ protected refreshUniformsCommon(uniforms: {
3080
+ [uniform: string]: THREE.IUniform;
3081
+ }, material: BatchedMaterialBase, renderer: THREE.WebGLRenderer): void;
3082
+ protected refreshUniforms(uniforms: {
3083
+ [uniform: string]: THREE.IUniform;
3084
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
3085
+ copy(source: BatchedMaterialBase): this;
3086
+ protected materialHash(): number;
3087
+ dispose(): void;
3088
+ }
3089
+ export class BatchedMeshMaterial extends BatchedMaterialBase {
3090
+ type: string;
3091
+
3092
+ constructor(parameters?: BatchedMaterialParameters);
3093
+ static fromMaterial(material: THREE.Material, textureSize: number, useBlockColorTexture: boolean, useBlockPosTexture: boolean): BatchedMeshMaterial;
3094
+ }
3095
+ export class BatchedLineMaterial extends BatchedMaterialBase {
3096
+ type: string;
3097
+
3098
+ constructor(parameters?: BatchedMaterialParameters);
3099
+ static fromMaterial(material: THREE.Material, textureSize: number, useBlockColorTexture: boolean, useBlockPosTexture: boolean): BatchedLineMaterial;
3100
+ }
3101
+ export {};
3025
3102
  export class ModelLoadingOptions {
3026
3103
  guid: string;
3027
3104
  isConsolidatedModel?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "24.19.0",
3
+ "version": "24.21.0",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",