@@ -198,7 +198,7 @@ export class WebXRCamera extends FreeCamera {
198
198
target . subtractToRef ( this . position , tmpVector ) ;
199
199
tmpVector . y = 0 ;
200
200
tmpVector . normalize ( ) ;
201
- const yRotation = Math . atan2 ( tmpVector . x , tmpVector . z ) ;
201
+ const yRotation = Math . atan2 ( tmpVector . x , tmpVector . z ) + ( this . _scene . useRightHandedSystem ? Math . PI : 0 ) ;
202
202
this . rotationQuaternion . toEulerAnglesToRef ( tmpVector ) ;
203
203
Quaternion . FromEulerAnglesToRef ( tmpVector . x , yRotation , tmpVector . z , this . rotationQuaternion ) ;
204
204
}
@@ -222,8 +222,6 @@ export class WebXRCamera extends FreeCamera {
222
222
this . _cache . maxZ = far ;
223
223
}
224
224
225
- private _rotate180 = new Quaternion ( 0 , 1 , 0 , 0 ) ;
226
-
227
225
private _updateFromXRSession ( ) {
228
226
const pose = this . _xrSessionManager . currentFrame && this . _xrSessionManager . currentFrame . getViewerPose ( this . _xrSessionManager . referenceSpace ) ;
229
227
this . _lastXRViewerPose = pose || undefined ;
@@ -256,8 +254,6 @@ export class WebXRCamera extends FreeCamera {
256
254
this . _referencedPosition . z *= - 1 ;
257
255
this . _referenceQuaternion . z *= - 1 ;
258
256
this . _referenceQuaternion . w *= - 1 ;
259
- } else {
260
- this . _referenceQuaternion . multiplyInPlace ( this . _rotate180 ) ;
261
257
}
262
258
263
259
if ( this . _firstFrame ) {
@@ -314,8 +310,6 @@ export class WebXRCamera extends FreeCamera {
314
310
currentRig . position . z *= - 1 ;
315
311
currentRig . rotationQuaternion . z *= - 1 ;
316
312
currentRig . rotationQuaternion . w *= - 1 ;
317
- } else {
318
- currentRig . rotationQuaternion . multiplyInPlace ( this . _rotate180 ) ;
319
313
}
320
314
Matrix . FromFloat32ArrayToRefScaled ( view . projectionMatrix , 0 , 1 , currentRig . _projectionMatrix ) ;
321
315
0 commit comments