laymur 0.8.1 → 0.9.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.
package/dist/index.js CHANGED
@@ -6694,7 +6694,6 @@ class UIResizePolicyNone extends UIResizePolicy {
6694
6694
  }
6695
6695
  }
6696
6696
 
6697
- const TEMP_POSITION = new Vector3();
6698
6697
  /**
6699
6698
  * UI layer that covers the full browser window.
6700
6699
  *
@@ -6780,10 +6779,10 @@ class UIFullscreenLayer extends UILayer {
6780
6779
  * @returns 2D position in layer space
6781
6780
  */
6782
6781
  projectWorldPosition(position, camera) {
6783
- const projectedPosition = TEMP_POSITION.copy(position).project(camera);
6782
+ const projectedPosition = position.clone().project(camera);
6784
6783
  projectedPosition.x = MathUtils.mapLinear(projectedPosition.x, -1, 1, this.x, this.width);
6785
6784
  projectedPosition.y = MathUtils.mapLinear(projectedPosition.y, -1, 1, this.y, this.height);
6786
- return new Vector2(projectedPosition.x, projectedPosition.y);
6785
+ return projectedPosition;
6787
6786
  }
6788
6787
  /**
6789
6788
  * Projects 2D layer position to 3D world coordinates.
@@ -6794,10 +6793,7 @@ class UIFullscreenLayer extends UILayer {
6794
6793
  * @returns 3D position in world space
6795
6794
  */
6796
6795
  projectLayerPosition(position, camera, z = -1) {
6797
- TEMP_POSITION.x = MathUtils.mapLinear(position.x, this.x, this.width, -1, 1);
6798
- TEMP_POSITION.y = MathUtils.mapLinear(position.y, this.y, this.height, -1, 1);
6799
- TEMP_POSITION.z = z;
6800
- return TEMP_POSITION.unproject(camera);
6796
+ return new Vector3(MathUtils.mapLinear(position.x, this.x, this.width, -1, 1), MathUtils.mapLinear(position.y, this.y, this.height, -1, 1), z).unproject(camera);
6801
6797
  }
6802
6798
  _private_handleWindowInput(event, pointerFunctionName, inputEvent) {
6803
6799
  const rect = event.target instanceof HTMLElement