|
@@ -20581,6 +20581,8 @@ function WebVRManager( renderer ) {
|
|
|
var device = null;
|
|
|
var frameData = null;
|
|
|
|
|
|
+ var poseTarget = null;
|
|
|
+
|
|
|
if ( typeof window !== 'undefined' && 'VRFrameData' in window ) {
|
|
|
|
|
|
frameData = new window.VRFrameData();
|
|
@@ -20652,6 +20654,12 @@ function WebVRManager( renderer ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
+ this.setPoseTarget = function ( object ) {
|
|
|
+
|
|
|
+ if ( object !== undefined ) poseTarget = object;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
this.getCamera = function ( camera ) {
|
|
|
|
|
|
if ( device === null ) return camera;
|
|
@@ -20664,24 +20672,35 @@ function WebVRManager( renderer ) {
|
|
|
//
|
|
|
|
|
|
var pose = frameData.pose;
|
|
|
+ var poseObject;
|
|
|
+
|
|
|
+ if ( poseTarget !== null ) {
|
|
|
+
|
|
|
+ poseObject = poseTarget;
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ poseObject = camera;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if ( pose.position !== null ) {
|
|
|
|
|
|
- camera.position.fromArray( pose.position );
|
|
|
+ poseObject.position.fromArray( pose.position );
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- camera.position.set( 0, 0, 0 );
|
|
|
+ poseObject.position.set( 0, 0, 0 );
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( pose.orientation !== null ) {
|
|
|
|
|
|
- camera.quaternion.fromArray( pose.orientation );
|
|
|
+ poseObject.quaternion.fromArray( pose.orientation );
|
|
|
|
|
|
}
|
|
|
|
|
|
- camera.updateMatrixWorld();
|
|
|
+ poseObject.updateMatrixWorld();
|
|
|
|
|
|
var stageParameters = device.stageParameters;
|
|
|
|