@galacean/engine-xr-webxr 0.0.0-experimental-stateMachine.0 → 0.0.0-experimental-1.3-xr.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.
package/dist/main.js CHANGED
@@ -233,6 +233,15 @@ function _create_class(Constructor, protoProps, staticProps) {
233
233
  */ MathUtil.degreeToRadian = function degreeToRadian(d) {
234
234
  return d * MathUtil.degreeToRadFactor;
235
235
  };
236
+ /**
237
+ * Linearly interpolate between two values
238
+ * @param start - Specify the start of the range in which to interpolate
239
+ * @param end - Specify the end of the range in which to interpolate
240
+ * @param t - The blend amount where 0 returns start and 1 end
241
+ * @returns The result of linear blending between start and end
242
+ */ MathUtil.lerp = function lerp(start, end, t) {
243
+ return start + (end - start) * t;
244
+ };
236
245
  return MathUtil;
237
246
  }();
238
247
  (function() {
@@ -4467,7 +4476,7 @@ var WebXRSession = /*#__PURE__*/ function() {
4467
4476
  session.removeEventListener("squeeze", onSessionEvent);
4468
4477
  session.removeEventListener("squeezestart", onSessionEvent);
4469
4478
  session.removeEventListener("squeezeend", onSessionEvent);
4470
- session.addEventListener("end", this._onSessionExit);
4479
+ session.removeEventListener("end", this._onSessionExit);
4471
4480
  this._events.length = 0;
4472
4481
  };
4473
4482
  _proto.resetEvents = function resetEvents() {
@@ -4610,7 +4619,16 @@ var WebXRDevice = /*#__PURE__*/ function() {
4610
4619
  });
4611
4620
  };
4612
4621
  _proto.isSupportedFeature = function isSupportedFeature(type) {
4613
- return true;
4622
+ switch(type){
4623
+ case engineXr.XRFeatureType.HitTest:
4624
+ case engineXr.XRFeatureType.PlaneTracking:
4625
+ return typeof XRPlane !== "undefined";
4626
+ case engineXr.XRFeatureType.AnchorTracking:
4627
+ return typeof XRAnchor !== "undefined";
4628
+ case engineXr.XRFeatureType.ImageTracking:
4629
+ // @ts-ignore
4630
+ return typeof XRImageTrackingResult !== "undefined";
4631
+ }
4614
4632
  };
4615
4633
  _proto.createPlatformFeature = function createPlatformFeature(type) {
4616
4634
  for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){