Skip to content

Commit f468cf5

Browse files
authored
Merge pull request #14802 from joshpatt2/standing-fix
Add back in support for turning off standing in VRManager. This is
2 parents 1728f3d + 6b3e085 commit f468cf5

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

src/Three.Legacy.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,20 +1683,6 @@ Object.defineProperties( WebGLRenderTarget.prototype, {
16831683

16841684
//
16851685

1686-
Object.defineProperties( WebVRManager.prototype, {
1687-
1688-
standing: {
1689-
set: function ( /* value */ ) {
1690-
1691-
console.warn( 'THREE.WebVRManager: .standing has been removed.' );
1692-
1693-
}
1694-
}
1695-
1696-
} );
1697-
1698-
//
1699-
17001686
Audio.prototype.load = function ( file ) {
17011687

17021688
console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );

src/renderers/webvr/WebVRManager.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ function WebVRManager( renderer ) {
174174

175175
this.enabled = false;
176176
this.userHeight = 1.6;
177+
this.standing = false;
177178

178179
this.getController = function ( id ) {
179180

@@ -229,15 +230,19 @@ function WebVRManager( renderer ) {
229230

230231
//
231232

232-
var stageParameters = device.stageParameters;
233+
if ( this.standing ) {
233234

234-
if ( stageParameters ) {
235+
var stageParameters = device.stageParameters;
235236

236-
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
237+
if ( stageParameters ) {
237238

238-
} else {
239+
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
240+
241+
} else {
242+
243+
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
239244

240-
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
245+
}
241246

242247
}
243248

@@ -287,8 +292,12 @@ function WebVRManager( renderer ) {
287292

288293
standingMatrixInverse.getInverse( standingMatrix );
289294

290-
cameraL.matrixWorldInverse.multiply( standingMatrixInverse );
291-
cameraR.matrixWorldInverse.multiply( standingMatrixInverse );
295+
if ( this.standing ) {
296+
297+
cameraL.matrixWorldInverse.multiply( standingMatrixInverse );
298+
cameraR.matrixWorldInverse.multiply( standingMatrixInverse );
299+
300+
}
292301

293302
var parent = poseObject.parent;
294303

0 commit comments

Comments
 (0)