File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,25 @@ AFRAME.registerComponent('haptics', {
3030
3131 if ( this . el . components [ 'tracked-controls' ] . controller ) {
3232 this . gamepad = this . el . components [ 'tracked-controls' ] . controller ;
33+
34+ if ( this . gamepad . gamepad ) {
35+ // WebXR.
36+ this . gamepad = this . gamepad . gamepad ;
37+ }
38+
3339 if ( ! this . gamepad || ! this . gamepad . hapticActuators ||
3440 ! this . gamepad . hapticActuators . length ) { return ; }
3541 this . addEventListeners ( ) ;
3642 } else {
3743 this . el . addEventListener ( 'controllerconnected' , function init ( ) {
3844 setTimeout ( function ( ) {
3945 self . gamepad = self . el . components [ 'tracked-controls' ] . controller ;
46+
47+ if ( self . gamepad . gamepad ) {
48+ // WebXR.
49+ self . gamepad = self . gamepad . gamepad ;
50+ }
51+
4052 if ( ! self . gamepad || ! self . gamepad . hapticActuators ||
4153 ! self . gamepad . hapticActuators . length ) { return ; }
4254 self . addEventListeners ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " aframe-haptics-component" ,
3- "version" : " 1.5.1 " ,
3+ "version" : " 1.6.0 " ,
44 "description" : " A controller haptics (vibrations) component for A-Frame." ,
55 "main" : " index.js" ,
66 "cdn" : " dist/aframe-haptics-component.min.js" ,
You can’t perform that action at this time.
0 commit comments