- Description
- Method Summary
- Method Details
- focus_mode(String)
- focus_mode(String, float)
- focus_mode_instant(String)
- focus_mode_instant_go(String)
- wait_focus(String, long)
- set_focus_lock(boolean)
- center_focus(boolean)
- set_orientation_lock(boolean)
- free_mode()
- set_position(double[])
- set_position(double[], boolean)
- set_position(double[], String, boolean)
- set_position(double, double, double)
- set_position(double, double, double, String)
- set_position(double, double, double, boolean)
- set_position(double, double, double, String, boolean)
- get_position()
- get_position(String)
- set_position(double[], String)
- set_direction(double[], boolean)
- get_direction()
- set_direction(double[])
- set_direction_equatorial(double, double)
- set_direction_galactic(double, double)
- set_up(double[], boolean)
- get_up()
- set_up(double[])
- set_orientation_quaternion(double[])
- get_orientation_quaternion()
- set_position_and_focus(String, String, double, double)
- point_at_equatorial(double, double)
- go_to_object_instant(String)
- go_to_object(String, double, double)
- go_to_object(String, double, double, double)
- go_to_object(String, double, double, boolean)
- go_to_object(String, double, double, double, boolean)
- get_distance_to_object(String)
- stop()
- center()
- set_max_speed(int)
- set_tracking_object(String)
- remove_tracking_object()
- get_closest_object()
- set_fov(float)
- get_fov()
- set_state(double[], double[], double[])
- set_state_and_time(double[], double[], double[], long)
- transition(double[], double[], double[], double)
- transition(double[], String, double[], double[], double)
- transition_km(double[], double[], double[], double)
- transition(double[], double[], double[], double, boolean)
- transition(double[], String, double[], double[], double, boolean)
- transition(double[], double[], double[], double, String, double, double, String, double)
- transition(double[], String, double[], double[], double, String, double, double, String, double, boolean)
- transition_position(double[], String, double, String, double, boolean)
- transition_orientation(double[], double[], double, String, double, boolean)
- transition_fov(double, double)
- transition_fov(double, double, String, double)
- transition_fov(double, double, String, double, boolean)
Interface CameraAPI
- All Known Implementing Classes:
CameraModule
CameraModule
.
The camera module contains methods and calls that modify and query the camera.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
center()
Center the camera so that its direction vector is aligned with the direction to the focus object, removing any deviation of the line of sight.void
center_focus
(boolean center) Set the center focus property of the camera.void
focus_mode
(String name) Set the camera in focus mode with the focus object identified by the givenfocusName
.void
focus_mode
(String name, float wait) Set the camera in focus mode with the focus object identified by the givenfocusName
.void
focus_mode_instant
(String name) Set the camera in focus mode with the focus object identified by the givenfocusName
.void
focus_mode_instant_go
(String name) Set the camera in focus mode with the focus object identified by the givenfocusName
.void
Set the camera in free mode.Return the closest object to the camera in this instant as aIFocus
.double[]
Get the current camera direction vector.double
get_distance_to_object
(String name) Return the distance from the current postion of the camera to the surface of the object identified with the givenname
.double
get_fov()
Return the current camera field of view angle, in degrees.double[]
Get the current camera orientation quaternion.double[]
Get the current camera position, in km.double[]
get_position
(String units) Get the current camera position, in the requested units.double[]
get_up()
Get the current camera up vector.void
go_to_object
(String name, double pos_duration, double ori_duration) Move the camera to the object identified by the given name, internally using smooth camera transition calls, liketransition(double[], double[], double[], double)
.void
go_to_object
(String name, double pos_duration, double ori_duration, boolean sync) Same asgo_to_object(String, double, double)
, but with a boolean that indicates whether the call is synchronous.void
go_to_object
(String name, double sa, double pos_duration, double ori_duration) Same asgo_to_object(String, double, double)
, but with the target solid angle of the object.void
go_to_object
(String name, double sa, double pos_duration, double ori_duration, boolean sync) Same asgo_to_object(String, double, double, boolean)
, but with the target solid angle of the object.void
go_to_object_instant
(String name) Set the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.void
point_at_equatorial
(double ra, double dec) Set the camera in free mode and points it to the given coordinates in equatorial system.void
Remove the tracking object from the camera, if any.void
set_direction
(double[] dir) Set the camera direction vector to the given vector, in the internal reference system.void
set_direction
(double[] dir, boolean immediate) Set the camera direction vector to the given vector, in the internal reference system.void
set_direction_equatorial
(double ra, double dec) Create a smooth camera orientation transition from the current camera orientation to the given sky coordinates, in equatorial coordinates.void
set_direction_galactic
(double l, double b) Create a smooth camera orientation transition from the current camera orientation to the given sky coordinates, in galactic coordinates.void
set_focus_lock
(boolean lock) Activates or deactivates the camera lock to the focus reference system when in focus mode.void
set_fov
(float fov) Set the field of view of the perspective matrix of the camera, in degrees.void
set_max_speed
(int index) Set the maximum speed of the camera as an index pointing to a pre-set value.void
set_orientation_lock
(boolean lock) Lock or unlock the orientation of the camera to the focus object's rotation.void
set_orientation_quaternion
(double[] q) Set the camera orientation to the given quaternion, given as an array of [x, y, z, w].void
set_position
(double[] pos) Set the camera position to the given coordinates, in the internal reference system and kilometres.void
set_position
(double[] pos, boolean immediate) Set the camera position to the given coordinates, in the internal reference system and kilometres.void
set_position
(double[] dir, String units) Set the camera position to the given coordinates, in the internal reference system and the given units.void
set_position
(double[] pos, String units, boolean immediate) Set the camera position to the given coordinates, in the internal reference system and in the requested units.void
set_position
(double x, double y, double z) Component-wise version ofset_position(double[])
.void
set_position
(double x, double y, double z, boolean immediate) Component-wise version ofset_position(double[], boolean)
.void
set_position
(double x, double y, double z, String units) Component-wise version ofset_position(double[], String)
.void
set_position
(double x, double y, double z, String units, boolean immediate) Component-wise version ofset_position(double[], String, boolean)
.void
set_position_and_focus
(String name, String other, double rot, double sa) Set the focus and instantly moves the camera to a point in the line defined byfocus
-other
and rotatedrotation
degrees aroundfocus
using the camera up vector as a rotation axis.void
set_state
(double[] pos, double[] dir, double[] up) Set the camera state (position, direction and up vector).void
set_state_and_time
(double[] pos, double[] dir, double[] up, long time) Set the camera state (position, direction and up vector) plus the current time.void
set_tracking_object
(String name) Set the camera to track the object with the given name.void
set_up
(double[] up) Set the camera up vector to the given vector, in the internal reference system.void
set_up
(double[] up, boolean immediate) Set the camera up vector to the given vector, in the internal reference system.void
stop()
Stop all camera motion.void
transition
(double[] pos, double[] dir, double[] up, double duration) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds.void
transition
(double[] pos, double[] dir, double[] up, double duration, boolean sync) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds.void
transition
(double[] pos, double[] dir, double[] up, double pos_duration, String pos_smooth_type, double pos_smooth_factor, double ori_duration, String ori_smooth_type, double ori_smooth_factor) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp}, with the given duration, in seconds.void
transition
(double[] pos, String units, double[] dir, double[] up, double duration) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds.void
transition
(double[] pos, String units, double[] dir, double[] up, double duration, boolean sync) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds.void
transition
(double[] pos, String units, double[] dir, double[] up, double pos_duration, String pos_smooth_type, double pos_smooth_factor, double ori_duration, String ori_smooth_type, double ori_smooth_factor, boolean sync) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp}, with the given duration, in seconds.void
transition_fov
(double target_fov, double duration) Create a smooth transition from the current camera field of view angle (FOV) to the given target FOV, with the given duration, in seconds.void
transition_fov
(double target_fov, double duration, String smooth_type, double smooth_factor) Create a smooth transition from the current camera field of view angle (FOV) to the given target FOV, with the given duration, in seconds.void
transition_fov
(double target_fov, double duration, String smooth_type, double smooth_factor, boolean sync) Create a smooth transition from the current camera field of view angle (FOV) to the given target FOV, with the given duration, in seconds.void
transition_km
(double[] pos, double[] dir, double[] up, double duration) Same astransition(double[], double[], double[], double)
but the camera position is given in Km.void
transition_orientation
(double[] dir, double[] up, double duration, String smooth_type, double smooth_factor, boolean sync) Create a smooth transition from the current camera orientation to the given camera orientation {camDir, camUp}, with the given duration, in seconds.void
transition_position
(double[] pos, String units, double duration, String smooth_type, double smooth_factor, boolean sync) Create a smooth transition from the current camera position to the given camera position, with the given duration, in seconds.boolean
wait_focus
(String name, long timeout) This method blocks until the focus is the object indicated by the name.
-
Method Details
-
focus_mode
Set the camera in focus mode with the focus object identified by the givenfocusName
. It returns immediately, i.e., it does not wait for the camera direction to finish the transition that makes it point to the new focus object.- Parameters:
name
- The name of the new focus object.
-
focus_mode
Set the camera in focus mode with the focus object identified by the givenfocusName
. Additionally,waitTimeSeconds
contains the amount of time, in seconds, to wait for the camera transition that makes it point to the new focus object to finish. If the transition has not finished after this amount of time, the call returns. If the transition finishes before this amount of time, it returns immediately after finishing.- Parameters:
name
- The name of the new focus object.wait
- Maximum time, in seconds, to wait for the camera to face the focus. If negative, the call waits until the camera transition is finished.
-
focus_mode_instant
Set the camera in focus mode with the focus object identified by the givenfocusName
. This call is different fromfocus_mode(String)
in that the camera direction vector is set to point towards the focus object instantly.- Parameters:
name
- The name of the new focus object.
-
focus_mode_instant_go
Set the camera in focus mode with the focus object identified by the givenfocusName
. This call is different fromfocus_mode(String)
in that the camera is moved to the vicinity of the focus object instantly, and its direction vector is set to point towards the focus object, also instantly.- Parameters:
name
- The name of the new focus object.
-
wait_focus
This method blocks until the focus is the object indicated by the name. There is an optional timeout time, given in milliseconds. If the focus has not been acquired after this timeout, the call returns.- Parameters:
name
- The name of the focus to wait for.timeout
- Timeout to wait, in milliseconds. Set negative to use no timeout.- Returns:
- True if the timeout triggered the return. False otherwise.
-
set_focus_lock
void set_focus_lock(boolean lock) Activates or deactivates the camera lock to the focus reference system when in focus mode.- Parameters:
lock
- Activate or deactivate the lock.
-
center_focus
void center_focus(boolean center) Set the center focus property of the camera. If set totrue
, the camera centers the focus in view. If set tofalse
, the camera does not seek to center the focus object, leaving the camera in a 'free view' state.Note that the camera is in focus mode, so its movement is determined by the focus object. 'Free view' state and free mode are not the same thing. Use
free_mode()
to set the camera in free mode.- Parameters:
center
- Whether to center the focus or not.
-
set_orientation_lock
void set_orientation_lock(boolean lock) Lock or unlock the orientation of the camera to the focus object's rotation.- Parameters:
lock
- Whether to lock or unlock the camera orientation to the focus.
-
free_mode
void free_mode()Set the camera in free mode. -
set_position
void set_position(double[] pos) Set the camera position to the given coordinates, in the internal reference system and kilometres. The default behavior of this method posts a runnable to update the camera after the current frame. If you need to call this method from within a parked runnable, useset_position(double[], boolean)
, with the boolean set totrue
.- Parameters:
pos
- Vector of three components in internal coordinates and Km.
-
set_position
void set_position(double[] pos, boolean immediate) Set the camera position to the given coordinates, in the internal reference system and kilometres. Theimmediate
parameter enables setting the camera state immediately without waiting for the possible current update operation to finish. Set this to true if you run this function from within a parked runnable.- Parameters:
pos
- Vector of three components in internal coordinates and Km.immediate
- Whether to apply the changes immediately, or wait for the next frame.
-
set_position
Set the camera position to the given coordinates, in the internal reference system and in the requested units. Theimmediate
parameter enables setting the camera state immediately without waiting for the possible current update operation to finish. Set this to true if you run this function from within a parked runnable.- Parameters:
pos
- Vector of three components in internal coordinates and the requested units.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".immediate
- Whether to apply the changes immediately, or wait for the next frame.
-
set_position
void set_position(double x, double y, double z) Component-wise version ofset_position(double[])
. -
set_position
Component-wise version ofset_position(double[], String)
. -
set_position
void set_position(double x, double y, double z, boolean immediate) Component-wise version ofset_position(double[], boolean)
. -
set_position
Component-wise version ofset_position(double[], String, boolean)
. -
get_position
double[] get_position()Get the current camera position, in km.- Returns:
- The camera position coordinates in the internal reference system, in km.
-
get_position
Get the current camera position, in the requested units.- Parameters:
units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".- Returns:
- The camera position coordinates in the internal reference system and in the requested units.
-
set_position
Set the camera position to the given coordinates, in the internal reference system and the given units. The default behavior of this method posts a runnable to update the camera after the current frame. If you need to call this method from within a parked runnable, useset_position(double[], boolean)
, with the boolean set totrue
.- Parameters:
dir
- Vector of three components in internal coordinates and the given units.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".
-
set_direction
void set_direction(double[] dir, boolean immediate) Set the camera direction vector to the given vector, in the internal reference system. Theimmediate
parameter enables setting the camera state immediately without waiting for the possible current update operation to finish. Set this to true if you run this function from within a parked runnable.- Parameters:
dir
- The direction vector in the internal reference system.immediate
- Whether to apply the changes immediately, or wait for the next frame.
-
get_direction
double[] get_direction()Get the current camera direction vector.- Returns:
- The camera direction vector in the internal reference system.
-
set_direction
void set_direction(double[] dir) Set the camera direction vector to the given vector, in the internal reference system.You can convert from spherical coordinates using the following methods:
-
RefsysAPI.equatorial_cartesian_to_internal(double[], double)
-
RefsysAPI.galactic_to_cartesian(double, double, double)
-
RefsysAPI.ecliptic_to_cartesian(double, double, double)
set_direction(double[], boolean)
, with the boolean set totrue
.- Parameters:
dir
- The direction vector in equatorial cartesian coordinates.
-
-
set_direction_equatorial
void set_direction_equatorial(double ra, double dec) Create a smooth camera orientation transition from the current camera orientation to the given sky coordinates, in equatorial coordinates. This method sets the camera in free mode.- Parameters:
ra
- The right ascension, in decimal degrees.dec
- The declination, in decimal degrees.
-
set_direction_galactic
void set_direction_galactic(double l, double b) Create a smooth camera orientation transition from the current camera orientation to the given sky coordinates, in galactic coordinates. This method sets the camera in free mode.- Parameters:
l
- The galactic longitude, in decimal degrees.b
- The galactic latitude, in decimal degrees.
-
set_up
void set_up(double[] up, boolean immediate) Set the camera up vector to the given vector, in the internal reference system. Theimmediate
parameter enables setting the camera state immediately without waiting for the possible current update operation to finish. Set this to true if you run this function from within a parked runnable.- Parameters:
up
- The up vector in equatorial coordinates.immediate
- Whether to apply the changes immediately, or wait for the next frame.
-
get_up
double[] get_up()Get the current camera up vector.- Returns:
- The camera up vector in the internal reference system.
-
set_up
void set_up(double[] up) Set the camera up vector to the given vector, in the internal reference system. The default behavior of this method posts a runnable to update the camera after the current frame. If you need to call this method from within a parked runnable, useset_up(double[], boolean)
, with the boolean set totrue
.- Parameters:
up
- The up vector in equatorial coordinates.
-
set_orientation_quaternion
void set_orientation_quaternion(double[] q) Set the camera orientation to the given quaternion, given as an array of [x, y, z, w].- Parameters:
q
- The 4-component quaternion.
-
get_orientation_quaternion
double[] get_orientation_quaternion()Get the current camera orientation quaternion.- Returns:
- The current camera orientation quaternion, as an array of [x, y, z, w].
-
set_position_and_focus
Set the focus and instantly moves the camera to a point in the line defined byfocus
-other
and rotatedrotation
degrees aroundfocus
using the camera up vector as a rotation axis.- Parameters:
name
- The name of the focus object.other
- The name of the other object, to the fine a line from this to focus. Usually a light source.rot
- The rotation angle, in degrees.sa
- The target solid angle which determines the distance, in degrees.
-
point_at_equatorial
void point_at_equatorial(double ra, double dec) Set the camera in free mode and points it to the given coordinates in equatorial system.- Parameters:
ra
- Right ascension in degrees.dec
- Declination in degrees.
-
go_to_object_instant
Set the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.- Parameters:
name
- The name of the new focus object.
-
go_to_object
Move the camera to the object identified by the given name, internally using smooth camera transition calls, liketransition(double[], double[], double[], double)
. The target position and orientation are computed first during the call execution and are not subsequently updated. This means that the camera does not follow the object if it moves. If time is activated, and the object moves, this call does not go to the object's current position at the end, but at the beginning.- Parameters:
name
- The name of the object to go to.pos_duration
- The duration of the transition in position, in seconds.ori_duration
- The duration of the transition in orientation, in seconds.
-
go_to_object
Same asgo_to_object(String, double, double)
, but with the target solid angle of the object.- Parameters:
name
- The name of the object to go to.sa
- The target solid angle of the object, in degrees. This is used to compute the final distance to the object. The angle gets larger and larger as we approach the object.pos_duration
- The duration of the transition in position, in seconds.ori_duration
- The duration of the transition in orientation, in seconds.
-
go_to_object
Same asgo_to_object(String, double, double)
, but with a boolean that indicates whether the call is synchronous.- Parameters:
name
- The name of the object to go to.pos_duration
- The duration of the transition in position, in seconds.ori_duration
- The duration of the transition in orientation, in seconds.sync
- If true, the call is synchronous and waits for the camera file to finish. Otherwise, it returns immediately.
-
go_to_object
Same asgo_to_object(String, double, double, boolean)
, but with the target solid angle of the object.- Parameters:
name
- The name of the object to go to.sa
- The target solid angle of the object, in degrees. This is used to compute the final distance to the object. The angle gets larger and larger as we approach the object.pos_duration
- The duration of the transition in position, in seconds.ori_duration
- The duration of the transition in orientation, in seconds.sync
- If true, the call is synchronous and waits for the camera file to finish. Otherwise, it returns immediately.
-
get_distance_to_object
Return the distance from the current postion of the camera to the surface of the object identified with the givenname
. If the object is an abstract node or does not exist, it returns a negative distance.- Parameters:
name
- The name or id (HIP, TYC, sourceId) of the object.- Returns:
- The distance to the object in km if it exists, a negative value otherwise.
-
stop
void stop()Stop all camera motion. -
center
void center()Center the camera so that its direction vector is aligned with the direction to the focus object, removing any deviation of the line of sight. Useful to center the focus object again after turning.This method only has effect if the camera is in
focus_mode(String)
. -
set_max_speed
void set_max_speed(int index) Set the maximum speed of the camera as an index pointing to a pre-set value. The index corresponds to one of the following values:- 1 Km/h
- 10 Km/h
- 100 Km/h
- 1000 Km/h
- 1 Km/s
- 10 Km/s
- 100 Km/s
- 1000 Km/s
- 0.01 c
- 0.1 c
- 0.5 c
- 0.8 c
- 0.9 c
- 0.99 c
- 0.99999 c
- 1 c
- 2 c
- 10 c
- 1e3 c
- 1 AU/s
- 10 AU/s
- 1000 AU/s
- 10000 AU/s
- 1 pc/s
- 2 pc/s
- 10 pc/s
- 1000 pc/s
- unlimited
- Parameters:
index
- The index of the maximum speed setting.
-
set_tracking_object
Set the camera to track the object with the given name. In this mode, the position of the camera is still dependent on the focus object (if any), but its direction points to the tracking object.- Parameters:
name
- The name of the new tracking object.
-
remove_tracking_object
void remove_tracking_object()Remove the tracking object from the camera, if any. -
get_closest_object
-
set_fov
void set_fov(float fov) Set the field of view of the perspective matrix of the camera, in degrees.- Parameters:
fov
- The new field of view value in degrees, betweenConstants.MIN_FOV
andConstants.MAX_FOV
.
-
get_fov
double get_fov()Return the current camera field of view angle, in degrees.- Returns:
- The current camera field of view angle, in degrees.
-
set_state
void set_state(double[] pos, double[] dir, double[] up) Set the camera state (position, direction and up vector).- Parameters:
pos
- The position of the camera in internal units, not Km.dir
- The direction of the camera.up
- The up vector of the camera.
-
set_state_and_time
void set_state_and_time(double[] pos, double[] dir, double[] up, long time) Set the camera state (position, direction and up vector) plus the current time.- Parameters:
pos
- The position of the camera in internal units, not Km.dir
- The direction of the camera.up
- The up vector of the camera.time
- The new time of the camera as the number of milliseconds since the epoch (Jan 1, 1970).
-
transition
void transition(double[] pos, double[] dir, double[] up, double duration) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds. This function waits for the transition to finish and then returns control to the script.This function will put the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system.dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.duration
- The duration of the transition in seconds.
-
transition
Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds. This function waits for the transition to finish and then returns control to the script.This function will put the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system and the given distance units.units
- The distance units to use. One of "m", "km", "AU", "ly", "pc", "internal".dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.duration
- The duration of the transition in seconds.
-
transition_km
void transition_km(double[] pos, double[] dir, double[] up, double duration) Same astransition(double[], double[], double[], double)
but the camera position is given in Km.- Parameters:
pos
- The target camera position in Km.dir
- The target camera direction vector.up
- The target camera up vector.duration
- The duration of the transition in seconds.
-
transition
void transition(double[] pos, double[] dir, double[] up, double duration, boolean sync) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds. Optionally, the transition may be run synchronously or asynchronously to the current script.This function will put the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system.dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.duration
- The duration of the transition in seconds.sync
- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-
transition
void transition(double[] pos, String units, double[] dir, double[] up, double duration, boolean sync) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp} with the given duration, in seconds. Optionally, the transition may be run synchronously or asynchronously to the current script.This function will put the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system and the given distance units.units
- The distance units to use. One of "m", "km", "AU", "ly", "pc", "internal".dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.duration
- The duration of the transition in seconds.sync
- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-
transition
void transition(double[] pos, double[] dir, double[] up, double pos_duration, String pos_smooth_type, double pos_smooth_factor, double ori_duration, String ori_smooth_type, double ori_smooth_factor) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp}, with the given duration, in seconds.This function accepts smoothing types and factors for the position and orientation.
This function will put the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system and the given distance units.dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.pos_duration
- The duration of the transition in position, in seconds.pos_smooth_type
- The function type to use for the smoothing of positions. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
pos_smooth_factor
- Smooth factor for the positions (depends on type).ori_duration
- The duration of the transition in orientation, in seconds.ori_smooth_type
- The function type to use for the smoothing of orientations. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
ori_smooth_factor
- Smooth factor for the orientations (depends on type).
-
transition
void transition(double[] pos, String units, double[] dir, double[] up, double pos_duration, String pos_smooth_type, double pos_smooth_factor, double ori_duration, String ori_smooth_type, double ori_smooth_factor, boolean sync) Create a smooth transition from the current camera state to the given camera state {camPos, camDir, camUp}, with the given duration, in seconds.This function accepts smoothing types and factors for the position and orientation.
Optionally, this call may return immediately (async) or it may wait for the transition to finish (sync).
This function puts the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system and the given distance units.units
- The distance units to use. One of "m", "km", "AU", "ly", "pc", "internal".dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.pos_duration
- The duration of the transition in position, in seconds.pos_smooth_type
- The function type to use for the smoothing of positions. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
pos_smooth_factor
- Smooth factor for the positions (depends on type).ori_duration
- The duration of the transition in orientation, in seconds.ori_smooth_type
- The function type to use for the smoothing of orientations. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
ori_smooth_factor
- Smooth factor for the orientations (depends on type).sync
- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-
transition_position
void transition_position(double[] pos, String units, double duration, String smooth_type, double smooth_factor, boolean sync) Create a smooth transition from the current camera position to the given camera position, with the given duration, in seconds.This function accepts smoothing type and factor.
Optionally, this call may return immediately (async) or it may wait for the transition to finish (sync).
This function puts the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
pos
- The target camera position in the internal reference system and the given distance units.units
- The distance units to use. One of "m", "km", "AU", "ly", "pc", "internal".duration
- The duration of the transition in position, in seconds.smooth_type
- The function type to use for the smoothing of positions. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
smooth_factor
- Smooth factor for the positions (depends on type).sync
- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-
transition_orientation
void transition_orientation(double[] dir, double[] up, double duration, String smooth_type, double smooth_factor, boolean sync) Create a smooth transition from the current camera orientation to the given camera orientation {camDir, camUp}, with the given duration, in seconds.This function accepts smoothing type and factor.
Optionally, this call may return immediately (async) or it may wait for the transition to finish (sync).
This function puts the camera in free mode, so make sure to change it afterward if you need to. Also, this only works with the natural camera.
- Parameters:
dir
- The target camera direction in the internal reference system.up
- The target camera up in the internal reference system.duration
- The duration of the transition in orientation, in seconds.smooth_type
- The function type to use for the smoothing of orientations. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
smooth_factor
- Smooth factor for the orientations (depends on type).sync
- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-
transition_fov
void transition_fov(double target_fov, double duration) Create a smooth transition from the current camera field of view angle (FOV) to the given target FOV, with the given duration, in seconds.This call is synchronous, i.e., returns only after the transition has finished.
- Parameters:
target_fov
- The target FOV angle.duration
- The duration of the transition, in seconds.
-
transition_fov
Create a smooth transition from the current camera field of view angle (FOV) to the given target FOV, with the given duration, in seconds.This function accepts smoothing type and factor.
This call is synchronous, i.e., returns only after the transition has finished.
- Parameters:
target_fov
- The target FOV angle.duration
- The duration of the transition, in seconds.smooth_type
- The function type to use for the smoothing. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
smooth_factor
- Smoothing factor (depends on type).
-
transition_fov
void transition_fov(double target_fov, double duration, String smooth_type, double smooth_factor, boolean sync) Create a smooth transition from the current camera field of view angle (FOV) to the given target FOV, with the given duration, in seconds.This function accepts smoothing type and factor.
Optionally, this call may return immediately (async) or it may wait for the transition to finish (sync).
- Parameters:
target_fov
- The target FOV angle.duration
- The duration of the transition, in seconds.smooth_type
- The function type to use for the smoothing. Either "logit", "logisticsigmoid" or "none".- "logisticsigmoid": starts slow and ends slow. The smooth factor must be over 12 to produce an effect, otherwise, linear interpolation is used.
- "logit": starts fast and ends fast. The smooth factor must be between 0.09 and 0.01.
- "none": no smoothing is applied.
smooth_factor
- Smoothing factor (depends on type).sync
- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-