瀏覽代碼

Fix Camera element overload

sebavan 4 年之前
父節點
當前提交
3d635ebb26
共有 3 個文件被更改,包括 31 次插入5 次删除
  1. 5 1
      src/Cameras/arcRotateCamera.ts
  2. 13 2
      src/Cameras/camera.ts
  3. 13 2
      src/Cameras/freeCamera.ts

+ 5 - 1
src/Cameras/arcRotateCamera.ts

@@ -828,7 +828,11 @@ export class ArcRotateCamera extends TargetCamera {
      * Detach the current controls from the specified dom element.
      */
     public detachControl(): void;
-
+    /**
+     * Detach the current controls from the specified dom element.
+     * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
+     */
+    public detachControl(ignored: any): void;
     /**
      * Detach the current controls from the specified dom element.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl

+ 13 - 2
src/Cameras/camera.ts

@@ -530,15 +530,26 @@ export class Camera extends Node {
      * Attach the input controls to a specific dom element to get the input from.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
+     * BACK COMPAT SIGNATURE ONLY.
      */
-    public attachControl(ignored: any, noPreventDefault?: boolean): void {
+    public attachControl(ignored: any, noPreventDefault?: boolean): void;
+    /**
+     * Attach the input controls to a specific dom element to get the input from.
+     * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
+     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
+     */
+    public attachControl(ignored?: any, noPreventDefault?: boolean): void {
     }
 
     /**
      * Detach the current controls from the specified dom element.
      */
     public detachControl(): void;
-
+    /**
+     * Detach the current controls from the specified dom element.
+     * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
+     */
+    public detachControl(ignored: any): void;
     /**
      * Detach the current controls from the specified dom element.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl

+ 13 - 2
src/Cameras/freeCamera.ts

@@ -227,11 +227,18 @@ export class FreeCamera extends TargetCamera {
      */
     public attachControl(noPreventDefault?: boolean): void;
     /**
+     * Attach the input controls to a specific dom element to get the input from.
+     * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
+     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
+     * BACK COMPAT SIGNATURE ONLY.
+     */
+    public attachControl(ignored: any, noPreventDefault?: boolean): void;
+    /**
      * Attached controls to the current camera.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
      */
-    public attachControl(ignored: any, noPreventDefault?: boolean): void {
+    public attachControl(ignored?: any, noPreventDefault?: boolean): void {
         noPreventDefault = Tools.BackCompatCameraNoPreventDefault(arguments);
         this.inputs.attachElement(noPreventDefault);
     }
@@ -240,7 +247,11 @@ export class FreeCamera extends TargetCamera {
      * Detach the current controls from the specified dom element.
      */
     public detachControl(): void;
-
+    /**
+     * Detach the current controls from the specified dom element.
+     * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
+     */
+    public detachControl(ignored: any): void;
     /**
      * Detach the current controls from the specified dom element.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl