Преглед изворни кода

Responses to review comments: Tidy up comments. Fix getClassName().

duncan law пре 6 година
родитељ
комит
a3890d720e

+ 1 - 16
src/Cameras/Inputs/BaseCameraPointersInput.ts

@@ -18,11 +18,6 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
     public abstract camera: Camera;
 
     /**
-     * The class name of the current input. Used by getClassName().
-     */
-    protected abstract _className: string;
-
-    /**
      * Whether keyboard modifier keys are pressed at time of last mouse event.
      */
     protected _altKey: boolean;
@@ -269,7 +264,7 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
      * @returns the class name
      */
     public getClassName(): string {
-        return this._className;
+        return "BaseCameraPointersInput";
     }
 
     /**
@@ -306,16 +301,6 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
                            pinchSquaredDistance: number,
                            previousMultiTouchPanPosition: Nullable<PointerTouch>,
                            multiTouchPanPosition: Nullable<PointerTouch>): void {
-        /* if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {
-         *     // First time this method is called when a user starts pinching.
-         *     // pinchSquaredDistance and multiTouchPanPosition are valid.
-         * }
-         * if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {
-         *     // Last time this method is called at the end of a pinch.
-         *     // previousPinchSquaredDistance and previousMultiTouchPanPosition
-         *     // are still valid.
-         * }
-         */
     }
 
     /**

+ 5 - 2
src/Cameras/Inputs/arcRotateCameraPointersInput.ts

@@ -16,9 +16,12 @@ export class ArcRotateCameraPointersInput extends BaseCameraPointersInput {
     public camera: ArcRotateCamera;
 
     /**
-     * The class name of the current input.
+     * Gets the class name of the current input.
+     * @returns the class name
      */
-    protected _className = "ArcRotateCameraPointersInput";
+    public getClassName(): string {
+        return "ArcRotateCameraPointersInput";
+    }
 
     /**
      * Defines the buttons associated with the input to handle camera move.

+ 16 - 9
src/Cameras/Inputs/followCameraPointersInput.ts

@@ -16,14 +16,24 @@ export class FollowCameraPointersInput extends BaseCameraPointersInput {
     public camera: FollowCamera;
 
     /**
-     * Defines the pointer angular sensibility along the X axis or how fast is the camera rotating.
+     * Gets the class name of the current input.
+     * @returns the class name
+     */
+    public getClassName(): string {
+        return "FollowCameraPointersInput";
+    }
+
+    /**
+     * Defines the pointer angular sensibility along the X axis or how fast is
+     * the camera rotating.
      * A negative number will reverse the axis direction.
      */
     @serialize()
     public angularSensibilityX = 1;
 
     /**
-     * Defines the pointer angular sensibility along the Y axis or how fast is the camera rotating.
+     * Defines the pointer angular sensibility along the Y axis or how fast is
+     * the camera rotating.
      * A negative number will reverse the axis direction.
      */
     @serialize()
@@ -37,8 +47,10 @@ export class FollowCameraPointersInput extends BaseCameraPointersInput {
     public pinchPrecision = 10000.0;
 
     /**
-     * pinchDeltaPercentage will be used instead of pinchPrecision if different from 0.
-     * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
+     * pinchDeltaPercentage will be used instead of pinchPrecision if different
+     * from 0.
+     * It defines the percentage of current camera.radius to use as delta when
+     * pinch zoom is used.
      */
     @serialize()
     public pinchDeltaPercentage = 0;
@@ -102,11 +114,6 @@ export class FollowCameraPointersInput extends BaseCameraPointersInput {
      */
     public warningEnable: boolean = true;
 
-    /**
-     * The class name of the current input.
-     */
-    protected _className = "FollowCameraPointersInput";
-
     protected onTouch(pointA: Nullable<PointerTouch>,
                       offsetX: number,
                       offsetY: number): void