@@ -22,22 +22,18 @@ module.exports.Component = registerComponent('gearvr-controls', {
2222 buttonTouchedColor : { type : 'color' , default : '#777777' } ,
2323 buttonHighlightColor : { type : 'color' , default : '#FFFFFF' } ,
2424 model : { default : true } ,
25- rotationOffset : { default : 0 } , // use -999 as sentinel value to auto-determine based on hand
25+ rotationOffset : { default : 0 } ,
2626 armModel : { default : true }
2727 } ,
2828
2929 // buttonId
3030 // 0 - trackpad
3131 // 1 - triggeri
3232 mapping : {
33- axes : { ' trackpad' : [ 0 , 1 ] } ,
33+ axes : { trackpad : [ 0 , 1 ] } ,
3434 buttons : [ 'trackpad' , 'trigger' ]
3535 } ,
3636
37- // Use these labels for detail on axis events such as thumbstickmoved.
38- // e.g. for thumbstickmoved detail, the first axis returned is labeled x, and the second is labeled y.
39- axisLabels : [ 'x' , 'y' , 'z' , 'w' ] ,
40-
4137 bindMethods : function ( ) {
4238 this . onModelLoaded = bind ( this . onModelLoaded , this ) ;
4339 this . onControllersUpdate = bind ( this . onControllersUpdate , this ) ;
@@ -60,8 +56,8 @@ module.exports.Component = registerComponent('gearvr-controls', {
6056 this . everGotGamepadEvent = false ;
6157 this . lastControllerCheck = 0 ;
6258 this . bindMethods ( ) ;
63- this . checkControllerPresentAndSetup = checkControllerPresentAndSetup ; // to allow mock
64- this . emitIfAxesChanged = emitIfAxesChanged ; // to allow mock
59+ this . checkControllerPresentAndSetup = checkControllerPresentAndSetup ; // To allow mock.
60+ this . emitIfAxesChanged = emitIfAxesChanged ; // To allow mock.
6561 } ,
6662
6763 addEventListeners : function ( ) {
@@ -91,7 +87,8 @@ module.exports.Component = registerComponent('gearvr-controls', {
9187 } ,
9288
9389 checkIfControllerPresent : function ( ) {
94- this . checkControllerPresentAndSetup ( this , GAMEPAD_ID_PREFIX , this . data . hand ? { hand : this . data . hand } : { } ) ;
90+ this . checkControllerPresentAndSetup ( this , GAMEPAD_ID_PREFIX ,
91+ this . data . hand ? { hand : this . data . hand } : { } ) ;
9592 } ,
9693
9794 onGamepadConnectionEvent : function ( evt ) {
@@ -115,7 +112,11 @@ module.exports.Component = registerComponent('gearvr-controls', {
115112 injectTrackedControls : function ( ) {
116113 var el = this . el ;
117114 var data = this . data ;
118- el . setAttribute ( 'tracked-controls' , { idPrefix : GAMEPAD_ID_PREFIX , rotationOffset : data . rotationOffset , armModel : data . armModel } ) ;
115+ el . setAttribute ( 'tracked-controls' , {
116+ armModel : data . armModel ,
117+ idPrefix : GAMEPAD_ID_PREFIX ,
118+ rotationOffset : data . rotationOffset
119+ } ) ;
119120 if ( ! this . data . model ) { return ; }
120121 this . el . setAttribute ( 'obj-model' , {
121122 obj : GEARVR_CONTROLLER_MODEL_OBJ_URL ,
@@ -167,7 +168,9 @@ module.exports.Component = registerComponent('gearvr-controls', {
167168 this . updateModel ( buttonName , evtName ) ;
168169 } ,
169170
170- onAxisMoved : function ( evt ) { this . emitIfAxesChanged ( this , this . mapping . axes , evt ) ; } ,
171+ onAxisMoved : function ( evt ) {
172+ this . emitIfAxesChanged ( this , this . mapping . axes , evt ) ;
173+ } ,
171174
172175 updateModel : function ( buttonName , evtName ) {
173176 var i ;
0 commit comments