three-stdlib 2.23.12 → 2.23.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -150,13 +150,16 @@ class OrbitControls extends THREE.EventDispatcher {
150
150
  };
151
151
  this.update = (() => {
152
152
  const offset = new THREE.Vector3();
153
- const quat = new THREE.Quaternion().setFromUnitVectors(object.up, new THREE.Vector3(0, 1, 0));
153
+ const up = new THREE.Vector3(0, 1, 0);
154
+ const quat = new THREE.Quaternion().setFromUnitVectors(object.up, up);
154
155
  const quatInverse = quat.clone().invert();
155
156
  const lastPosition = new THREE.Vector3();
156
157
  const lastQuaternion = new THREE.Quaternion();
157
158
  const twoPI = 2 * Math.PI;
158
159
  return function update() {
159
160
  const position = scope.object.position;
161
+ quat.setFromUnitVectors(object.up, up);
162
+ quatInverse.copy(quat).invert();
160
163
  offset.copy(position).sub(scope.target);
161
164
  offset.applyQuaternion(quat);
162
165
  spherical.setFromVector3(offset);
@@ -148,13 +148,16 @@ class OrbitControls extends EventDispatcher {
148
148
  };
149
149
  this.update = (() => {
150
150
  const offset = new Vector3();
151
- const quat = new Quaternion().setFromUnitVectors(object.up, new Vector3(0, 1, 0));
151
+ const up = new Vector3(0, 1, 0);
152
+ const quat = new Quaternion().setFromUnitVectors(object.up, up);
152
153
  const quatInverse = quat.clone().invert();
153
154
  const lastPosition = new Vector3();
154
155
  const lastQuaternion = new Quaternion();
155
156
  const twoPI = 2 * Math.PI;
156
157
  return function update() {
157
158
  const position = scope.object.position;
159
+ quat.setFromUnitVectors(object.up, up);
160
+ quatInverse.copy(quat).invert();
158
161
  offset.copy(position).sub(scope.target);
159
162
  offset.applyQuaternion(quat);
160
163
  spherical.setFromVector3(offset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-stdlib",
3
- "version": "2.23.12",
3
+ "version": "2.23.14",
4
4
  "description": "stand-alone library of threejs examples",
5
5
  "keywords": [
6
6
  "three",
@@ -64,10 +64,11 @@ class OculusHandPointerModel extends THREE__namespace.Object3D {
64
64
  }
65
65
  }
66
66
  _onDisconnected() {
67
+ var _a, _b;
67
68
  this.visible = false;
68
69
  this.xrInputSource = null;
69
- this.pointerGeometry.dispose();
70
- this.pointerMesh.material.dispose();
70
+ (_a = this.pointerGeometry) == null ? void 0 : _a.dispose();
71
+ (_b = this.pointerMesh) == null ? void 0 : _b.material.dispose();
71
72
  this.clear();
72
73
  }
73
74
  _drawVerticesRing(vertices, baseVector, ringIndex) {
@@ -45,10 +45,11 @@ class OculusHandPointerModel extends THREE.Object3D {
45
45
  }
46
46
  }
47
47
  _onDisconnected() {
48
+ var _a, _b;
48
49
  this.visible = false;
49
50
  this.xrInputSource = null;
50
- this.pointerGeometry.dispose();
51
- this.pointerMesh.material.dispose();
51
+ (_a = this.pointerGeometry) == null ? void 0 : _a.dispose();
52
+ (_b = this.pointerMesh) == null ? void 0 : _b.material.dispose();
52
53
  this.clear();
53
54
  }
54
55
  _drawVerticesRing(vertices, baseVector, ringIndex) {