@@ -166,15 +166,15 @@ class AQuaternion {
166
166
}
167
167
168
168
get left ( ) {
169
- return this . appyVector ( LEFT ) ;
169
+ return this . multiplyVector ( LEFT ) ;
170
170
}
171
171
172
172
get dir ( ) {
173
- return this . appyVector ( FORWARD ) ;
173
+ return this . multiplyVector ( FORWARD ) ;
174
174
}
175
175
176
176
get up ( ) {
177
- return this . appyVector ( UP ) ;
177
+ return this . multiplyVector ( UP ) ;
178
178
}
179
179
180
180
/**
@@ -328,15 +328,15 @@ function fromCache(scope, key, fn) {
328
328
329
329
export class IQuaternion extends AQuaternion {
330
330
get left ( ) {
331
- return fromCache ( this , LEFT_CACHE , ( ) => this . appyVector ( LEFT ) ) ;
331
+ return fromCache ( this , LEFT_CACHE , ( ) => this . multiplyVector ( LEFT ) ) ;
332
332
}
333
333
334
334
get dir ( ) {
335
- return fromCache ( this , FORWARD_CACHE , ( ) => this . appyVector ( FORWARD ) ) ;
335
+ return fromCache ( this , FORWARD_CACHE , ( ) => this . multiplyVector ( FORWARD ) ) ;
336
336
}
337
337
338
338
get up ( ) {
339
- return fromCache ( this , UP_CACHE , ( ) => this . appyVector ( UP ) ) ;
339
+ return fromCache ( this , UP_CACHE , ( ) => this . multiplyVector ( UP ) ) ;
340
340
}
341
341
}
342
342
@@ -392,15 +392,18 @@ const LEFT90 = new IQuaternion(LEFT, degree(90));
392
392
* @returns {IQuaternion }
393
393
*/
394
394
export function fromOrientation ( { alpha, beta, gamma } , orientation ) {
395
- let rot = new IQuaternion ( fromEulerYXZ ( degree ( beta ) , degree ( alpha ) , degree ( - gamma ) ) ) ;
396
- rot . multiplyQuaternion ( LEFT90 ) ;
395
+ const x = degree ( beta ) ;
396
+ const y = degree ( alpha ) ;
397
+ const z = degree ( - gamma ) ;
398
+ let rot = new IQuaternion ( fromEulerYXZ ( x , y , z ) ) ;
399
+ rot = rot . multiplyQuaternion ( LEFT90 ) ;
397
400
398
401
if ( orientation ) {
399
402
const { dir } = rot ;
400
403
const local = new IQuaternion ( dir , degree ( orientation ) ) ;
401
404
rot = local . multiplyQuaternion ( rot ) ;
402
405
}
403
- return rot [ AXES ] ;
406
+ return rot ;
404
407
}
405
408
406
409
export const Export = {
0 commit comments