FlyCameraInputsManager

Default Inputs manager for the FlyCamera. It groups all the default supported inputs for ease of use.

see

http://doc.babylonjs.com/how_to/customizing_camera_inputs

Hierarchy

Index

Constructors

constructor

Find examples in Playground

Properties

attached

Find examples in Playground

Defines the list of inputs attahed to the camera.

attachedElement

Find examples in Playground
attachedElement: Nullable<HTMLElement>

Defines the dom element the camera is collecting inputs from. This is null if the controls have not been attached.

camera

Find examples in Playground
camera: FlyCamera

Defined the camera the input manager belongs to.

checkInputs

Find examples in Playground
checkInputs: function

Update the current camera state depending on the inputs that have been used this frame. This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.

Type declaration

    • (): void
    • Returns void

noPreventDefault

Find examples in Playground
noPreventDefault: boolean

Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)

Methods

add

Find examples in Playground

addKeyboard

Find examples in Playground
  • Add keyboard input support to the input manager.

    Returns FlyCameraInputsManager

    the new FlyCameraKeyboardMoveInput().

addMouse

Find examples in Playground
  • Add mouse input support to the input manager.

    Parameters

    • Optional touchEnabled: boolean

      Enable touch screen support.

    Returns FlyCameraInputsManager

    the new FlyCameraMouseInput().

attachElement

Find examples in Playground
  • attachElement(element: HTMLElement, noPreventDefault?: boolean): void

attachInput

Find examples in Playground

clear

Find examples in Playground
  • clear(): void

detachElement

Find examples in Playground
  • detachElement(element: HTMLElement, disconnect?: boolean): void
  • Detach the current manager inputs controls from a specific dom element.

    Parameters

    • element: HTMLElement

      Defines the dom element to collect the events from

    • Optional disconnect: boolean

      Defines whether the input should be removed from the current list of attached inputs

    Returns void

parse

Find examples in Playground
  • parse(parsedCamera: any): void
  • Parses an input manager serialized JSON to restore the previous list of inputs and states associated to a camera.

    Parameters

    • parsedCamera: any

      Defines the JSON to parse

    Returns void

rebuildInputCheck

Find examples in Playground
  • rebuildInputCheck(): void

remove

Find examples in Playground
  • Remove a specific input method from a camera example: camera.inputs.remove(camera.inputs.attached.mouse);

    Parameters

    Returns void

removeByType

Find examples in Playground
  • removeByType(inputType: string): void
  • Remove a specific input type from a camera example: camera.inputs.remove("ArcRotateCameraGamepadInput");

    Parameters

    • inputType: string

      the type of the input to remove

    Returns void

serialize

Find examples in Playground
  • serialize(serializedCamera: any): void
  • Serialize the current input manager attached to a camera. This ensures than once parsed, the input associated to the camera will be identical to the current ones

    Parameters

    • serializedCamera: any

      Defines the camera serialization JSON the input serialization should write to

    Returns void

Generated using TypeDoc