Bladeren bron

VRControls/VREffect: Added getVRDisplay. See #9133 #9252.

Mr.doob 9 jaren geleden
bovenliggende
commit
c1c8b4a922
2 gewijzigde bestanden met toevoegingen van 12 en 0 verwijderingen
  1. 6 0
      examples/js/controls/VRControls.js
  2. 6 0
      examples/js/effects/VREffect.js

+ 6 - 0
examples/js/controls/VRControls.js

@@ -58,6 +58,12 @@ THREE.VRControls = function ( object, onError ) {
 	// standing=true but the VRDisplay doesn't provide stageParameters.
 	this.userHeight = 1.6;
 
+	this.getVRDisplay = function () {
+
+		return vrInput;
+
+	};
+
 	this.getStandingMatrix = function () {
 
 		return standingMatrix;

+ 6 - 0
examples/js/effects/VREffect.js

@@ -67,6 +67,12 @@ THREE.VREffect = function ( renderer, onError ) {
 	var rendererSize = renderer.getSize();
 	var rendererPixelRatio = renderer.getPixelRatio();
 
+	this.getVRDisplay = function () {
+
+		return vrHMD;
+
+	};
+
 	this.setSize = function ( width, height ) {
 
 		rendererSize = { width: width, height: height };