@needle-tools/engine 4.1.0-beta → 4.1.0-beta.2

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 (85) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/components.needle.json +1 -1
  3. package/dist/gltf-progressive.js +103 -102
  4. package/dist/gltf-progressive.light.js +103 -102
  5. package/dist/gltf-progressive.light.min.js +6 -6
  6. package/dist/gltf-progressive.light.umd.cjs +6 -6
  7. package/dist/gltf-progressive.min.js +6 -6
  8. package/dist/gltf-progressive.umd.cjs +6 -6
  9. package/dist/needle-engine.bundle.js +7820 -7561
  10. package/dist/needle-engine.bundle.light.js +7773 -7514
  11. package/dist/needle-engine.bundle.light.min.js +131 -132
  12. package/dist/needle-engine.bundle.light.umd.cjs +134 -135
  13. package/dist/needle-engine.bundle.min.js +131 -132
  14. package/dist/needle-engine.bundle.umd.cjs +134 -135
  15. package/dist/needle-engine.js +596 -590
  16. package/dist/needle-engine.light.js +596 -590
  17. package/dist/needle-engine.light.min.js +1 -1
  18. package/dist/needle-engine.light.umd.cjs +1 -1
  19. package/dist/needle-engine.min.js +1 -1
  20. package/dist/needle-engine.umd.cjs +1 -1
  21. package/dist/three-examples.js +26 -26
  22. package/dist/three-examples.light.js +26 -26
  23. package/dist/three-examples.light.min.js +1 -1
  24. package/dist/three-examples.light.umd.cjs +1 -1
  25. package/dist/three-examples.min.js +1 -1
  26. package/dist/three-examples.umd.cjs +1 -1
  27. package/dist/vendor.js +0 -2
  28. package/dist/vendor.light.js +0 -2
  29. package/dist/vendor.light.min.js +2 -2
  30. package/dist/vendor.light.umd.cjs +2 -2
  31. package/dist/vendor.min.js +2 -2
  32. package/dist/vendor.umd.cjs +2 -2
  33. package/lib/engine/engine.d.ts +4 -0
  34. package/lib/engine/engine.js +12 -0
  35. package/lib/engine/engine.js.map +1 -0
  36. package/lib/engine/engine_web_api.d.ts +12 -0
  37. package/lib/engine/engine_web_api.js +113 -0
  38. package/lib/engine/engine_web_api.js.map +1 -0
  39. package/lib/engine/xr/NeedleXRSession.js +3 -0
  40. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  41. package/lib/engine-components/FlyControls.d.ts +10 -0
  42. package/lib/engine-components/FlyControls.js +29 -0
  43. package/lib/engine-components/FlyControls.js.map +1 -0
  44. package/lib/engine-components/GroundProjection.d.ts +1 -1
  45. package/lib/engine-components/GroundProjection.js +39 -32
  46. package/lib/engine-components/GroundProjection.js.map +1 -1
  47. package/lib/engine-components/OrbitControls.js +8 -0
  48. package/lib/engine-components/OrbitControls.js.map +1 -1
  49. package/lib/engine-components/RigidBody.js +10 -4
  50. package/lib/engine-components/RigidBody.js.map +1 -1
  51. package/lib/engine-components/SpatialTrigger.d.ts +2 -2
  52. package/lib/engine-components/SpatialTrigger.js +4 -4
  53. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  54. package/lib/engine-components/TransformGizmo.d.ts +7 -1
  55. package/lib/engine-components/TransformGizmo.js +39 -32
  56. package/lib/engine-components/TransformGizmo.js.map +1 -1
  57. package/lib/engine-components/VideoPlayer.js +0 -1
  58. package/lib/engine-components/VideoPlayer.js.map +1 -1
  59. package/lib/engine-components/particlesystem/ParticleSystemModules.js +1 -1
  60. package/lib/engine-components/particlesystem/ParticleSystemModules.js.map +1 -1
  61. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +2 -0
  62. package/lib/engine-components/postprocessing/Effects/Sharpening.js +15 -6
  63. package/lib/engine-components/postprocessing/Effects/Sharpening.js.map +1 -1
  64. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +4 -0
  65. package/lib/engine-components/webxr/WebXRImageTracking.js +14 -4
  66. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  67. package/lib/engine-components/webxr/WebXRRig.d.ts +11 -1
  68. package/lib/engine-components/webxr/WebXRRig.js +13 -1
  69. package/lib/engine-components/webxr/WebXRRig.js.map +1 -1
  70. package/lib/needle-engine.js +5 -5
  71. package/lib/needle-engine.js.map +1 -1
  72. package/package.json +3 -3
  73. package/src/engine/codegen/register_types.ts +2 -2
  74. package/src/engine/xr/NeedleXRSession.ts +3 -0
  75. package/src/engine-components/GroundProjection.ts +46 -38
  76. package/src/engine-components/OrbitControls.ts +8 -0
  77. package/src/engine-components/RigidBody.ts +11 -5
  78. package/src/engine-components/SpatialTrigger.ts +6 -6
  79. package/src/engine-components/TransformGizmo.ts +41 -33
  80. package/src/engine-components/VideoPlayer.ts +0 -1
  81. package/src/engine-components/particlesystem/ParticleSystemModules.ts +1 -1
  82. package/src/engine-components/postprocessing/Effects/Sharpening.ts +16 -7
  83. package/src/engine-components/webxr/WebXRImageTracking.ts +18 -4
  84. package/src/engine-components/webxr/WebXRRig.ts +15 -2
  85. package/src/needle-engine.ts +5 -5
