@@ -17,6 +17,7 @@ var GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;
1717
1818// First generation model URL.
1919var TOUCH_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-' ;
20+ var META_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/meta/' ;
2021
2122var OCULUS_TOUCH_WEBVR = {
2223 left : {
@@ -80,6 +81,20 @@ var CONTROLLER_PROPERTIES = {
8081 modelPivotOffset : new THREE . Vector3 ( - 0.01 , - 0.01 , 0.05 ) ,
8182 modelPivotRotation : new THREE . Euler ( Math . PI / 4 , 0 , 0 )
8283 }
84+ } ,
85+ 'meta-quest-touch-pro' : {
86+ left : {
87+ modelUrl : META_CONTROLLER_MODEL_BASE_URL + 'quest-touch-pro-left.glb' ,
88+ rayOrigin : { origin : { x : 0.015 , y : 0.005 , z : 0 } , direction : { x : 0 , y : 0 , z : - 1 } } ,
89+ modelPivotOffset : new THREE . Vector3 ( 0 , 0 , 0 ) ,
90+ modelPivotRotation : new THREE . Euler ( 0 , 0 , 0 )
91+ } ,
92+ right : {
93+ modelUrl : META_CONTROLLER_MODEL_BASE_URL + 'quest-touch-pro-right.glb' ,
94+ rayOrigin : { origin : { x : - 0.015 , y : 0.005 , z : 0 } , direction : { x : 0 , y : 0 , z : - 1 } } ,
95+ modelPivotOffset : new THREE . Vector3 ( 0 , 0 , 0 ) ,
96+ modelPivotRotation : new THREE . Euler ( 0 , 0 , 0 )
97+ }
8398 }
8499} ;
85100
@@ -203,7 +218,8 @@ module.exports.Component = registerComponent('oculus-touch-controls', {
203218
204219 checkIfControllerPresent : function ( ) {
205220 checkControllerPresentAndSetup ( this , GAMEPAD_ID_PREFIX , {
206- hand : this . data . hand
221+ hand : this . data . hand ,
222+ iterateControllerProfiles : true
207223 } ) ;
208224 } ,
209225
@@ -236,8 +252,13 @@ module.exports.Component = registerComponent('oculus-touch-controls', {
236252 }
237253 } else { // WebXR
238254 controllerId = CONTROLLER_DEFAULT ;
239- controllerId = controller . profiles . indexOf ( 'oculus-touch-v2' ) !== - 1 ? 'oculus-touch-v2' : controllerId ;
240- controllerId = controller . profiles . indexOf ( 'oculus-touch-v3' ) !== - 1 ? 'oculus-touch-v3' : controllerId ;
255+ var controllersPropertiesIds = Object . keys ( CONTROLLER_PROPERTIES ) ;
256+ for ( var i = 0 ; i < controller . profiles . length ; i ++ ) {
257+ if ( controllersPropertiesIds . indexOf ( controller . profiles [ i ] ) !== - 1 ) {
258+ controllerId = controller . profiles [ i ] ;
259+ break ;
260+ }
261+ }
241262 this . displayModel = CONTROLLER_PROPERTIES [ controllerId ] ;
242263 }
243264 }
@@ -255,7 +276,8 @@ module.exports.Component = registerComponent('oculus-touch-controls', {
255276 id : id ,
256277 hand : data . hand ,
257278 orientationOffset : data . orientationOffset ,
258- handTrackingEnabled : false
279+ handTrackingEnabled : false ,
280+ iterateControllerProfiles : true
259281 } ) ;
260282 this . loadModel ( controller ) ;
261283 } ,
0 commit comments