@woosh/meep-engine 2.43.35 → 2.43.36

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.
@@ -168,6 +168,26 @@ class Quaternion {
168
168
  forward.normalize();
169
169
 
170
170
  right._crossVectors(ux, uy, uz, forward.x, forward.y, forward.z);
171
+
172
+ if(right.lengthSq() === 0){
173
+ // up and forward are parallel
174
+
175
+ /*
176
+ adjust forward direction slightly
177
+ code take from : https://github.com/mrdoob/three.js/blob/88e8954b69377dad4ad1ceaf1a383f3536e88e5a/src/math/Matrix4.js#L304
178
+ */
179
+
180
+ if(Math.abs(uz) === 1){
181
+ forward.x += 0.001;
182
+ }else{
183
+ forward.z += 0.001;
184
+ }
185
+
186
+ forward.normalize();
187
+ right._crossVectors(ux,uy,uz, forward.x, forward.y, forward.z);
188
+
189
+ }
190
+
171
191
  right.normalize();
172
192
 
173
193
  up.crossVectors(forward, right);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.43.35",
8
+ "version": "2.43.36",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",