Needle Engine

Changes between version 3.37.12-alpha.3 and 3.37.12-alpha.4
Files changed (1) hide show
  1. src/engine-components/webxr/WebARSessionRoot.ts +4 -2
src/engine-components/webxr/WebARSessionRoot.ts CHANGED
@@ -138,11 +138,12 @@
138
138
  }
139
139
  this._reticle.length = 0;
140
140
  this._isPlacing = true;
141
- this.context.input.addEventListener("pointerup", this.onPlaceScene, { queue: InputEventQueue.Late });
141
+ // we want to receive pointer events EARLY and prevent interaction with other objects while placing by stopping the event propagation
142
+ this.context.input.addEventListener("pointerup", this.onPlaceScene, { queue: InputEventQueue.Early });
142
143
  }
143
144
  onLeaveXR() {
144
145
  // TODO: WebARSessionRoot doesnt work when we enter passthrough and leave XR without having placed the session!!!
145
- this.context.input.removeEventListener("pointerup", this.onPlaceScene, { queue: InputEventQueue.Late });
146
+ this.context.input.removeEventListener("pointerup", this.onPlaceScene, { queue: InputEventQueue.Early });
146
147
  this.onRevertSceneChanges();
147
148
  // this._anchor?.delete();
148
149
  this._anchor = null;
@@ -323,6 +324,7 @@
323
324
 
324
325
  // if we place the scene we don't want this event to be propagated to any sub-objects (via the EventSystem) anymore and trigger e.g. a click on objects for the "place tap" event
325
326
  evt.stopImmediatePropagation();
327
+ evt.stopPropagation();
326
328
  evt.use();
327
329
 
328
330
  this._isPlacing = false;