Explorar o código

ViveController: Fixed getButtonState().

Mr.doob %!s(int64=9) %!d(string=hai) anos
pai
achega
5ae41648b9
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      examples/js/ViveController.js

+ 4 - 1
examples/js/ViveController.js

@@ -27,7 +27,10 @@ THREE.ViveController = function ( id ) {
 
 	this.getButtonState = function ( button ) {
 
-		return scope[ button + ( button === 'grips' ? 'ArePressed' : 'IsPressed' ) ];
+		if ( button === 'thumbpad' ) return thumbpadIsPressed;
+		if ( button === 'trigger' ) return triggerIsPressed;
+		if ( button === 'grips' ) return gripsArePressed;
+		if ( button === 'menu' ) return menuIsPressed;
 
 	};