Camera animation add-on.
Implements procedural animation for the camera.
- Source:
Summary
Methods
- auto_rotate(auto_rotate_ratio, callbackopt, disable_on_mouse_wheelopt)
- check_auto_rotate() → {boolean}
- is_auto_rotate() → {boolean}
- is_moving() → {boolean}
- is_rotating() → {boolean}
- move_camera_to_point(cam_obj, point_obj, cam_lin_speed, cam_angle_speed, cbopt)
- rotate_camera(cam_obj, angle_phi, angle_theta, timeopt, cbopt)
- stop_cam_moving()
- stop_cam_rotating()
- track_to_target(cam_obj, target, rot_speedopt, nullable, zoom_multopt, nullable, zoom_timeopt, nullable, zoom_delayopt, nullable, track_cbopt, nullable, zoom_in_cbopt, nullable)
Type Definitions
- AutoRotateDisabledCallback()
- MoveCameraToPointCallback()
- RotateCameraCallback()
- TrackToTargetCallback()
- TrackToTargetZoomCallback()
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 | Horizontal rotation angle (in radians) | ||
angle_theta |
number | Vertical rotation angle (in radians) | ||
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_cbopt, nullable, zoom_in_cbopt, nullable)
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 |
<optional> <nullable> |
Track finishing callback | |
zoom_in_cb |
TrackToTargetZoomCallback |
<optional> <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: