Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cardboard-vr-display

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cardboard-vr-display - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

package.json
{
"name": "cardboard-vr-display",
"version": "1.0.9",
"version": "1.0.10",
"homepage": "https://github.com/immersive-web/cardboard-vr-display",

@@ -5,0 +5,0 @@ "authors": [

@@ -37,2 +37,14 @@ /*

this.isFirefoxAndroid = Util.isFirefoxAndroid();
this.isIOS = Util.isIOS();
// Chrome as of m66 started reporting `rotationRate` in degrees rather
// than radians, to be consistent with other browsers.
// https://github.com/immersive-web/cardboard-vr-display/issues/18
let chromeVersion = Util.getChromeVersion();
this.isDeviceMotionInRadians = !this.isIOS && chromeVersion && chromeVersion < 66;
// In Chrome m65 there's a regression of devicemotion events. Fallback
// to using deviceorientation for these specific builds. More information
// at `Util.isChromeWithoutDeviceMotion`.
this.isWithoutDeviceMotion = Util.isChromeWithoutDeviceMotion();
this.filterToWorldQ = new MathUtil.Quaternion();

@@ -62,14 +74,2 @@

this.isFirefoxAndroid = Util.isFirefoxAndroid();
this.isIOS = Util.isIOS();
// Chrome as of m66 started reporting `rotationRate` in degrees rather
// than radians, to be consistent with other browsers.
// https://github.com/immersive-web/cardboard-vr-display/issues/18
let chromeVersion = Util.getChromeVersion();
this.isDeviceMotionInRadians = !this.isIOS && chromeVersion && chromeVersion < 66;
// In Chrome m65 there's a regression of devicemotion events. Fallback
// to using deviceorientation for these specific builds. More information
// at `Util.isChromeWithoutDeviceMotion`.
this.isWithoutDeviceMotion = Util.isChromeWithoutDeviceMotion();
this.orientationOut_ = new Float32Array(4);

@@ -90,13 +90,27 @@

if (this.isWithoutDeviceMotion && this._deviceOrientationQ) {
// We must rotate 90 degrees on the Y axis to get the correct
// orientation of looking down the -Z axis.
// We must rotate 90 (or -90, based on initial rotation) degrees
// on the Y axis to get the correct orientation of looking down the -Z axis.
this.deviceOrientationFixQ = this.deviceOrientationFixQ || (function () {
const z = new MathUtil.Quaternion().setFromAxisAngle(new MathUtil.Vector3(0, 0, -1), 0);
const y = new MathUtil.Quaternion().setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / 2);
const y = new MathUtil.Quaternion()
if (window.orientation === -90) {
y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / -2);
} else {
y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / 2);
}
return z.multiply(y);
})();
this.deviceOrientationFilterToWorldQ = this.deviceOrientationFilterToWorldQ || (function () {
const q = new MathUtil.Quaternion();
q.setFromAxisAngle(new MathUtil.Vector3(1, 0, 0), -Math.PI / 2);
return q;
})();
orientation = this._deviceOrientationQ;
var out = new MathUtil.Quaternion();
out.copy(orientation);
out.multiply(this.filterToWorldQ);
out.multiply(this.deviceOrientationFilterToWorldQ);
out.multiply(this.resetQ);

@@ -103,0 +117,0 @@ out.multiply(this.worldToScreenQ);

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc