Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions src/renderers/webxr/WebXRController.js
Original file line number Diff line number Diff line change
@@ -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 ) {

Expand All @@ -27,9 +25,9 @@ Object.assign( WebXRController.prototype, {

return this._hand;

},
}

getTargetRaySpace: function () {
getTargetRaySpace() {

if ( this._targetRay === null ) {

Expand All @@ -41,9 +39,9 @@ Object.assign( WebXRController.prototype, {

return this._targetRay;

},
}

getGripSpace: function () {
getGripSpace() {

if ( this._grip === null ) {

Expand All @@ -55,9 +53,9 @@ Object.assign( WebXRController.prototype, {

return this._grip;

},
}

dispatchEvent: function ( event ) {
dispatchEvent( event ) {

if ( this._targetRay !== null ) {

Expand All @@ -79,9 +77,9 @@ Object.assign( WebXRController.prototype, {

return this;

},
}

disconnect: function ( inputSource ) {
disconnect( inputSource ) {

this.dispatchEvent( { type: 'disconnected', data: inputSource } );

Expand All @@ -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;
Expand Down Expand Up @@ -238,7 +236,7 @@ Object.assign( WebXRController.prototype, {

}

} );
}


export { WebXRController };