File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ module.exports.Component = registerComponent('cursor', {
8686
8787 update : function ( oldData ) {
8888 if ( this . data . rayOrigin === oldData . rayOrigin ) { return ; }
89+ if ( this . data . rayOrigin === 'entity' ) { this . resetRaycaster ( ) ; }
8990 this . updateMouseEventListeners ( ) ;
9091 // Update the WebXR event listeners if needed
9192 if ( this . data . rayOrigin === 'xrselect' ) {
@@ -220,6 +221,13 @@ module.exports.Component = registerComponent('cursor', {
220221 this . updateCanvasBounds ( ) ;
221222 } ,
222223
224+ resetRaycaster : function ( ) {
225+ this . el . setAttribute ( 'raycaster' , {
226+ direction : new THREE . Vector3 ( ) . set ( 0 , 0 , - 1 ) ,
227+ origin : new THREE . Vector3 ( )
228+ } ) ;
229+ } ,
230+
223231 addWebXREventListeners : function ( ) {
224232 var self = this ;
225233 var xrSession = this . el . sceneEl . xrSession ;
You can’t perform that action at this time.
0 commit comments