Interface ICameraInput<Tcamera>
interface ICameraInput<Tcamera extends Camera> {
camera: Nullable<Tcamera>;
checkInputs?: () => void;
attachControl(noPreventDefault?: boolean): void;
detachControl(): void;
getClassName(): string;
getSimpleName(): string;
}
camera: Nullable<Tcamera>;
checkInputs?: () => void;
attachControl(noPreventDefault?: boolean): void;
detachControl(): void;
getClassName(): string;
getSimpleName(): string;
}
Type Parameters
- Tcamera extends Camera
Implemented by
- ArcRotateCameraGamepadInput
- ArcRotateCameraKeyboardMoveInput
- ArcRotateCameraMouseWheelInput
- ArcRotateCameraVRDeviceOrientationInput
- BaseCameraMouseWheelInput
- BaseCameraPointersInput
- FlyCameraKeyboardInput
- FlyCameraMouseInput
- FollowCameraKeyboardMoveInput
- FollowCameraMouseWheelInput
- FreeCameraDeviceOrientationInput
- FreeCameraGamepadInput
- FreeCameraKeyboardMoveInput
- FreeCameraMouseInput
- FreeCameraTouchInput
- FreeCameraVirtualJoystickInput
- GeospatialCameraKeyboardInput
Properties
camera
Defines the camera the input is attached to.
Optionalcheck Inputs
checkInputs?: () => void
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.
Methods
attach Control
-
Attach the input controls to a specific dom element to get the input from.
Parameters
OptionalnoPreventDefault: booleanDefines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Returns void
detach Control
-
Detach the current controls from the specified dom element.
Returns void
get Class Name
-
Gets the class name of the current input.
Returns string
the class name
get Simple Name
-
Get the friendly name associated with the input class.
Returns string
the input friendly name
This is the contract to implement in order to create a new input class. Inputs are dealing with listening to user actions and moving the camera accordingly.