@needle-tools/engine 4.16.0 → 4.16.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +92 -46
  3. package/SKILL.md +25 -33
  4. package/dist/{needle-engine.bundle-mHgaFC2W.min.js → needle-engine.bundle-C3aSGlMn.min.js} +117 -117
  5. package/dist/{needle-engine.bundle-Cx8Qrpbp.js → needle-engine.bundle-CKIxz09L.js} +3395 -3374
  6. package/dist/{needle-engine.bundle-CXVjO2uF.umd.cjs → needle-engine.bundle-DSHShuiJ.umd.cjs} +116 -116
  7. package/dist/needle-engine.d.ts +17 -294
  8. package/dist/needle-engine.js +2 -2
  9. package/dist/needle-engine.min.js +1 -1
  10. package/dist/needle-engine.umd.cjs +1 -1
  11. package/lib/engine/engine_context.js +2 -0
  12. package/lib/engine/engine_context.js.map +1 -1
  13. package/lib/engine/webcomponents/logo-element.d.ts +6 -3
  14. package/lib/engine/webcomponents/logo-element.js +18 -0
  15. package/lib/engine/webcomponents/logo-element.js.map +1 -1
  16. package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +10 -7
  17. package/lib/engine/webcomponents/needle menu/needle-menu.js +13 -2
  18. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  19. package/lib/engine/webcomponents/needle-engine.d.ts +4 -1
  20. package/lib/engine/webcomponents/needle-engine.js +22 -15
  21. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  22. package/lib/engine/xr/NeedleXRSession.js +15 -3
  23. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  24. package/package.json +2 -3
  25. package/src/engine/engine_context.ts +1 -0
  26. package/src/engine/webcomponents/logo-element.ts +20 -3
  27. package/src/engine/webcomponents/needle menu/needle-menu.ts +22 -9
  28. package/src/engine/webcomponents/needle-engine.ts +42 -35
  29. package/src/engine/xr/NeedleXRSession.ts +16 -3
@@ -255,6 +255,7 @@ function handleAutoStart(value: string | null) {
255
255
  // }
256
256
 
257
257
  const $initialFov = Symbol("initial-fov");
258
+ const $initialNear = Symbol("initial-near");
258
259
 
259
260
  /**
260
261
  * This class manages an XRSession to provide helper methods and events. It provides easy access to the XRInputSources (controllers and hands)
@@ -1070,6 +1071,12 @@ export class NeedleXRSession implements INeedleXRSession {
1070
1071
  this._originalCameraParent = this.context.mainCamera.parent;
1071
1072
  if (this.context.mainCamera instanceof PerspectiveCamera) {
1072
1073
  this.context.mainCamera[$initialFov] = this.context.mainCamera.fov;
1074
+
1075
+ // if (this.mode === "immersive-ar" && this.context.mainCamera.near > .1) {
1076
+ // console.log("[WebXR] Setting near plane to 0.1 for better AR experience (was " + this.context.mainCamera.near + "). The initial near plane will be restored when the session ends.");
1077
+ // this.context.mainCamera.near = 0.1;
1078
+ // this.context.mainCamera[$initialNear] = this.context.mainCamera.near;
1079
+ // }
1073
1080
  }
1074
1081
  }
1075
1082
 
@@ -1308,9 +1315,15 @@ export class NeedleXRSession implements INeedleXRSession {
1308
1315
  setWorldScale(this.context.mainCamera, this._originalCameraWorldScale);
1309
1316
  }
1310
1317
 
1311
- if (this.context.mainCamera instanceof PerspectiveCamera && this.context.mainCamera[$initialFov]) {
1312
- this.context.mainCamera.fov = this.context.mainCamera[$initialFov]!;
1313
- this.context.mainCamera[$initialFov] = 0;
1318
+ if (this.context.mainCamera instanceof PerspectiveCamera) {
1319
+ if (this.context.mainCamera[$initialFov]) {
1320
+ this.context.mainCamera.fov = this.context.mainCamera[$initialFov]!;
1321
+ this.context.mainCamera[$initialFov] = 0;
1322
+ }
1323
+ if (this.context.mainCamera[$initialNear]) {
1324
+ this.context.mainCamera.near = this.context.mainCamera[$initialNear]!;
1325
+ this.context.mainCamera[$initialNear] = 0;
1326
+ }
1314
1327
  }
1315
1328
  }
1316
1329