Raanan Weber 5 年 前
コミット
f15cf37276

+ 8 - 3
src/Cameras/XR/features/WebXRControllerPointerSelection.ts

@@ -6,7 +6,6 @@ import { WebXRInput } from '../webXRInput';
 import { WebXRController } from '../webXRController';
 import { WebXRController } from '../webXRController';
 import { Scene } from '../../../scene';
 import { Scene } from '../../../scene';
 import { WebXRControllerComponent } from '../motionController/webXRControllerComponent';
 import { WebXRControllerComponent } from '../motionController/webXRControllerComponent';
-import { MotionControllerComponentType } from '../motionController/webXRAbstractController';
 import { Nullable } from '../../../types';
 import { Nullable } from '../../../types';
 import { Vector3 } from '../../../Maths/math.vector';
 import { Vector3 } from '../../../Maths/math.vector';
 import { Color3 } from '../../../Maths/math.color';
 import { Color3 } from '../../../Maths/math.color';
@@ -23,8 +22,14 @@ const Name = "xr-controller-pointer-selection";
  * Options interface for the pointer selection module
  * Options interface for the pointer selection module
  */
  */
 export interface IWebXRControllerPointerSelectionOptions {
 export interface IWebXRControllerPointerSelectionOptions {
+    /**
+     * the xr input to use with this pointer selection
+     */
     xrInput: WebXRInput;
     xrInput: WebXRInput;
-    overrideButtonId?: MotionControllerComponentType;
+    /**
+     * Different button type to use instead of the main component
+     */
+    overrideButtonId?: string;
 }
 }
 
 
 /**
 /**
@@ -90,7 +95,7 @@ export class WebXRControllerPointerSelection implements IWebXRFeature {
     /**
     /**
      * constructs a new background remover module
      * constructs a new background remover module
      * @param _xrSessionManager the session manager for this module
      * @param _xrSessionManager the session manager for this module
-     * @param options read-only options to be used in this module
+     * @param _options read-only options to be used in this module
      */
      */
     constructor(private _xrSessionManager: WebXRSessionManager, private readonly _options: IWebXRControllerPointerSelectionOptions) {
     constructor(private _xrSessionManager: WebXRSessionManager, private readonly _options: IWebXRControllerPointerSelectionOptions) {
         this._scene = this._xrSessionManager.scene;
         this._scene = this._xrSessionManager.scene;

+ 12 - 0
src/Cameras/XR/motionController/webXRControllerComponent.ts

@@ -56,9 +56,21 @@ export interface IWebXRMotionControllerComponentChanges {
  */
  */
 export class WebXRControllerComponent implements IDisposable {
 export class WebXRControllerComponent implements IDisposable {
 
 
+    /**
+     * Thumbstick component type
+     */
     public static THUMBSTICK = "xr-standard-thumbstick";
     public static THUMBSTICK = "xr-standard-thumbstick";
+    /**
+     * Touchpad component type
+     */
     public static TOUCHPAD = "xr-standard-touchpad";
     public static TOUCHPAD = "xr-standard-touchpad";
+    /**
+     * trigger component type
+     */
     public static TRIGGER = "xr-standard-trigger";
     public static TRIGGER = "xr-standard-trigger";
+    /**
+     * squeeze component type
+     */
     public static SQUEEZE = "xr-standard-squeeze";
     public static SQUEEZE = "xr-standard-squeeze";
     /**
     /**
      * Observers registered here will be triggered when the state of a button changes
      * Observers registered here will be triggered when the state of a button changes

+ 3 - 0
src/Cameras/XR/webXRController.ts

@@ -70,6 +70,9 @@ export class WebXRController {
         }
         }
     }
     }
 
 
+    /**
+     * Get this controllers unique id
+     */
     public get uniqueId() {
     public get uniqueId() {
         return this._uniqueId;
         return this._uniqueId;
     }
     }