|
@@ -19711,6 +19711,9 @@ function WebVRManager( renderer ) {
|
|
|
|
|
|
var matrixWorldInverse = new THREE.Matrix4();
|
|
|
|
|
|
+ var standingMatrix = new THREE.Matrix4();
|
|
|
+ var standingMatrixInverse = new THREE.Matrix4();
|
|
|
+
|
|
|
var cameraL = new THREE.PerspectiveCamera();
|
|
|
cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 );
|
|
|
cameraL.layers.enable( 1 );
|
|
@@ -19753,6 +19756,7 @@ function WebVRManager( renderer ) {
|
|
|
//
|
|
|
|
|
|
this.enabled = false;
|
|
|
+ this.standing = false;
|
|
|
|
|
|
this.getDevice = function () {
|
|
|
|
|
@@ -19797,6 +19801,17 @@ function WebVRManager( renderer ) {
|
|
|
|
|
|
camera.updateMatrixWorld();
|
|
|
|
|
|
+ var stageParameters = device.stageParameters;
|
|
|
+
|
|
|
+ if ( this.standing && stageParameters ) {
|
|
|
+
|
|
|
+ standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
|
|
|
+ standingMatrixInverse.getInverse( standingMatrix );
|
|
|
+
|
|
|
+ camera.matrixWorld.multiply( standingMatrix );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if ( device.isPresenting === false ) return camera;
|
|
|
|
|
|
//
|
|
@@ -19807,6 +19822,13 @@ function WebVRManager( renderer ) {
|
|
|
cameraL.matrixWorldInverse.fromArray( frameData.leftViewMatrix );
|
|
|
cameraR.matrixWorldInverse.fromArray( frameData.rightViewMatrix );
|
|
|
|
|
|
+ if ( this.standing && stageParameters ) {
|
|
|
+
|
|
|
+ cameraL.matrixWorldInverse.multiply( standingMatrixInverse );
|
|
|
+ cameraR.matrixWorldInverse.multiply( standingMatrixInverse );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
var parent = camera.parent;
|
|
|
|
|
|
if ( parent !== null ) {
|
|
@@ -19852,6 +19874,12 @@ function WebVRManager( renderer ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
+ this.getStandingMatrix = function () {
|
|
|
+
|
|
|
+ return standingMatrix;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
this.submitFrame = function () {
|
|
|
|
|
|
if ( device && device.isPresenting ) device.submitFrame();
|