提交 ee2eca98 编写于 作者: J Josh Patterson

Add back in support for turning off standing in VRManager. This is

breaking Oculus Browser's internal demos and also breaks
https://threejs.org/examples/?q=webvr#webvr_rollercoaster.  Was a
regression in r93 from r92.
上级 1728f3d5
...@@ -1683,20 +1683,6 @@ Object.defineProperties( WebGLRenderTarget.prototype, { ...@@ -1683,20 +1683,6 @@ Object.defineProperties( WebGLRenderTarget.prototype, {
// //
Object.defineProperties( WebVRManager.prototype, {
standing: {
set: function ( /* value */ ) {
console.warn( 'THREE.WebVRManager: .standing has been removed.' );
}
}
} );
//
Audio.prototype.load = function ( file ) { Audio.prototype.load = function ( file ) {
console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' ); console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' );
......
...@@ -174,6 +174,7 @@ function WebVRManager( renderer ) { ...@@ -174,6 +174,7 @@ function WebVRManager( renderer ) {
this.enabled = false; this.enabled = false;
this.userHeight = 1.6; this.userHeight = 1.6;
this.standing = false;
this.getController = function ( id ) { this.getController = function ( id ) {
...@@ -229,15 +230,19 @@ function WebVRManager( renderer ) { ...@@ -229,15 +230,19 @@ function WebVRManager( renderer ) {
// //
var stageParameters = device.stageParameters; if ( this.standing ) {
if ( stageParameters ) { var stageParameters = device.stageParameters;
standingMatrix.fromArray( stageParameters.sittingToStandingTransform ); if ( stageParameters ) {
} else { standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
} else {
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
standingMatrix.makeTranslation( 0, scope.userHeight, 0 ); }
} }
...@@ -287,8 +292,12 @@ function WebVRManager( renderer ) { ...@@ -287,8 +292,12 @@ function WebVRManager( renderer ) {
standingMatrixInverse.getInverse( standingMatrix ); standingMatrixInverse.getInverse( standingMatrix );
cameraL.matrixWorldInverse.multiply( standingMatrixInverse ); if ( this.standing ) {
cameraR.matrixWorldInverse.multiply( standingMatrixInverse );
cameraL.matrixWorldInverse.multiply( standingMatrixInverse );
cameraR.matrixWorldInverse.multiply( standingMatrixInverse );
}
var parent = poseObject.parent; var parent = poseObject.parent;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册