Skip to content

Commit

Permalink
Added a missing this and replaced eyeOffset.clone() by a copy(eyeOffs…
Browse files Browse the repository at this point in the history
…et) since VRPoint3D returned by hmdDevice.getEyeTranslation in chromium does not support clone()
  • Loading branch information
hbruch committed Nov 1, 2014
1 parent e923306 commit 049b44d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions VRSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ VRSetup.prototype.RequestFullScreenVR = function(){
if (this.renderer.domElement.webkitRequestFullscreen) {
this.renderer.domElement.webkitRequestFullscreen({ vrDisplay: this.hmdDevice });
document.addEventListener("webkitfullscreenchange", this.onFullscreenChange.bind(this), false);
} else if (renderer.domElement.mozRequestFullScreen) {
} else if (this.renderer.domElement.mozRequestFullScreen) {
this.renderer.domElement.mozRequestFullScreen({ vrDisplay: this.hmdDevice });
document.addEventListener("mozfullscreenchange", this.onFullscreenChange.bind(this), false);
}
Expand Down Expand Up @@ -238,8 +238,11 @@ VRSetup.prototype.updateVRDevice = function() {
this.cameraLeft.position.copy(this.camera.position);
this.cameraRight.position.copy(this.camera.position);

this.cameraLeft.position.add(this.eyeOffsetLeft.clone().applyQuaternion(this.camera.quaternion));
this.cameraRight.position.add(this.eyeOffsetRight.clone().applyQuaternion(this.camera.quaternion));
this.eyeOffsetLeftV.copy(this.eyeOffsetLeft);
this.eyeOffsetRightV.copy(this.eyeOffsetRight);

this.cameraLeft.position.add(this.eyeOffsetLeftV.applyQuaternion(this.camera.quaternion));
this.cameraRight.position.add(this.eyeOffsetRightV.applyQuaternion(this.camera.quaternion));

return true;
};
Expand Down

0 comments on commit 049b44d

Please sign in to comment.