Browse Source

Make pointA and PointB private.

duncan law 6 years ago
parent
commit
94abeae287

+ 2 - 6
src/Cameras/Inputs/BaseCameraPointersInput.ts

@@ -38,12 +38,6 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
     public buttons = [0, 1, 2];
 
     /**
-     * Last event on up to 2 Touch events.
-     */
-    protected pointA: Nullable<PointerTouch>;
-    protected pointB: Nullable<PointerTouch>;
-
-    /**
      * Attach the input controls to a specific dom element to get the input from.
      * @param element Defines the element the controls should be listened from
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
@@ -346,4 +340,6 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
     private _pointerInput: (p: PointerInfo, s: EventState) => void;
     private _observer: Nullable<Observer<PointerInfo>>;
     private _onLostFocus: Nullable<(e: FocusEvent) => any>;
+    private pointA: Nullable<PointerTouch>;
+    private pointB: Nullable<PointerTouch>;
 }

+ 2 - 0
tests/unit/babylon/src/Cameras/babylon.pointerInput.tests.ts

@@ -81,6 +81,8 @@ function simulateEvent(cameraInput: BABYLON.ICameraInput<BABYLON.Camera>,
  *   methods stubbed out.
  */
 function StubCameraInput() {
+  // Force our CameraPointersInput instance to type "any" so we can access
+  // protected methods from within this function.
   let cameraInput: any = (<any>new BABYLON.ArcRotateCameraPointersInput());
 
   /**