@@ -11,12 +11,22 @@ import { Behaviour } from "../Component.js";
11
11
  export declare class XRRig extends Behaviour implements IXRRig {
12
12
  priority: number;
13
13
  get isActive(): boolean;
14
- /** Sets this rig to be the active XR rig (needs to be called during an active XR session) */
14
+ /**
15
+ * Sets this rig to be the active XR rig (needs to be called during an active XR session)
16
+ * Note that this might modify the priority of this rig to be the highest.
17
+ */
15
18
  setAsActiveXRRig(): void;
19
+ /**
20
+ * Sets the priority of the rig.
21
+ */
22
+ setPriority(value: number): void;
23
+ /** @internal */
16
24
  awake(): void;
17
25
  isXRRig(): boolean;
18
26
  supportsXR(_mode: XRSessionMode): boolean;
19
27
  private _startScale?;
28
+ /** @internal */
20
29
  onEnterXR(args: NeedleXREventArgs): void;
30
+ /** @internal */
21
31
  onLeaveXR(args: NeedleXREventArgs): void;
22
32
  }
@@ -20,10 +20,20 @@ const debug = getParam("debugwebxr");
20
20
  export class XRRig extends Behaviour {
21
21
  priority = 0;
22
22
  get isActive() { return this.activeAndEnabled && this.gameObject.visible; }
23
- /** Sets this rig to be the active XR rig (needs to be called during an active XR session) */
23
+ /**
24
+ * Sets this rig to be the active XR rig (needs to be called during an active XR session)
25
+ * Note that this might modify the priority of this rig to be the highest.
26
+ */
24
27
  setAsActiveXRRig() {
25
28
  NeedleXRSession.active?.setRigActive(this);
26
29
  }
30
+ /**
31
+ * Sets the priority of the rig.
32
+ */
33
+ setPriority(value) {
34
+ this.priority = value;
35
+ }
36
+ /** @internal */
27
37
  awake() {
28
38
  if (debug) {
29
39
  const gizmoObj = new Object3D();
@@ -43,12 +53,14 @@ export class XRRig extends Behaviour {
43
53
  return true;
44
54
  }
45
55
  _startScale;
56
+ /** @internal */
46
57
  onEnterXR(args) {
47
58
  this._startScale = this.gameObject.scale.clone();
48
59
  args.xr.addRig(this);
49
60
  if (debug)
50
61
  console.log("WebXR: add Rig", this.name, this.priority);
51
62
  }
63
+ /** @internal */
52
64
  onLeaveXR(args) {
53
65
  args.xr.removeRig(this);
54
66
  if (this._startScale && this.gameObject)
@@ -1 +1 @@
1
- {"version":3,"file":"WebXRRig.js","sourceRoot":"","sources":["../../../src/engine-components/webxr/WebXRRig.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAW,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAA0B,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,KAAM,SAAQ,SAAS;IAGhC,QAAQ,GAAW,CAAC,CAAC;IAErB,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3E,6FAA6F;IAC7F,gBAAgB;QACZ,eAAe,CAAC,M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AAU,CAAC,EAAE,CAAC,CAAC;YAChC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;SAC5B;IACL,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,KAAoB;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,WAAW,CAAW;IAE9B,gBAAgB;IAChB,SAAS,CAAC,IAAuB;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACjD,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;IACD,gBAAgB;IAChB,SAAS,CAAC,IAAuB;QAC7B,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU;YACnC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;CAGJ;AAxDG;IADC,YAAY,EAAE;uCACM"}
@@ -28,10 +28,10 @@ function registerGlobal(obj) {
28
28
  Needle[key] = obj[key];
29
29
  }
30
30
  }
31
- // import * as Component from "./engine-components/Component.js";
32
- // registerGlobal(Component);
33
- // import * as Components from "./engine-components/codegen/components.js";
34
- // registerGlobal(Components);
31
+ import * as Component from "./engine-components/Component.js";
32
+ registerGlobal(Component);
33
+ import * as Components from "./engine-components/codegen/components.js";
34
+ registerGlobal(Components);
35
35
  import { GameObject } from "./engine-components/Component.js";
36
36
  for (const method of Object.getOwnPropertyNames(GameObject)) {
37
37
  switch (method) {
@@ -59,5 +59,5 @@ if (!globalThis["THREE"]) {
59
59
  globalThis["THREE"] = THREE;
60
60
  }
61
61
  else
62
- console.warn("Threejs is already imported");
62
+ console.warn("Three.js is already imported");
63
63
  //# sourceMappingURL=needle-engine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"needle-engine.js","sourceRoot":"","sources":["../src/needle-engine.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,yBAAyB,CAAC;AAExC,0CAA0C;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjH,MAAM,MAAM,GAAG;IACX,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,OAAO;IAChB,eAAe,EAAE,eAAe;IAChC,IAAI,EAAE;QACF,WAAW,EAAE,QAAQ;KACxB;IACD,KAAK,EAAE;QACH,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,QAAQ;QAClB,cAAc,EAAE,cAAc;KACjC;CACJ,CAAC;AACF,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,SAAS,EAAE;IAC7C,OAAO,CAAC,IAAI,CAAC,sCAAsC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;CACtF;AACD,SAAS,cAAc,CAAC,GAAW;IAC/B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;KAC1B;AACL,CAAC;AACD,iEAAiE;AACjE,6BAA6B;AAE7B,2EAA2E;AAC3E,8BAA8B;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,KAAK,MAAM,MAAM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AGD,wBAAwB;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;IACtB,UAAU,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;CAC/B;;IACI,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/engine",
3
- "version": "4.1.0-beta",
3
+ "version": "4.1.0-beta.2",
4
4
  "description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in",
5
5
  "main": "dist/needle-engine.umd.cjs",
6
6
  "exports": {
@@ -81,7 +81,7 @@
81
81
  ],
82
82
  "dependencies": {
83
83
  "@dimforge/rapier3d-compat": "^0.14.0",
84
- "@needle-tools/gltf-progressive": "^2.1.0-alpha.3",
84
+ "@needle-tools/gltf-progressive": "^2.1.0-alpha.4",
85
85
  "@webxr-input-profiles/motion-controllers": "^1.0.0",
86
86
  "flatbuffers": "2.0.4",
87
87
  "md5": "^2.3.0",
@@ -93,7 +93,7 @@
93
93
  "three": "npm:@needle-tools/three@^0.169.4",
94
94
  "three-mesh-bvh": "^0.8.3",
95
95
  "three-mesh-ui": "npm:@needle-tools/three-mesh-ui@^7.1.5-alpha.5",
96
- "three.quarks": "0.15.5",
96
+ "three.quarks": "0.15.6",
97
97
  "uuid": "^9.0.0",
98
98
  "websocket-ts": "^2.1.5"
99
99
  },
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import { TypeStore } from "./../engine_typestore.js"
3
-
3
+
4
4
  // Import types
5
5
  import { AlignmentConstraint } from "../../engine-components/AlignmentConstraint.js";
6
6
  import { Animation } from "../../engine-components/Animation.js";
@@ -220,7 +220,7 @@ import { XRFlag } from "../../engine-components/webxr/XRFlag.js";
220
220
  import { PlayerSync } from "../../engine-components-experimental/networking/PlayerSync.js";
221
221
  import { PlayerState } from "../../engine-components-experimental/networking/PlayerSync.js";
222
222
  import { PresentationMode } from "../../engine-components-experimental/Presentation.js";
223
-
223
+
224
224
  // Register types
225
225
  TypeStore.add("AlignmentConstraint", AlignmentConstraint);
226
226
  TypeStore.add("Animation", Animation);
@@ -712,8 +712,11 @@ export class NeedleXRSession implements INeedleXRSession {
712
712
  /** Sets a XRRig to be active which will parent the camera to this rig */
713
713
  setRigActive(rig: IXRRig) {
714
714
  const i = this._rigs.indexOf(rig);
715
+ const currentlyActive = this._rigs[0];
715
716
  this._rigs.splice(i, 1);
716
717
  this._rigs.unshift(rig);
718
+ // if there's another rig currently active we need to make sure we have at least the same priority
719
+ rig.priority = currentlyActive?.priority ?? 0;
717
720
  this.updateActiveXRRig();
718
721
  }
719
722
  /**
@@ -3,7 +3,7 @@ import { GroundedSkybox as GroundProjection } from 'three/examples/jsm/objects/G
3
3
 
4
4
  import { Gizmos } from "../engine/engine_gizmos.js";
5
5
  import { serializable } from "../engine/engine_serialization_decorator.js";
6
- import { getBoundingBox, getTempVector, getWorldScale, Graphics, setVisibleInCustomShadowRendering,setWorldPosition } from "../engine/engine_three_utils.js";
6
+ import { getBoundingBox, getTempVector, getWorldScale, Graphics, setVisibleInCustomShadowRendering, setWorldPosition } from "../engine/engine_three_utils.js";
7
7
  import { delayForFrames, getParam, Watch as Watch } from "../engine/engine_utils.js";
8
8
  import { Behaviour } from "./Component.js";
9
9
 
@@ -37,7 +37,7 @@ export class GroundProjectedEnv extends Behaviour {
37
37
  @serializable()
38
38
  set radius(val: number) {
39
39
  this._radius = val;
40
- this.updateProjection();
40
+ if (this._projection) this.updateProjection();
41
41
  }
42
42
  get radius(): number { return this._radius; }
43
43
  private _radius: number = 50;
@@ -49,7 +49,7 @@ export class GroundProjectedEnv extends Behaviour {
49
49
  @serializable()
50
50
  set height(val: number) {
51
51
  this._height = val;
52
- this.updateProjection();
52
+ if (this._projection) this.updateProjection();
53
53
  }
54
54
  get height(): number { return this._height; }
55
55
  private _height: number = 3;
@@ -68,7 +68,7 @@ export class GroundProjectedEnv extends Behaviour {
68
68
  get arBlending(): number { return this._arblending; }
69
69
  private _arblending = 0;
70
70
 
71
- private _lastEnvironment?: Texture;
71
+ private _lastBackground?: Texture;
72
72
  private _lastRadius?: number;
73
73
  private _lastHeight?: number;
74
74
  private _projection?: GroundProjection;
@@ -88,9 +88,10 @@ export class GroundProjectedEnv extends Behaviour {
88
88
  this.updateAndCreate();
89
89
  }
90
90
  if (!this._watcher) {
91
- this._watcher = new Watch(this.context.scene, "environment");
91
+ this._watcher = new Watch(this.context.scene, "background");
92
92
  this._watcher.subscribeWrite(_ => {
93
- this.updateProjection();
93
+ if (debug) console.log("Background changed", this.context.scene.background);
94
+ this._needsTextureUpdate = true;
94
95
  });
95
96
  }
96
97
  }
@@ -101,13 +102,13 @@ export class GroundProjectedEnv extends Behaviour {
101
102
  }
102
103
  /** @internal */
103
104
  onEnterXR(): void {
104
- if(!this.activeAndEnabled) return;
105
+ if (!this.activeAndEnabled) return;
105
106
  this._needsTextureUpdate = true;
106
107
  this.updateProjection();
107
108
  }
108
109
  /** @internal */
109
110
  async onLeaveXR() {
110
- if(!this.activeAndEnabled) return;
111
+ if (!this.activeAndEnabled) return;
111
112
  await delayForFrames(1);
112
113
  this.updateProjection();
113
114
  }
@@ -121,8 +122,8 @@ export class GroundProjectedEnv extends Behaviour {
121
122
  if (blurrinessChanged) {
122
123
  this.updateProjection();
123
124
  }
124
- else if (this._needsTextureUpdate) {
125
- this.updateBlurriness();
125
+ else if (this._needsTextureUpdate && this.context.scene.background instanceof Texture) {
126
+ this.updateBlurriness(this.context.scene.background, this.context.scene.backgroundBlurriness);
126
127
  }
127
128
  }
128
129
 
@@ -138,10 +139,16 @@ export class GroundProjectedEnv extends Behaviour {
138
139
  * Updates the ground projection. This is called automatically when the environment or settings change.
139
140
  */
140
141
  updateProjection() {
141
- if (!this.context.scene.environment) {
142
+ if (!this.context.scene.background) {
143
+ this._projection?.removeFromParent();
144
+ return;
145
+ }
146
+ const backgroundTexture = this.context.scene.background;
147
+ if (!(backgroundTexture instanceof Texture)) {
142
148
  this._projection?.removeFromParent();
143
149
  return;
144
150
  }
151
+
145
152
  if (this.context.xr?.isPassThrough || this.context.xr?.isAR) {
146
153
  if (this.arBlending === 0) {
147
154
  this._projection?.removeFromParent();
@@ -152,25 +159,25 @@ export class GroundProjectedEnv extends Behaviour {
152
159
  if (!this.gameObject || this.destroyed) {
153
160
  return;
154
161
  }
155
-
162
+
156
163
  let needsNewAutoFit = true;
157
164
  // offset here must be zero (and not .01) because the plane occlusion (when mesh tracking is active) is otherwise not correct
158
165
  const offset = 0;
159
- if (!this._projection || this.context.scene.environment !== this._lastEnvironment || this._height !== this._lastHeight || this._radius !== this._lastRadius) {
160
- if (debug)
161
- console.log("Create/Update Ground Projection", this.context.scene.environment.name);
166
+
167
+ const hasChanged = backgroundTexture !== this._lastBackground || this._height !== this._lastHeight || this._radius !== this._lastRadius;
168
+
169
+ if (!this._projection || hasChanged) {
170
+ if (debug) console.log("Create/Update Ground Projection", backgroundTexture.name);
171
+
162
172
  this._projection?.removeFromParent();
163
- if (!this._projection || (this.context.scene.environment !== this._lastEnvironment || this._lastHeight !== this._height || this._lastRadius !== this._radius)) {
164
- try {
165
- this._projection = new GroundProjection(this.context.scene.environment, this._height, this.radius, 64);
166
- }
167
- catch (e) {
168
- console.error("Failed to enable GroundProjection for environment", e);
169
- return;
170
- }
173
+
174
+ try {
175
+ this._projection = new GroundProjection(backgroundTexture, this._height, this._radius, 64);
176
+ }
177
+ catch (e) {
178
+ console.error("Error creating three GroundProjection", e);
179
+ return;
171
180
  }
172
- else
173
- needsNewAutoFit = false;
174
181
  this._projection.position.y = this._height - offset;
175
182
  this._projection.name = "GroundProjection";
176
183
  setVisibleInCustomShadowRendering(this._projection, false);
@@ -205,35 +212,35 @@ export class GroundProjectedEnv extends Behaviour {
205
212
  this.env.radius = this._radius;
206
213
  this.env.height = this._height;
207
214
  */
208
-
215
+
209
216
  if (this.context.scene.backgroundBlurriness > 0.001 && this._needsTextureUpdate) {
210
- this.updateBlurriness();
217
+ this.updateBlurriness(backgroundTexture, this.context.scene.backgroundBlurriness);
211
218
  }
212
219
 
213
- this._lastEnvironment = this.context.scene.environment;
220
+ this._lastBackground = backgroundTexture;
214
221
  this._lastHeight = this._height;
215
222
  this._lastRadius = this._radius;
216
-
217
223
  this._needsTextureUpdate = false;
218
224
  }
219
225
 
220
226
  private _blurrynessShader: ShaderMaterial | null = null;
221
227
  private _lastBlurriness: number = -1;
222
228
 
223
- private updateBlurriness() {
229
+ private updateBlurriness(texture: Texture, blurriness: number) {
224
230
  if (!this._projection) {
225
231
  return;
226
232
  }
227
- else if (!this.context.scene.environment) {
233
+ else if (!texture) {
228
234
  return;
229
235
  }
236
+
230
237
  this._needsTextureUpdate = false;
231
- if (debug) console.log("Update Blurriness", this.context.scene.backgroundBlurriness);
238
+ if (debug) console.log("Update Blurriness", blurriness);
232
239
  this._blurrynessShader ??= new ShaderMaterial({
233
240
  name: "GroundProjectionBlurriness",
234
241
  uniforms: {
235
- map: { value: this.context.scene.environment },
236
- blurriness: { value: this.context.scene.backgroundBlurriness },
242
+ map: { value: texture },
243
+ blurriness: { value: blurriness },
237
244
  blending: { value: 0 },
238
245
  alphaFactor: { value: 1 }
239
246
  },
@@ -241,9 +248,10 @@ export class GroundProjectedEnv extends Behaviour {
241
248
  fragmentShader: blurFragmentShader
242
249
  });
243
250
  this._blurrynessShader.depthWrite = false;
244
- this._blurrynessShader.uniforms.blurriness.value = this.context.scene.backgroundBlurriness;
245
- this._lastBlurriness = this.context.scene.backgroundBlurriness;
246
- this.context.scene.environment.needsPMREMUpdate = true;
251
+ this._blurrynessShader.uniforms.map.value = texture;
252
+ this._blurrynessShader.uniforms.blurriness.value = 1;//blurriness;
253
+ this._lastBlurriness = blurriness;
254
+ texture.needsUpdate = true;
247
255
 
248
256
  const wasTransparent = this._projection.material.transparent;
249
257
  this._projection.material.transparent = (this.context.xr?.isAR === true && this.arBlending > 0.000001) ?? false;
@@ -266,7 +274,7 @@ export class GroundProjectedEnv extends Behaviour {
266
274
  }
267
275
 
268
276
  // Update the texture
269
- this._projection.material.map = Graphics.copyTexture(this.context.scene.environment, this._blurrynessShader);
277
+ this._projection.material.map = Graphics.copyTexture(texture, this._blurrynessShader);
270
278
  this._projection.material.depthTest = true;
271
279
  this._projection.material.depthWrite = false;
272
280
  }
@@ -297,6 +297,14 @@ export class OrbitControls extends Behaviour implements ICameraController {
297
297
  this._controls = new ThreeOrbitControls(cam!, element);
298
298
  cam?.quaternion.copy(mat!)
299
299
  if (defaultKeys === undefined) defaultKeys = { ...this._controls.keys };
300
+ // set controls look point in front of the current camera by default
301
+ // it may be overriden by the autoTarget feature
302
+ // but if we don't do this and autoTarget is OFF then the camera will turn to look at 0 0 0 of the scene
303
+ const worldPosition = getWorldPosition(cam);
304
+ const forward = this.gameObject.worldForward;
305
+ const dist = 2.5;
306
+ const lookAt = worldPosition.clone().sub(forward.multiplyScalar(dist));
307
+ this._controls.target.copy(lookAt);
300
308
  }
301
309
 
302
310
  if (this._controls) {
@@ -1,13 +1,14 @@
1
1
  import { Matrix4, Object3D, Quaternion, Vector3, Vector3Like } from "three";
2
2
 
3
3
  import { isDevEnvironment } from "../engine/debug/index.js";
4
+ import { MODULES } from "../engine/engine_modules.js";
4
5
  import { CollisionDetectionMode, RigidbodyConstraints } from "../engine/engine_physics.types.js";
5
6
  import { serializable } from "../engine/engine_serialization_decorator.js";
6
7
  import { Context, FrameEvent } from "../engine/engine_setup.js";
7
8
  import { getWorldPosition } from "../engine/engine_three_utils.js";
8
9
  import type { IRigidbody, Vec3 } from "../engine/engine_types.js";
9
10
  import { validate } from "../engine/engine_util_decorator.js";
10
- import { Watch } from "../engine/engine_utils.js";
11
+ import { delayForFrames, Watch } from "../engine/engine_utils.js";
11
12
  import { Behaviour } from "./Component.js";
12
13
 
13
14
  class TransformWatch {
@@ -318,11 +319,16 @@ export class Rigidbody extends Behaviour implements IRigidbody {
318
319
  }
319
320
  this._watch.start(true, true);
320
321
  this.startCoroutine(this.beforePhysics(), FrameEvent.LateUpdate);
321
- if (isDevEnvironment() && !this.context.physics.engine?.getBody(this)) {
322
+ if (isDevEnvironment()) {
322
323
  if (!globalThis["NEEDLE_USE_RAPIER"])
323
324
  console.warn(`Rigidbody could not be created: Rapier physics are explicitly disabled.`);
324
- else
325
- console.warn(`Rigidbody could not be created. Ensure \"(${this.name}\" has a Collider component.`);
325
+ else {
326
+ MODULES.RAPIER_PHYSICS.ready().then(async () => {
327
+ await delayForFrames(1);
328
+ if (!this.context.physics.engine?.getBody(this))
329
+ console.warn(`Rigidbody could not be created. Ensure \"(${this.name}\" has a Collider component.`);
330
+ })
331
+ }
326
332
  }
327
333
  }
328
334
 
@@ -340,7 +346,7 @@ export class Rigidbody extends Behaviour implements IRigidbody {
340
346
  }
341
347
 
342
348
  // need to do this right before updating physics to prevent rendered object glitching through physical bodies
343
- *beforePhysics() {
349
+ * beforePhysics() {
344
350
  while (true) {
345
351
  if (this._propertiesChanged) {
346
352
  this._propertiesChanged = false;
@@ -62,23 +62,23 @@ export class SpatialTriggerReceiver extends Behaviour {
62
62
 
63
63
  }
64
64
 
65
- currentIntersected: SpatialTrigger[] = [];
66
- lastIntersected: SpatialTrigger[] = [];
65
+ readonly currentIntersected: SpatialTrigger[] = [];
66
+ readonly lastIntersected: SpatialTrigger[] = [];
67
67
 
68
68
  onEnterTrigger(trigger: SpatialTrigger): void {
69
69
  if(debug) console.log("ENTER TRIGGER", this.name, trigger.name, this, trigger);
70
70
  trigger.raiseOnEnterEvent(this);
71
- this.onEnter?.invoke(this, trigger);
71
+ this.onEnter?.invoke();
72
72
  }
73
73
  onExitTrigger(trigger: SpatialTrigger): void {
74
- if(debug) console.log("EXIT TRIGGER", this.name, trigger.name, this, trigger);
74
+ if(debug) console.log("EXIT TRIGGER", this.name, trigger.name, );
75
75
  trigger.raiseOnExitEvent(this);
76
- this.onExit?.invoke(this, trigger);
76
+ this.onExit?.invoke();
77
77
  }
78
78
 
79
79
  onStayTrigger(trigger: SpatialTrigger): void {
80
80
  trigger.raiseOnStayEvent(this);
81
- this.onStay?.invoke(this, trigger);
81
+ this.onStay?.invoke();
82
82
  }
83
83
  }
84
84
 
@@ -1,4 +1,4 @@
1
- import { MathUtils,Mesh, MeshBasicMaterial, Object3D } from "three";
1
+ import { MathUtils, Mesh, MeshBasicMaterial, Object3D } from "three";
2
2
  import { TransformControls } from "three/examples/jsm/controls/TransformControls.js";
3
3
 
4
4
  import * as params from "../engine/engine_default_parameters.js";
@@ -26,7 +26,15 @@ export class TransformGizmo extends Behaviour {
26
26
  @serializable()
27
27
  public scaleSnap: number = .25;
28
28
 
29
- private control?: TransformControls;
29
+ /**
30
+ * Get the underlying three.js TransformControls instance.
31
+ * @returns The TransformControls instance.
32
+ */
33
+ get control() {
34
+ return this._control;
35
+ }
36
+
37
+ private _control?: TransformControls;
30
38
  private orbit?: OrbitControls;
31
39
 
32
40
  /** @internal */
@@ -35,12 +43,12 @@ export class TransformGizmo extends Behaviour {
35
43
 
36
44
  if (!this.context.mainCamera) return;
37
45
 
38
- if (!this.control) {
39
- this.control = new TransformControls(this.context.mainCamera, this.context.renderer.domElement);
40
- this.control.enabled = true;
41
- this.control.getRaycaster().layers.set(2);
42
- this.control.size = 1;
43
- const obj = ("_root" in this.control ? this.control._root : this.control) as Object3D;
46
+ if (!this._control) {
47
+ this._control = new TransformControls(this.context.mainCamera, this.context.renderer.domElement);
48
+ this._control.enabled = true;
49
+ this._control.getRaycaster().layers.set(2);
50
+ this._control.size = 1;
51
+ const obj = ("_root" in this._control ? this._control._root : this._control) as Object3D;
44
52
  obj.traverse(x => {
45
53
  const mesh = x as Mesh;
46
54
  mesh.layers.set(2);
@@ -54,12 +62,12 @@ export class TransformGizmo extends Behaviour {
54
62
  this.orbit = GameObject.getComponentInParent(this.context.mainCamera, OrbitControls) ?? undefined;
55
63
  }
56
64
 
57
- if (this.control) {
58
- const obj = this.control.getHelper();
65
+ if (this._control) {
66
+ const obj = this._control.getHelper();
59
67
  this.context.scene.add(obj);
60
- this.control.attach(this.gameObject);
68
+ this._control.attach(this.gameObject);
61
69
 
62
- this.control?.addEventListener('dragging-changed', this.onControlChangedEvent);
70
+ this._control?.addEventListener('dragging-changed', this.onControlChangedEvent);
63
71
  window.addEventListener('keydown', this.windowKeyDownListener);
64
72
  window.addEventListener('keyup', this.windowKeyUpListener);
65
73
  }
@@ -67,25 +75,25 @@ export class TransformGizmo extends Behaviour {
67
75
 
68
76
  /** @internal */
69
77
  onDisable() {
70
- this.control?.getHelper()?.removeFromParent();
71
- this.control?.removeEventListener('dragging-changed', this.onControlChangedEvent);
78
+ this._control?.getHelper()?.removeFromParent();
79
+ this._control?.removeEventListener('dragging-changed', this.onControlChangedEvent);
72
80
  window.removeEventListener('keydown', this.windowKeyDownListener);
73
81
  window.removeEventListener('keyup', this.windowKeyUpListener);
74
82
  }
75
83
 
76
84
  enableSnapping() {
77
- if (this.control) {
78
- this.control.setTranslationSnap(this.translationSnap);
79
- this.control.setRotationSnap(MathUtils.degToRad(this.rotationSnapAngle));
80
- this.control.setScaleSnap(this.scaleSnap);
85
+ if (this._control) {
86
+ this._control.setTranslationSnap(this.translationSnap);
87
+ this._control.setRotationSnap(MathUtils.degToRad(this.rotationSnapAngle));
88
+ this._control.setScaleSnap(this.scaleSnap);
81
89
  }
82
90
  }
83
91
 
84
92
  disableSnapping() {
85
- if (this.control) {
86
- this.control.setTranslationSnap(null);
87
- this.control.setRotationSnap(null);
88
- this.control.setScaleSnap(null);
93
+ if (this._control) {
94
+ this._control.setTranslationSnap(null);
95
+ this._control.setRotationSnap(null);
96
+ this._control.setScaleSnap(null);
89
97
  }
90
98
  }
91
99
 
@@ -104,11 +112,11 @@ export class TransformGizmo extends Behaviour {
104
112
 
105
113
  private windowKeyDownListener = (event) => {
106
114
  if (!this.enabled) return;
107
- if (!this.control) return;
115
+ if (!this._control) return;
108
116
  switch (event.keyCode) {
109
117
 
110
118
  case 81: // Q
111
- this.control.setSpace(this.control.space === 'local' ? 'world' : 'local');
119
+ this._control.setSpace(this._control.space === 'local' ? 'world' : 'local');
112
120
  break;
113
121
 
114
122
  case 16: // Shift
@@ -116,40 +124,40 @@ export class TransformGizmo extends Behaviour {
116
124
  break;
117
125
 
118
126
  case 87: // W
119
- this.control.setMode('translate');
127
+ this._control.setMode('translate');
120
128
  break;
121
129
 
122
130
  case 69: // E
123
- this.control.setMode('rotate');
131
+ this._control.setMode('rotate');
124
132
  break;
125
133
 
126
134
  case 82: // R
127
- this.control.setMode('scale');
135
+ this._control.setMode('scale');
128
136
  break;
129
137
  case 187:
130
138
  case 107: // +, =, num+
131
- this.control.setSize(this.control.size + 0.1);
139
+ this._control.setSize(this._control.size + 0.1);
132
140
  break;
133
141
 
134
142
  case 189:
135
143
  case 109: // -, _, num-
136
- this.control.setSize(Math.max(this.control.size - 0.1, 0.1));
144
+ this._control.setSize(Math.max(this._control.size - 0.1, 0.1));
137
145
  break;
138
146
 
139
147
  case 88: // X
140
- this.control.showX = !this.control.showX;
148
+ this._control.showX = !this._control.showX;
141
149
  break;
142
150
 
143
151
  case 89: // Y
144
- this.control.showY = !this.control.showY;
152
+ this._control.showY = !this._control.showY;
145
153
  break;
146
154
 
147
155
  case 90: // Z
148
- this.control.showZ = !this.control.showZ;
156
+ this._control.showZ = !this._control.showZ;
149
157
  break;
150
158
 
151
159
  case 32: // Spacebar
152
- this.control.enabled = !this.control.enabled;
160
+ this._control.enabled = !this._control.enabled;
153
161
  break;
154
162
  }
155
163
  }
@@ -1017,7 +1017,6 @@ class ScreenspaceTexture extends ShaderMaterial {
1017
1017
  else
1018
1018
  {
1019
1019
  vec4 texcolor = texture2D(map, vUv);
1020
- texcolor = sRGBTransferOETF(texcolor);
1021
1020
  gl_FragColor = texcolor;
1022
1021
  }
1023
1022
  }
@@ -685,7 +685,7 @@ export class ShapeModule implements EmitterShape {
685
685
  }
686
686
 
687
687
  update(_system: QParticleSystem, _delta: number): void {
688
- throw new Error('Method not implemented: use onUpdate');
688
+ /* this is called by quarks */
689
689
  }
690
690
 
691
691
  onUpdate(system: IParticleSystem, _context: Context, simulationSpace: ParticleSystemSimulationSpace, obj: Object3D) {