Sfoglia il codice sorgente

Merge pull request #9230 from sebavan/master

Fix Camera element overload
Raanan Weber 4 anni fa
parent
commit
a00748ea6f
3 ha cambiato i file con 31 aggiunte e 5 eliminazioni
  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