@needle-tools/engine 4.13.1-next.9fc3e64 → 4.14.0-beta

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 (91) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/components.needle.json +1 -1
  3. package/dist/generateMeshBVH.worker-DiCnZlf3.js +21 -0
  4. package/dist/{gltf-progressive-Dbi_Tfhb.js → gltf-progressive-Bm_6aEi4.js} +4 -4
  5. package/dist/{gltf-progressive-CaUGGjVL.umd.cjs → gltf-progressive-BttGBXw6.umd.cjs} +3 -3
  6. package/dist/{gltf-progressive-DuAR0MQR.min.js → gltf-progressive-T5WKTux5.min.js} +1 -1
  7. package/dist/loader.worker-BqODMeeW.js +23 -0
  8. package/dist/{materialx-B9ddsHcF.min.js → materialx-CJyQZtjt.min.js} +1 -1
  9. package/dist/{materialx-fkoFuRh3.js → materialx-DMs1E08Z.js} +2 -2
  10. package/dist/{materialx-BF23AVE8.umd.cjs → materialx-DaKKOoVk.umd.cjs} +1 -1
  11. package/dist/needle-engine.bundle-BW2VusZV.min.js +1646 -0
  12. package/dist/{needle-engine.bundle-Dqrh7aWw.umd.cjs → needle-engine.bundle-Cb5bKEqa.umd.cjs} +150 -157
  13. package/dist/{needle-engine.bundle-BZRE5G6O.js → needle-engine.bundle-D9VPvp5o.js} +7524 -7246
  14. package/dist/needle-engine.d.ts +589 -28
  15. package/dist/needle-engine.js +416 -415
  16. package/dist/needle-engine.min.js +1 -1
  17. package/dist/needle-engine.umd.cjs +1 -1
  18. package/dist/{postprocessing-BVNrgYZK.min.js → postprocessing-CctM1XIO.min.js} +1 -1
  19. package/dist/{postprocessing-DdM-tz1j.js → postprocessing-DGm6qJ-I.js} +2 -2
  20. package/dist/{postprocessing-CI2TjWpu.umd.cjs → postprocessing-Dbl2PJpd.umd.cjs} +1 -1
  21. package/dist/{three-BW2s1Yl-.umd.cjs → three-BjYim-vL.umd.cjs} +4 -4
  22. package/dist/{three-VvRoMeIN.js → three-Bvk2VKbF.js} +4210 -4210
  23. package/dist/{three-I__hSXzr.min.js → three-IG2qPafA.min.js} +33 -33
  24. package/dist/{three-examples-Bpfu6ke_.umd.cjs → three-examples-BMmNgNCN.umd.cjs} +1 -1
  25. package/dist/{three-examples-BhfOE7NG.js → three-examples-CMYCd5nH.js} +1 -1
  26. package/dist/{three-examples-D8zAE_7t.min.js → three-examples-CQl1fFZp.min.js} +1 -1
  27. package/dist/{three-mesh-ui-C3QbemOV.min.js → three-mesh-ui-5HVE2RV-.min.js} +1 -1
  28. package/dist/{three-mesh-ui-CcMp-FQm.js → three-mesh-ui-BlakAItG.js} +1 -1
  29. package/dist/{three-mesh-ui-BU55xDxJ.umd.cjs → three-mesh-ui-D828VbQp.umd.cjs} +1 -1
  30. package/dist/{vendor-DW7zqjuT.min.js → vendor-BxK0WKmT.min.js} +1 -1
  31. package/dist/{vendor-COVQl0b8.umd.cjs → vendor-CIDkyBaO.umd.cjs} +1 -1
  32. package/dist/{vendor-BiyIZ61v.js → vendor-ixwD-vv2.js} +1 -1
  33. package/lib/engine/api.d.ts +1 -0
  34. package/lib/engine/api.js +1 -0
  35. package/lib/engine/api.js.map +1 -1
  36. package/lib/engine/engine_lightdata.js +8 -6
  37. package/lib/engine/engine_lightdata.js.map +1 -1
  38. package/lib/engine/engine_materialpropertyblock.d.ts +259 -0
  39. package/lib/engine/engine_materialpropertyblock.js +682 -0
  40. package/lib/engine/engine_materialpropertyblock.js.map +1 -0
  41. package/lib/engine-components/Camera.js.map +1 -1
  42. package/lib/engine-components/DropListener.js.map +1 -1
  43. package/lib/engine-components/Duplicatable.js.map +1 -1
  44. package/lib/engine-components/GroundProjection.js.map +1 -1
  45. package/lib/engine-components/NeedleMenu.js.map +1 -1
  46. package/lib/engine-components/NestedGltf.js.map +1 -1
  47. package/lib/engine-components/ReflectionProbe.d.ts +32 -4
  48. package/lib/engine-components/ReflectionProbe.js +58 -88
  49. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  50. package/lib/engine-components/Renderer.d.ts +2 -0
  51. package/lib/engine-components/Renderer.js +30 -6
  52. package/lib/engine-components/Renderer.js.map +1 -1
  53. package/lib/engine-components/RendererLightmap.d.ts +13 -9
  54. package/lib/engine-components/RendererLightmap.js +67 -81
  55. package/lib/engine-components/RendererLightmap.js.map +1 -1
  56. package/lib/engine-components/SeeThrough.d.ts +0 -2
  57. package/lib/engine-components/SeeThrough.js +114 -88
  58. package/lib/engine-components/SeeThrough.js.map +1 -1
  59. package/lib/engine-components/SmoothFollow.js.map +1 -1
  60. package/lib/engine-components/ui/Button.js.map +1 -1
  61. package/lib/engine-components/ui/Raycaster.js.map +1 -1
  62. package/lib/engine-components/web/ViewBox.d.ts +2 -2
  63. package/lib/engine-components/web/ViewBox.js +2 -2
  64. package/lib/engine-components/web/ViewBox.js.map +1 -1
  65. package/lib/engine-components/webxr/WebXRPlaneTracking.js.map +1 -1
  66. package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
  67. package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
  68. package/package.json +5 -5
  69. package/src/engine/api.ts +1 -0
  70. package/src/engine/engine_lightdata.ts +8 -6
  71. package/src/engine/engine_materialpropertyblock.ts +866 -0
  72. package/src/engine-components/Camera.ts +2 -2
  73. package/src/engine-components/DropListener.ts +1 -1
  74. package/src/engine-components/Duplicatable.ts +1 -1
  75. package/src/engine-components/GroundProjection.ts +3 -0
  76. package/src/engine-components/NeedleMenu.ts +3 -0
  77. package/src/engine-components/NestedGltf.ts +1 -1
  78. package/src/engine-components/ReflectionProbe.ts +64 -105
  79. package/src/engine-components/Renderer.ts +34 -6
  80. package/src/engine-components/RendererLightmap.ts +75 -87
  81. package/src/engine-components/SeeThrough.ts +122 -107
  82. package/src/engine-components/SmoothFollow.ts +2 -2
  83. package/src/engine-components/ui/Button.ts +1 -1
  84. package/src/engine-components/ui/Raycaster.ts +1 -1
  85. package/src/engine-components/web/ViewBox.ts +9 -2
  86. package/src/engine-components/webxr/WebXRPlaneTracking.ts +3 -3
  87. package/src/engine-components/webxr/controllers/XRControllerFollow.ts +1 -1
  88. package/src/engine-components/webxr/controllers/XRControllerMovement.ts +4 -4
  89. package/dist/generateMeshBVH.worker-iyfPIK6R.js +0 -21
  90. package/dist/loader.worker-C1GG9A7C.js +0 -23
  91. package/dist/needle-engine.bundle-DwybonUg.min.js +0 -1653
@@ -5,30 +5,30 @@ import { Mathf } from "../engine/engine_math.js";
5
5
  import { serializable } from "../engine/engine_serialization_decorator.js";
6
6
  import { getTempVector } from "../engine/engine_three_utils.js";
7
7
  import { getParam } from "../engine/engine_utils.js";
8
- import { USDObject, USDZExporterContext } from "./api.js";
9
8
  import type { Camera } from "./Camera.js";
10
9
  import { Behaviour } from "./Component.js";
11
10
  import { IUSDExporterExtension } from "./export/usdz/Extension.js";
12
11
  import { USDZExporter } from "./export/usdz/USDZExporter.js";
13
12
  import type { OrbitControls } from "./OrbitControls.js";
14
13
  import { Renderer } from "./Renderer.js";
14
+ import { MaterialPropertyBlock } from "../engine/engine_materialpropertyblock.js";
15
15
 
16
16
  const debugSeeThrough = getParam("debugseethrough");
17
17
 
18
- type MaterialState = {
19
- opacity: number,
20
- transparent: boolean,
21
- alphaHash: boolean
22
- }
23
-
24
- type MaterialWithState = Material & {
25
- /** Original values */
26
- userData: {
27
- seeThrough: {
28
- initial: MaterialState,
29
- }
30
- }
31
- };
18
+ // type MaterialState = {
19
+ // opacity: number,
20
+ // transparent: boolean,
21
+ // alphaHash: boolean
22
+ // }
23
+
24
+ // type MaterialWithState = Material & {
25
+ // /** Original values */
26
+ // userData: {
27
+ // seeThrough: {
28
+ // initial: MaterialState,
29
+ // }
30
+ // }
31
+ // };
32
32
 
