Class FollowCameraPointersInput
Hierarchy (View Summary)
- BaseCameraPointersInput
- FollowCameraPointersInput
Constructors
constructor
-
Returns FollowCameraPointersInput
Properties
angular Sensibility X
Defines the pointer angular sensibility along the X axis or how fast is the camera rotating. A negative number will reverse the axis direction.
angular Sensibility Y
Defines the pointer angular sensibility along the Y axis or how fast is the camera rotating. A negative number will reverse the axis direction.
axis Pinch Control Height
Pinch controls height. (Pinch modifies camera.heightOffset value.)
axis Pinch Control Radius
Pinch controls zoom. (Pinch modifies camera.radius value.)
axis Pinch Control Rotation
Pinch controls angle. (Pinch modifies camera.rotationOffset value.)
axis X Control Height
Pointer X axis controls height. (X axis modifies camera.heightOffset value.)
axis X Control Radius
Pointer X axis controls zoom. (X axis modifies camera.radius value.)
axis X Control Rotation
Pointer X axis controls angle. (X axis modifies camera.rotationOffset value.)
axis Y Control Height
Pointer Y axis controls height. (Y axis modifies camera.heightOffset value.)
axis Y Control Radius
Pointer Y axis controls zoom. (Y axis modifies camera.radius value.)
axis Y Control Rotation
Pointer Y axis controls angle. (Y axis modifies camera.rotationOffset value.)
buttons
Defines the buttons associated with the input to handle camera move.
camera
Defines the camera the input is attached to.
pinch Delta Percentage
pinchDeltaPercentage will be used instead of pinchPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
pinch Precision
Defines the pointer pinch precision or how fast is the camera zooming. A negative number will reverse the axis direction.
warning Enable
Log error messages if basic misconfiguration has occurred.
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
on Button Down
-
Called each time a new POINTERDOWN event occurs. Ie, for each button press. Override this method to provide functionality.
Parameters
- _evt: IPointerEvent
Defines the event to track
Returns void
- _evt: IPointerEvent
on Button Up
-
Called each time a new POINTERUP event occurs. Ie, for each button release. Override this method to provide functionality.
Parameters
- _evt: IPointerEvent
Defines the event to track
Returns void
- _evt: IPointerEvent
on Context Menu
-
Called on JS contextmenu event. Override this method to provide functionality.
Parameters
- evt: PointerEvent
the event to be handled
Returns void
- evt: PointerEvent
on Double Tap
-
Called on pointer POINTERDOUBLETAP event. Override this method to provide functionality on POINTERDOUBLETAP event.
Parameters
- type: string
type of event
Optionalevt: IPointerEventthe pointer event that triggered the double tap (carries button / buttons state)
Returns void
- type: string
on Lost Focus
-
Called when window becomes inactive. Override this method to provide functionality.
Returns void
on Multi Touch
-
onMultiTouch(
pointA: Nullable<PointerTouch>,
pointB: Nullable<PointerTouch>,
previousPinchSquaredDistance: number,
pinchSquaredDistance: number,
previousMultiTouchPanPosition: Nullable<PointerTouch>,
multiTouchPanPosition: Nullable<PointerTouch>,
): voidCalled on pointer POINTERMOVE event if multiple touches are active.
Parameters
- pointA: Nullable<PointerTouch>
First point in the pair
- pointB: Nullable<PointerTouch>
Second point in the pair
- previousPinchSquaredDistance: number
Sqr Distance between the points the last time this event was fired (by this input)
- pinchSquaredDistance: number
Sqr Distance between the points this time
- previousMultiTouchPanPosition: Nullable<PointerTouch>
Previous center point between the points
- multiTouchPanPosition: Nullable<PointerTouch>
Current center point between the points
Returns void
- pointA: Nullable<PointerTouch>
on Touch
-
Called on pointer POINTERMOVE event if only a single touch is active.
Parameters
- pointA: Nullable<PointerTouch>
The current position of the pointer
- offsetX: number
The offsetX of the pointer when the event occurred
- offsetY: number
The offsetY of the pointer when the event occurred
Returns void
- pointA: Nullable<PointerTouch>
Manage the pointers inputs to control an follow camera.
See
https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs