Class FreeCameraInputsManager
Hierarchy
-
CameraInputsManager<FreeCamera>
- FreeCameraInputsManager
Index
Constructors
Properties
Methods
Constructors
constructor
-
Instantiates a new FreeCameraInputsManager.
Parameters
-
camera: FreeCamera
Defines the camera the inputs belong to
Returns FreeCameraInputsManager
-
Properties
attachedSearch playground for attached
Defines the list of inputs attahed to the camera.
attached ToElementSearch playground for attachedToElement
Defines the dom element the camera is collecting inputs from. This is null if the controls have not been attached.
cameraSearch playground for camera
Defined the camera the input manager belongs to.
check InputsSearch playground for checkInputs
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
-
-
Returns void
-
no Prevent DefaultSearch playground for noPreventDefault
Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Methods
addSearch playground for add
-
Add an input method to a camera
Parameters
-
input: ICameraInput<FreeCamera>
camera input method
Returns void
-
add Device OrientationSearch playground for addDeviceOrientation
-
Add orientation input support to the input manager.
Returns FreeCameraInputsManager
the current input manager
add GamepadSearch playground for addGamepad
-
Adds gamepad input support to the FreeCameraInputsManager.
Returns FreeCameraInputsManager
the FreeCameraInputsManager
add KeyboardSearch playground for addKeyboard
-
Add keyboard input support to the input manager.
Returns FreeCameraInputsManager
the current input manager
add MouseSearch playground for addMouse
-
Add mouse input support to the input manager.
Parameters
-
Optional touchEnabled: boolean
if the FreeCameraMouseInput should support touch (default: true)
Returns FreeCameraInputsManager
the current input manager
-
add Mouse WheelSearch playground for addMouseWheel
-
Add mouse wheel input support to the input manager.
Returns FreeCameraInputsManager
the current input manager
add TouchSearch playground for addTouch
-
Add touch input support to the input manager.
Returns FreeCameraInputsManager
the current input manager
add Virtual JoystickSearch playground for addVirtualJoystick
-
Add virtual joystick input support to the input manager.
Returns FreeCameraInputsManager
the current input manager
attach ElementSearch playground for attachElement
-
Attach the current manager inputs controls to a specific dom element to listen the events from.
Parameters
-
Optional noPreventDefault: boolean
Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Returns void
-
attach InputSearch playground for attachInput
-
Attach the input controls to the currently attached dom element to listen the events from.
Parameters
-
input: ICameraInput<FreeCamera>
Defines the input to attach
Returns void
-
clearSearch playground for clear
-
Remove all attached input methods from a camera
Returns void
detach ElementSearch playground for detachElement
-
Detach the current manager inputs controls from a specific dom element.
Parameters
-
Optional disconnect: boolean
Defines whether the input should be removed from the current list of attached inputs
Returns void
-
parseSearch playground for parse
-
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
-
rebuild Input CheckSearch playground for rebuildInputCheck
-
Rebuild the dynamic inputCheck function from the current list of defined inputs in the manager.
Returns void
removeSearch playground for remove
-
Remove a specific input method from a camera example: camera.inputs.remove(camera.inputs.attached.mouse);
Parameters
-
inputToRemove: ICameraInput<FreeCamera>
camera input method
Returns void
-
remove ByTypeSearch playground for removeByType
-
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
-
remove MouseSearch playground for removeMouse
-
Removes the mouse input support from the manager
Returns FreeCameraInputsManager
the current input manager
remove Mouse WheelSearch playground for removeMouseWheel
-
Removes the mouse wheel input support from the manager
Returns FreeCameraInputsManager
the current input manager
serializeSearch playground for serialize
-
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
-
Default Inputs manager for the FreeCamera. It groups all the default supported inputs for ease of use. Interface representing a free camera inputs manager
https://doc.babylonjs.com/how_to/customizing_camera_inputs