33
33
  let i = 0;
34
34
 
@@ -176,26 +176,26 @@ export class SeeThrough extends Behaviour {
176
176
  onEnable() {
177
177
  this._needsUpdate = true;
178
178
  this._renderer = null;
179
- SeeThroughUsdzExporterPlugin.components.push(this);
179
+ // SeeThroughUsdzExporterPlugin.components.push(this);
180
180
  }
181
181
 
182
182
  /** @internal */
183
183
  onDisable() {
184
- this._renderer?.forEach(r => {
185
- const original = this.rendererMaterialsOriginal.get(r);
186
- for (let i = 0; i < r.sharedMaterials.length; i++) {
187
- const mat = r.sharedMaterials[i];
188
- if (!mat) continue;
189
- if (original && original[i]) {
190
- r.sharedMaterials[i] = original[i];
191
- }
192
- }
193
- this.rendererMaterials.delete(r);
194
- this.rendererMaterialsOriginal.delete(r);
195
- });
196
-
197
- const index = SeeThroughUsdzExporterPlugin.components.indexOf(this);
198
- if (index !== -1) SeeThroughUsdzExporterPlugin.components.splice(index, 1);
184
+ // this._renderer?.forEach(r => {
185
+ // const original = this.rendererMaterialsOriginal.get(r);
186
+ // for (let i = 0; i < r.sharedMaterials.length; i++) {
187
+ // const mat = r.sharedMaterials[i];
188
+ // if (!mat) continue;
189
+ // if (original && original[i]) {
190
+ // r.sharedMaterials[i] = original[i];
191
+ // }
192
+ // }
193
+ // this.rendererMaterials.delete(r);
194
+ // this.rendererMaterialsOriginal.delete(r);
195
+ // });
196
+
197
+ // const index = SeeThroughUsdzExporterPlugin.components.indexOf(this);
198
+ // if (index !== -1) SeeThroughUsdzExporterPlugin.components.splice(index, 1);
199
199
  }
200
200
 
201
201
  /**
@@ -239,8 +239,8 @@ export class SeeThrough extends Behaviour {
239
239
  }
240
240
  }
241
241
 
242
- private readonly rendererMaterials = new WeakMap<Renderer, Array<MaterialWithState>>();
243
- private readonly rendererMaterialsOriginal = new WeakMap<Renderer, Array<Material>>();
242
+ // private readonly rendererMaterials = new WeakMap<Renderer, Array<MaterialWithState>>();
243
+ // private readonly rendererMaterialsOriginal = new WeakMap<Renderer, Array<Material>>();
244
244
 
245
245
  private updateDirection() {
246
246
  this.referencePoint ??= this.context.scene;
@@ -272,66 +272,81 @@ export class SeeThrough extends Behaviour {
272
272
  renderer.gameObject.raycastAllowed = true;
273
273
  }
274
274
 
275
- if (!this.rendererMaterials.has(renderer)) {
276
- const originalMaterials = new Array<Material>();
277
- const clonedMaterials = new Array<MaterialWithState>();
278
-
279
- // We clone the materials once and store them, so we can modify the opacity without affecting other objects using the same material. This could potentially be optimized further to re-use materials between renderers if multiple renderers use the same material.
280
- for (let i = 0; i < renderer.sharedMaterials.length; i++) {
281
- const mat = renderer.sharedMaterials[i];
282
- if (!mat) continue;
283
- originalMaterials.push(mat);
284
- const matClone = mat.clone() as MaterialWithState;
285
- // @ts-ignore
286
- matClone.userData = mat.userData || {};
287
- matClone.userData.seeThrough = {
288
- initial: {
289
- opacity: matClone.opacity,
290
- transparent: matClone.transparent,
291
- alphaHash: matClone.alphaHash
292
- }
293
- }
294
- clonedMaterials.push(matClone);
295
- renderer.sharedMaterials[i] = matClone;
296
- }
297
-
298
- this.rendererMaterials.set(renderer, clonedMaterials);
299
- this.rendererMaterialsOriginal.set(renderer, originalMaterials);
300
- }
301
-
302
- const materials = renderer.hasLightmap ? renderer.sharedMaterials : this.rendererMaterials.get(renderer);
275
+ // if (!this.rendererMaterials.has(renderer)) {
276
+ // const originalMaterials = new Array<Material>();
277
+ // const clonedMaterials = new Array<MaterialWithState>();
278
+
279
+ // // We clone the materials once and store them, so we can modify the opacity without affecting other objects using the same material. This could potentially be optimized further to re-use materials between renderers if multiple renderers use the same material.
280
+ // for (let i = 0; i < renderer.sharedMaterials.length; i++) {
281
+ // const mat = renderer.sharedMaterials[i];
282
+ // if (!mat) continue;
283
+ // originalMaterials.push(mat);
284
+ // const matClone = mat.clone() as MaterialWithState;
285
+ // // @ts-ignore
286
+ // matClone.userData = mat.userData || {};
287
+ // matClone.userData.seeThrough = {
288
+ // initial: {
289
+ // opacity: matClone.opacity,
290
+ // transparent: matClone.transparent,
291
+ // alphaHash: matClone.alphaHash
292
+ // }
293
+ // }
294
+ // clonedMaterials.push(matClone);
295
+ // // renderer.sharedMaterials[i] = matClone;
296
+ // }
297
+
298
+ // this.rendererMaterials.set(renderer, clonedMaterials);
299
+ // this.rendererMaterialsOriginal.set(renderer, originalMaterials);
300
+ // }
301
+
302
+ const materials = renderer.sharedMaterials;// : this.rendererMaterials.get(renderer);
303
303
  if (!materials) return;
304
304
 
305
- for (const mat of materials) {
306
- if (!mat) continue;
305
+ const block = MaterialPropertyBlock.get(renderer.gameObject);
307
306
 
308
- let newAlpha = Mathf.lerp(mat.opacity, targetAlpha, duration <= 0 ? 1 : this.context.time.deltaTime / duration);;
309
- if (newAlpha >= 0.99) newAlpha = 1;
310
- else if (newAlpha <= 0.01) newAlpha = 0;
307
+ const currentOpacity = (block.getOverride("opacity")?.value ?? materials[0].opacity ?? 1);
311
308
 
309
+ let newAlpha = Mathf.lerp(currentOpacity, targetAlpha, duration <= 0 ? 1 : this.context.time.deltaTime / duration);;
310
+ if (newAlpha >= 0.99) newAlpha = 1;
311
+ else if (newAlpha <= 0.01) newAlpha = 0;
312
312
 
313
- const wasTransparent = mat.transparent;
314
- const wasAlphaHash = mat.alphaHash;
315
- const previousOpacity = mat.opacity;
313
+ // const currentTransparent = (block.getOverride("transparent")?.value ?? materials[0].transparent ?? false) as boolean;
316
314
 
317
- mat.alphaHash = this.useAlphaHash;
315
+ block.setOverride("alphaHash", this.useAlphaHash);
316
+ block.setOverride("opacity", newAlpha);
317
+ block.setOverride("transparent", newAlpha >= 0.99999 ? false : !this.useAlphaHash);
318
318
 
319
- if (mat.userData && "seeThrough" in mat.userData) {
320
- const initial = mat.userData.seeThrough.initial as MaterialState;
321
- mat.opacity = initial.opacity * newAlpha;
322
- mat.transparent = mat.opacity >= 1 ? initial.transparent : !this.useAlphaHash;
323
- }
324
- else {
325
- mat.transparent = mat.opacity >= 1 ? false : !this.useAlphaHash;
326
- }
327
319
 
328
- if (wasTransparent !== mat.transparent
329
- || wasAlphaHash !== mat.alphaHash
330
- || mat.opacity !== previousOpacity // MeshPhysicsMaterial needs that and maybe other materials too...
331
- ) {
332
- mat.needsUpdate = true;
333
- }
334
- }
320
+ // for (const mat of materials) {
321
+ // if (!mat) continue;
322
+
323
+ // let newAlpha = Mathf.lerp(mat.opacity, targetAlpha, duration <= 0 ? 1 : this.context.time.deltaTime / duration);;
324
+ // if (newAlpha >= 0.99) newAlpha = 1;
325
+ // else if (newAlpha <= 0.01) newAlpha = 0;
326
+
327
+
328
+ // const wasTransparent = mat.transparent;
329
+ // const wasAlphaHash = mat.alphaHash;
330
+ // const previousOpacity = mat.opacity;
331
+
332
+ // mat.alphaHash = this.useAlphaHash;
333
+
334
+ // if (mat.userData && "seeThrough" in mat.userData) {
335
+ // const initial = mat.userData.seeThrough.initial as MaterialState;
336
+ // mat.opacity = initial.opacity * newAlpha;
337
+ // mat.transparent = mat.opacity >= 1 ? initial.transparent : !this.useAlphaHash;
338
+ // }
339
+ // else {
340
+ // mat.transparent = mat.opacity >= 1 ? false : !this.useAlphaHash;
341
+ // }
342
+
343
+ // if (wasTransparent !== mat.transparent
344
+ // || wasAlphaHash !== mat.alphaHash
345
+ // || mat.opacity !== previousOpacity // MeshPhysicsMaterial needs that and maybe other materials too...
346
+ // ) {
347
+ // mat.needsUpdate = true;
348
+ // }
349
+ // }
335
350
  });
336
351
  }
337
352
 
@@ -339,33 +354,33 @@ export class SeeThrough extends Behaviour {
339
354
 
340
355
 
341
356
  ;
342
- class SeeThroughUsdzExporterPlugin implements IUSDExporterExtension {
357
+ // class SeeThroughUsdzExporterPlugin implements IUSDExporterExtension {
343
358
 
344
- static readonly components: SeeThrough[] = [];
359
+ // static readonly components: SeeThrough[] = [];
345
360
 
346
- get extensionName() {
347
- return "SeeThrough";
348
- }
361
+ // get extensionName() {
362
+ // return "SeeThrough";
363
+ // }
349
364
 
350
- // onExportObject(object: Object3D<Object3DEventMap>, model: USDObject, context: USDZExporterContext) {
351
- // const component = SeeThroughUsdzExporterPlugin.components.find(c => c.gameObject === object);
352
- // if(!component) return;
353
- // console.log("OH MY GOD SEE THROUGH USDZ EXPORTER", component, model);
365
+ // // onExportObject(object: Object3D<Object3DEventMap>, model: USDObject, context: USDZExporterContext) {
366
+ // // const component = SeeThroughUsdzExporterPlugin.components.find(c => c.gameObject === object);
367
+ // // if(!component) return;
368
+ // // console.log("OH MY GOD SEE THROUGH USDZ EXPORTER", component, model);
354
369
 
355
- // model.materialName = "AlphaHashMaterialInstance"; // we could make this unique per object if needed
370
+ // // model.materialName = "AlphaHashMaterialInstance"; // we could make this unique per object if needed
356
371
 
357
- // model.addEventListener("serialize", (writer, context) => {
358
- // writer.appendLine(`# SeeThrough component on ${object.name}`);
359
- // });
360
- // }
372
+ // // model.addEventListener("serialize", (writer, context) => {
373
+ // // writer.appendLine(`# SeeThrough component on ${object.name}`);
374
+ // // });
375
+ // // }
361
376
 
362
- }
377
+ // }
363
378
 
364
- const seeThroughUsdzExporterPlugin = new SeeThroughUsdzExporterPlugin();
379
+ // const seeThroughUsdzExporterPlugin = new SeeThroughUsdzExporterPlugin();
365
380
 
366
- USDZExporter.beforeExport.addEventListener(args => {
367
- if (SeeThroughUsdzExporterPlugin.components.length === 0) return;
368
- if (args.exporter.extensions.includes(seeThroughUsdzExporterPlugin) === false) {
369
- args.exporter.extensions.push(seeThroughUsdzExporterPlugin);
370
- }
371
- });
381
+ // USDZExporter.beforeExport.addEventListener(args => {
382
+ // if (SeeThroughUsdzExporterPlugin.components.length === 0) return;
383
+ // if (args.exporter.extensions.includes(seeThroughUsdzExporterPlugin) === false) {
384
+ // args.exporter.extensions.push(seeThroughUsdzExporterPlugin);
385
+ // }
386
+ // });
@@ -73,7 +73,7 @@ export class SmoothFollow extends Behaviour {
73
73
  * @default 0.1
74
74
  */
75
75
  @serializable()
76
- followFactor = .1;
76
+ followFactor: number = .1;
77
77
 
78
78
  /**
79
79
  * Speed factor for rotation following.
@@ -83,7 +83,7 @@ export class SmoothFollow extends Behaviour {
83
83
  * @default 0.1
84
84
  */
85
85
  @serializable()
86
- rotateFactor = .1;
86
+ rotateFactor: number = .1;
87
87
 
88
88
  /**
89
89
  * Which position axes to follow. Use bitwise OR to combine:
@@ -204,7 +204,7 @@ export class Button extends Behaviour implements IPointerEventHandler {
204
204
  // image? : Image;
205
205
 
206
206
  @serializable()
207
- set interactable(value) {
207
+ set interactable(value: boolean) {
208
208
  this._interactable = value;
209
209
  if (this._image) {
210
210
  this._image.setInteractable(value);
@@ -63,7 +63,7 @@ export class ObjectRaycaster extends Raycaster {
63
63
  private raycastHits: Intersection[] = [];
64
64
 
65
65
  @serializable()
66
- ignoreSkinnedMeshes = false;
66
+ ignoreSkinnedMeshes: boolean = false;
67
67
 
68
68
  start(): void {
69
69
  this.targets = [this.gameObject];
@@ -8,6 +8,13 @@ import { registerType } from "../../engine/engine_typestore.js";
8
8
  import { getParam } from "../../engine/engine_utils.js";
9
9
  import { RGBAColor } from "../../engine/js-extensions/RGBAColor.js";
10
10
  import { Behaviour } from "../Component.js";
11
+ // Type-only imports for TSDoc @see links
12
+ import type { Context } from "../../engine/engine_context.js";
13
+ import type { Camera as CameraComponent } from "../Camera.js";
14
+ import type { DragControls } from "../DragControls.js";
15
+ import type { LookAtConstraint } from "../LookAtConstraint.js";
16
+ import type { OrbitControls } from "../OrbitControls.js";
17
+ import type { SceneSwitcher } from "../SceneSwitcher.js";
11
18
 
12
19
 
13
20
  const debugParam = getParam("debugviewbox");
@@ -83,7 +90,7 @@ export type ViewBoxMode = "continuous" | "once";
83
90
  * scene.add(viewBox);
84
91
  * ```
85
92
  *
86
- * @see {@link Camera} - The camera component that ViewBox controls
93
+ * @see {@link CameraComponent} - The camera component that ViewBox controls
87
94
  * @see {@link OrbitControls} - Camera controls that work alongside ViewBox
88
95
  * @see {@link DragControls} - Alternative camera controls compatible with ViewBox
89
96
  * @see {@link LookAtConstraint} - Another way to control camera targeting
@@ -121,7 +128,7 @@ export class ViewBox extends Behaviour {
121
128
  * as they would appear with that field of view. Setting it to a wider FOV (e.g., 90) makes objects appear
122
129
  * smaller, while a narrower FOV (e.g., 30) makes them appear larger.
123
130
  *
124
- * @see {@link Camera} for the camera component and its FOV property
131
+ * @see {@link CameraComponent} for the camera component and its FOV property
125
132
  * @default -1 (automatically uses the camera's FOV on the first frame)
126
133
  */
127
134
  @serializable()
@@ -66,13 +66,13 @@ export class WebXRPlaneTracking extends Behaviour {
66
66
  * Note: this will only be applied if dataTemplate is not assigned
67
67
  */
68
68
  @serializable()
69
- occluder = true;
69
+ occluder: boolean = true;
70
70
 
71
71
  /**
72
72
  * If true the system will try to initiate room capture if no planes are detected.
73
73
  */
74
74
  @serializable()
75
- initiateRoomCaptureIfNoData = true;
75
+ initiateRoomCaptureIfNoData: boolean = true;
76
76
 
77
77
  /**
78
78
  * If true plane tracking will be enabled
@@ -88,7 +88,7 @@ export class WebXRPlaneTracking extends Behaviour {
88
88
 
89
89
  /** when enabled mesh or plane tracking will also be used in VR */
90
90
  @serializable()
91
- runInVR = true;
91
+ runInVR: boolean = true;
92
92
 
93
93
  /**
94
94
  * Returns all tracked planes
@@ -63,7 +63,7 @@ export class XRControllerFollow extends Behaviour {
63
63
  * @default false
64
64
  */
65
65
  @serializable()
66
- useGripSpace = false;
66
+ useGripSpace: boolean = false;
67
67
 
68
68
  /** when enabled the position, rotation and scale of this object will be set to the position it was at when it entered the XR session
69
69
  * @default true
@@ -40,13 +40,13 @@ export class XRControllerMovement extends Behaviour implements XRMovementBehavio
40
40
  * @default 1.5
41
41
  */
42
42
  @serializable()
43
- movementSpeed = 1.5;
43
+ movementSpeed: number = 1.5;
44
44
 
45
45
  /** How many degrees to rotate the XR rig when using the rotation trigger
46
46
  * @default 30
47
47
  */
48
48
  @serializable()
49
- rotationStep = 30;
49
+ rotationStep: number = 30;
50
50
 
51
51
  /** When enabled you can teleport using the right XR controller's thumbstick by pressing forward
52
52
  * @default true
@@ -65,13 +65,13 @@ export class XRControllerMovement extends Behaviour implements XRMovementBehavio
65
65
  * @default false
66
66
  */
67
67
  @serializable()
68
- useTeleportTarget = false;
68
+ useTeleportTarget: boolean = false;
69
69
 
70
70
  /** Enable to fade out the scene when teleporting
71
71
  * @default false
72
72
  */
73
73
  @serializable()
74
- useTeleportFade = false;
74
+ useTeleportFade: boolean = false;
75
75
 
76
76
  /** enable to visualize controller rays in the 3D scene
77
77
  * @default true