Skip to content

Commit

Permalink
WebXRController: Reuse single event object for move event.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Apr 22, 2021
1 parent 3d59a07 commit 979d8f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderers/webxr/WebXRController.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Group } from '../../objects/Group.js';

const _moveEvent = { type: 'move' };

class WebXRController {

constructor() {
Expand Down Expand Up @@ -126,7 +128,7 @@ class WebXRController {
targetRay.matrix.fromArray( inputPose.transform.matrix );
targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );

this.dispatchEvent( { type: 'move' } );
this.dispatchEvent( _moveEvent );

}

Expand Down

0 comments on commit 979d8f2

Please sign in to comment.