Module: camera_anim

Camera animation add-on. Implements procedural animation for the camera.

Summary

Methods

Type Definitions

Detailed Description

Methods

auto_rotate(auto_rotate_ratio, callbackopt, disable_on_mouse_wheelopt)

Switch auto-rotation of the TARGET or HOVER camera around its pivot, or auto-rotating of the EYE camera around itself. When it is called for the first time, auto-rotation is enabled while the next call will disable auto-rotation.
Parameters:
Name Type Attributes Description
auto_rotate_ratio Number Rotation speed multiplier
callback AutoRotateDisabledCallback <optional>
Callback to be executed when auto-rotation is disabled
disable_on_mouse_wheel Boolean <optional>
Disable camera auto-rotation after mouse scrolling.
Source:

check_auto_rotate() → {Boolean}

Check if auto-rotation is possible for the camera. For example, the STATIC camera cannot be rotated.
Returns:
Result of the check: true - when auto-rotation is possible, false - otherwise.
Type
Boolean
Source:

is_auto_rotate() → {Boolean}

Check if the camera is auto-rotating.
Returns:
Result of the check: true - when the camera is auto-rotating, false - otherwise.
Type
Boolean
Source:

is_moving() → {Boolean}

Check if the camera is being moved by the move_camera_to_point function.
Returns:
Result of the check: true - when the camera is moving, false - otherwise.
Type
Boolean
Source:

is_rotating() → {Boolean}

Check if the camera is being rotated by the rotate_camera function.
Returns:
Result of the check: true - when the camera is rotating, false - otherwise.
Type
Boolean
Source:

move_camera_to_point(cam_obj, point_obj, cam_lin_speed, cam_angle_speed, cbopt)

Smoothly move the camera to the target point. Intended for STATIC cameras only.
Parameters:
Name Type Attributes Description
cam_obj Object3D | tsr Camera object 3D
point_obj Object3D | tsr Target point object 3D
cam_lin_speed Number Camera linear speed, meters per second
cam_angle_speed Number Camera angular speed, radians per second
cb MoveCameraToPointCallback <optional>
Finishing callback
Source:

rotate_camera(cam_obj, angle_phi, angle_theta, timeopt, cbopt)

Smoothly rotate the camera. Intended for non-STATIC cameras.
Parameters:
Name Type Attributes Default Description
cam_obj Object3D Camera object 3D
angle_phi Number Horisontal rotation angle
angle_theta Number Vertical rotation angle
time Number <optional>
1000 Rotation time in ms
cb RotateCameraCallback <optional>
Finishing callback
Source:

stop_cam_moving()

Stop camera moving.
Source:

stop_cam_rotating()

Stop camera rotating.
Source:

track_to_target(cam_obj, target, rot_speedopt, nullable, zoom_multopt, nullable, zoom_timeopt, nullable, zoom_delayopt, nullable, track_cbnullable, zoom_in_cbnullable)

Smoothly rotate the EYE camera to make it pointing at the specified target (an object or some position). Then smoothly zoom on this target, pause and zoom back.
Parameters:
Name Type Attributes Default Description
cam_obj Object3D Camera object 3D
target Object3D | Vec3 Target object or target position
rot_speed Number <optional>
<nullable>
1 Rotation speed, radians per second
zoom_mult Number <optional>
<nullable>
2 Zoom level value
zoom_time Number <optional>
<nullable>
1 Time it takes to zoom on the target, seconds
zoom_delay Number <optional>
<nullable>
1 Delay before the camera zooms back, seconds
track_cb TrackToTargetCallback <nullable>
Track finishing callback
zoom_in_cb TrackToTargetZoomCallback <nullable>
Zoom-in callback
Source:

Type Definitions

AutoRotateDisabledCallback()

Callback to be executed when auto-rotating is disabled. It is fired when either the user manually rotates the camera, or the auto_rotate() method is executed again.
Source:

MoveCameraToPointCallback()

Callback to be executed when camera is finishes its moving animation. See move_camera_to_point() method
Source:

RotateCameraCallback()

Callback to be executed when camera is finishes its rotate animation. See rotate_camera() method
Source:

TrackToTargetCallback()

Callback to be executed when the camera finishes its track animation. See track_to_target() method.
Source:

TrackToTargetZoomCallback()

Callback to be executed when the camera finishes its zoom-in animation. See track_to_target() method.
Source: