diff --git a/src/renderers/webxr/WebXRController.js b/src/renderers/webxr/WebXRController.js index 62ed1f9c1d07b9..1d53a6dc9f41ed 100644 --- a/src/renderers/webxr/WebXRController.js +++ b/src/renderers/webxr/WebXRController.js @@ -1,18 +1,16 @@ import { Group } from '../../objects/Group.js'; -function WebXRController() { +class WebXRController { - this._targetRay = null; - this._grip = null; - this._hand = null; + constructor() { -} - -Object.assign( WebXRController.prototype, { + this._targetRay = null; + this._grip = null; + this._hand = null; - constructor: WebXRController, + } - getHandSpace: function () { + getHandSpace() { if ( this._hand === null ) { @@ -27,9 +25,9 @@ Object.assign( WebXRController.prototype, { return this._hand; - }, + } - getTargetRaySpace: function () { + getTargetRaySpace() { if ( this._targetRay === null ) { @@ -41,9 +39,9 @@ Object.assign( WebXRController.prototype, { return this._targetRay; - }, + } - getGripSpace: function () { + getGripSpace() { if ( this._grip === null ) { @@ -55,9 +53,9 @@ Object.assign( WebXRController.prototype, { return this._grip; - }, + } - dispatchEvent: function ( event ) { + dispatchEvent( event ) { if ( this._targetRay !== null ) { @@ -79,9 +77,9 @@ Object.assign( WebXRController.prototype, { return this; - }, + } - disconnect: function ( inputSource ) { + disconnect( inputSource ) { this.dispatchEvent( { type: 'disconnected', data: inputSource } ); @@ -105,9 +103,9 @@ Object.assign( WebXRController.prototype, { return this; - }, + } - update: function ( inputSource, frame, referenceSpace ) { + update( inputSource, frame, referenceSpace ) { let inputPose = null; let gripPose = null; @@ -238,7 +236,7 @@ Object.assign( WebXRController.prototype, { } -} ); +} export { WebXRController };