Class CameraModule
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe interactive camera module, to manipulate the camera in interactive mode.Fields inherited from class APIModule
api, em, logger, me, nameModifier and TypeFieldDescriptionprotected final APIv2Reference to API object.protected final EventManagerReference to event manager.protected final Logger.Logprotected final APIModuleReference to self.protected final StringModule name. -
Constructor Summary
ConstructorsConstructorDescriptionCameraModule(EventManager em, APIv2 api, String name) Create a new module with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidcenter()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.voidcenter_focus(boolean center) Set the center focus property of the camera.protected voidchangeFocus(FocusView object, NaturalCamera cam, double waitTimeSeconds) Internal method to change the current camera focus object.voiddispose()Method called whenever the module is disposed.voidfocus_mode(com.badlogic.ashley.core.Entity entity, float waitTimeSeconds) Set the camera in focus mode, and sets the focus object to the givenEntity.voidfocus_mode(String name) Set the camera in focus mode with the focus object identified by the givenfocusName.voidfocus_mode(String name, float wait) Set the camera in focus mode with the focus object identified by the givenfocusName.voidfocus_mode(String focusName, int waitTimeSeconds) voidfocus_mode_instant(String name) Set the camera in focus mode with the focus object identified by the givenfocusName.voidfocus_mode_instant_go(String name) Set the camera in focus mode with the focus object identified by the givenfocusName.voidfocus_mode_instant_go(String focusName, boolean sleep) Alias tofocus_mode_instant(String), but with an extra boolean parameter (for internal use) that makes sure that the camera changes are flushed before returning.voidSet the camera in free mode.Return the closest object to the camera in this instant as aIFocus.double[]Get the current camera direction vector.doubleget_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.doubleget_fov()Return the (vertical) 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.voidgo_to_object(com.badlogic.ashley.core.Entity object, double positionDurationSeconds, double orientationDurationSeconds, boolean sync) voidgo_to_object(com.badlogic.ashley.core.Entity object, double solidAngle, double positionDurationSeconds, double orientationDurationSeconds, boolean sync) voidgo_to_object(com.badlogic.ashley.core.Entity object, double solidAngle, double positionDurationSeconds, double orientationDurationSeconds, boolean sync, AtomicBoolean stop) voidgo_to_object(String name, double positionDurationSeconds, double ori_duration) Move the camera to the object identified by the given name, internally using smooth camera transition calls, likeCameraAPI.transition(double[], double[], double[], double).voidgo_to_object(String name, double positionDurationSeconds, double ori_duration, boolean sync) Same asCameraAPI.go_to_object(String, double, double), but with a boolean that indicates whether the call is synchronous.voidgo_to_object(String name, double sa, double pos_duration, double ori_duration) Same asCameraAPI.go_to_object(String, double, double), but with the target solid angle of the object.voidgo_to_object(String name, double sa, double pos_duration, double ori_duration, boolean sync) Same asCameraAPI.go_to_object(String, double, double, boolean), but with the target solid angle of the object.voidgo_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.voidEvent notification call.voidpoint_at_equatorial(double ra, double dec) Set the camera in free mode and points it to the given coordinates in equatorial system.voidpoint_at_sky_coordinate(long ra, long dec) voidRemove the tracking object from the camera, if any.voidset_direction(double[] direction) Set the camera direction vector to the given vector, in the internal reference system.voidset_direction(double[] dir, boolean immediate) Set the camera direction vector to the given vector, in the internal reference system.voidset_direction(List<?> dir) voidset_direction(List<?> dir, boolean immediate) Alias forset_direction(double[], boolean).voidset_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.voidset_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.voidset_focus_lock(boolean lock) Activates or deactivates the camera lock to the focus reference system when in focus mode.voidset_fov(float fov) Set the (vertical) field of view of the perspective matrix of the camera, in degrees.voidset_fov(int newFov) voidset_max_speed(int index) Set the maximum speed of the camera as an index pointing to a pre-set value.voidset_orientation_lock(boolean lock) Lock or unlock the orientation of the camera to the focus object's rotation.voidset_orientation_quaternion(double[] quaternion) Set the camera orientation to the given quaternion, given as an array of [x, y, z, w].voidset_orientation_quaternion(List<?> quaternion) voidset_position(double[] pos) Set the camera position to the given coordinates, in the internal reference system and kilometres.voidset_position(double[] pos, boolean immediate) Set the camera position to the given coordinates, in the internal reference system and kilometres.voidset_position(double[] dir, String units) Set the camera position to the given coordinates, in the internal reference system and the given units.voidset_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.voidset_position(double x, double y, double z) Component-wise version ofCameraAPI.set_position(double[]).voidset_position(double x, double y, double z, boolean immediate) Component-wise version ofCameraAPI.set_position(double[], boolean).voidset_position(double x, double y, double z, String units) Component-wise version ofCameraAPI.set_position(double[], String).voidset_position(double x, double y, double z, String units, boolean immediate) Component-wise version ofCameraAPI.set_position(double[], String, boolean).voidset_position(List<?> vec) Alias forset_position(double[]).voidset_position(List<?> vec, boolean immediate) Alias forset_position(double[], boolean).voidset_position(List<?> vec, String units) voidset_position(List<Double> position, String units, boolean immediate) Alias forset_position(double[], String, boolean).voidset_position_and_focus(String name, String other, double rot, double solidAngle) Set the focus and instantly moves the camera to a point in the line defined byfocus-otherand rotatedrotationdegrees aroundfocususing the camera up vector as a rotation axis.voidset_position_and_focus(String focus, String other, long rotation, long solidAngle) voidset_state(double[] pos, double[] dir, double[] up) Set the camera state (position, direction and up vector).voidvoidset_state_and_time(double[] pos, double[] dir, double[] up, long time) Set the camera state (position, direction and up vector) plus the current time.voidset_state_and_time(List<?> pos, List<?> dir, List<?> up, long time) voidset_tracking_object(String name) Set the camera to track the object with the given name.voidset_up(double[] up) Set the camera up vector to the given vector, in the internal reference system.voidset_up(double[] up, boolean immediate) Set the camera up vector to the given vector, in the internal reference system.voidvoidvoidstop()Stop all camera motion.voidtransition(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.voidtransition(double[] pos, double[] dir, double[] camUp, 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.voidtransition(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.voidtransition(double[] camPos, double[] camDir, double[] camUp, long seconds) voidtransition(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.voidtransition(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.voidtransition(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.voidtransition(double[] camPos, String units, double[] camDir, double[] camUp, double positionDurationSeconds, String positionSmoothType, double positionSmoothFactor, double orientationDurationSeconds, String orientationSmoothType, double orientationSmoothFactor, boolean sync, AtomicBoolean stop) voidtransition(double[] camPos, String units, double[] camDir, double[] camUp, long seconds) voidtransition(List<?> camPos, String units, List<?> camDir, List<?> camUp, double seconds) voidtransition(List<?> camPos, String units, List<?> camDir, List<?> camUp, double seconds, boolean sync) voidtransition(List<?> camPos, String units, List<?> camDir, List<?> camUp, double positionDurationSeconds, String positionSmoothType, double positionSmoothFactor, double orientationDurationSeconds, String orientationSmoothType, double orientationSmoothFactor, boolean sync) voidtransition(List<?> camPos, String units, List<?> camDir, List<?> camUp, long seconds) voidtransition(List<?> camPos, String units, List<?> camDir, List<?> camUp, long seconds, boolean sync) voidtransition(List<?> camPos, List<?> camDir, List<?> camUp, double seconds) voidtransition(List<?> camPos, List<?> camDir, List<?> camUp, double seconds, boolean sync) voidtransition(List<?> camPos, List<?> camDir, List<?> camUp, double seconds, String positionSmoothType, double positionSmoothFactor, String orientationSmoothType, double orientationSmoothFactor) voidtransition(List<?> camPos, List<?> camDir, List<?> camUp, long seconds) voidtransition(List<?> camPos, List<?> camDir, List<?> camUp, long seconds, boolean sync) voidtransition_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.voidtransition_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.voidtransition_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.voidtransition_km(double[] pos, double[] dir, double[] up, double duration) Same asCameraAPI.transition(double[], double[], double[], double)but the camera position is given in Km.voidtransition_km(List<?> camPos, List<?> camDir, List<?> camUp, double seconds) voidtransition_km(List<?> camPos, List<?> camDir, List<?> camUp, long seconds) voidtransition_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.voidtransition_orientation(double[] camDir, double[] camUp, double duration, String smooth_type, double smooth_factor, boolean sync, AtomicBoolean stop) voidtransition_orientation(List<?> camDir, List<?> camUp, double durationSeconds, String smoothType, double smoothFactor, boolean sync) voidtransition_position(double[] pos, String units, double duration, String smoothType, 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.voidtransition_position(double[] camPos, String units, double duration, String smooth_type, double smooth_factor, boolean sync, AtomicBoolean stop) voidtransition_position(List<?> camPos, String units, double durationSeconds, String smoothType, double smoothFactor, boolean sync) booleanwait_focus(String name, long timeout) This method blocks until the focus is the object indicated by the name.
-
Field Details
-
interactive
The interactive camera module, to manipulate the camera in interactive mode.
-
-
Constructor Details
-
CameraModule
Create a new module with the given attributes.- Parameters:
em- Reference to the event manager.api- Reference to the API class.name- Name of the module.
-
-
Method Details
-
focus_mode
Description copied from interface:CameraAPISet 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.- Specified by:
focus_modein interfaceCameraAPI- Parameters:
name- The name of the new focus object.
-
focus_mode
Description copied from interface:CameraAPISet the camera in focus mode with the focus object identified by the givenfocusName. Additionally,waitTimeSecondscontains 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.- Specified by:
focus_modein interfaceCameraAPI- 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
public void focus_mode(com.badlogic.ashley.core.Entity entity, float waitTimeSeconds) Set the camera in focus mode, and sets the focus object to the givenEntity. Additionally,waitTimeSecondscontains 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:
entity- Reference to the new focusEntity.waitTimeSeconds- 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
-
focus_mode_instant
Description copied from interface:CameraAPISet the camera in focus mode with the focus object identified by the givenfocusName. This call is different fromCameraAPI.focus_mode(String)in that the camera direction vector is set to point towards the focus object instantly.- Specified by:
focus_mode_instantin interfaceCameraAPI- Parameters:
name- The name of the new focus object.
-
focus_mode_instant_go
Description copied from interface:CameraAPISet the camera in focus mode with the focus object identified by the givenfocusName. This call is different fromCameraAPI.focus_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.- Specified by:
focus_mode_instant_goin interfaceCameraAPI- Parameters:
name- The name of the new focus object.
-
focus_mode_instant_go
Alias tofocus_mode_instant(String), but with an extra boolean parameter (for internal use) that makes sure that the camera changes are flushed before returning. -
changeFocus
Internal method to change the current camera focus object.This method checks if the object is the current focus of the given camera. If it is not, it sets it as focus and waits for the transaction to commit, if necessary.
- Parameters:
object- The new focus object.cam- The current camera.waitTimeSeconds- Max time to wait for the camera to face the focus, in seconds. If negative, we wait until the end.
-
wait_focus
Description copied from interface:CameraAPIThis 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.- Specified by:
wait_focusin interfaceCameraAPI- 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
public void set_focus_lock(boolean lock) Description copied from interface:CameraAPIActivates or deactivates the camera lock to the focus reference system when in focus mode.- Specified by:
set_focus_lockin interfaceCameraAPI- Parameters:
lock- Activate or deactivate the lock.
-
center_focus
public void center_focus(boolean center) Description copied from interface:CameraAPISet 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
CameraAPI.free_mode()to set the camera in free mode.- Specified by:
center_focusin interfaceCameraAPI- Parameters:
center- Whether to center the focus or not.
-
stop
-
center
public void center()Description copied from interface:CameraAPICenter 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
CameraAPI.focus_mode(String). -
free_mode
-
set_position
public void set_position(double[] pos) Description copied from interface:CameraAPISet 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, useCameraAPI.set_position(double[], boolean), with the boolean set totrue.- Specified by:
set_positionin interfaceCameraAPI- Parameters:
pos- Vector of three components in internal coordinates and Km.
-
set_position
public void set_position(double x, double y, double z) Description copied from interface:CameraAPIComponent-wise version ofCameraAPI.set_position(double[]).- Specified by:
set_positionin interfaceCameraAPI
-
set_position
Description copied from interface:CameraAPIComponent-wise version ofCameraAPI.set_position(double[], String).- Specified by:
set_positionin interfaceCameraAPI
-
set_position
public void set_position(double x, double y, double z, boolean immediate) Description copied from interface:CameraAPIComponent-wise version ofCameraAPI.set_position(double[], boolean).- Specified by:
set_positionin interfaceCameraAPI
-
set_position
Description copied from interface:CameraAPIComponent-wise version ofCameraAPI.set_position(double[], String, boolean).- Specified by:
set_positionin interfaceCameraAPI
-
set_position
Alias forset_position(double[], boolean). -
set_position
public void set_position(double[] pos, boolean immediate) Description copied from interface:CameraAPISet the camera position to the given coordinates, in the internal reference system and kilometres. Theimmediateparameter 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.- Specified by:
set_positionin interfaceCameraAPI- 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
Description copied from interface:CameraAPISet the camera position to the given coordinates, in the internal reference system and in the requested units. Theimmediateparameter 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.- Specified by:
set_positionin interfaceCameraAPI- 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
Alias forset_position(double[], String, boolean). -
get_position
public double[] get_position()Description copied from interface:CameraAPIGet the current camera position, in km.- Specified by:
get_positionin interfaceCameraAPI- Returns:
- The camera position coordinates in the internal reference system, in km.
-
get_position
Description copied from interface:CameraAPIGet the current camera position, in the requested units.- Specified by:
get_positionin interfaceCameraAPI- 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
Description copied from interface:CameraAPISet 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, useCameraAPI.set_position(double[], boolean), with the boolean set totrue.- Specified by:
set_positionin interfaceCameraAPI- 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_position
Alias forset_position(double[]). -
set_position
-
set_direction
Alias forset_direction(double[], boolean). -
set_direction
public void set_direction(double[] dir, boolean immediate) Description copied from interface:CameraAPISet the camera direction vector to the given vector, in the internal reference system. Theimmediateparameter 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.- Specified by:
set_directionin interfaceCameraAPI- 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
public double[] get_direction()Description copied from interface:CameraAPIGet the current camera direction vector.- Specified by:
get_directionin interfaceCameraAPI- Returns:
- The camera direction vector in the internal reference system.
-
set_direction
public void set_direction(double[] direction) Description copied from interface:CameraAPISet 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)
CameraAPI.set_direction(double[], boolean), with the boolean set totrue.- Specified by:
set_directionin interfaceCameraAPI- Parameters:
direction- The direction vector in equatorial cartesian coordinates.
-
-
set_direction_equatorial
public void set_direction_equatorial(double ra, double dec) Description copied from interface:CameraAPICreate 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.- Specified by:
set_direction_equatorialin interfaceCameraAPI- Parameters:
ra- The right ascension, in decimal degrees.dec- The declination, in decimal degrees.
-
set_direction_galactic
public void set_direction_galactic(double l, double b) Description copied from interface:CameraAPICreate 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.- Specified by:
set_direction_galacticin interfaceCameraAPI- Parameters:
l- The galactic longitude, in decimal degrees.b- The galactic latitude, in decimal degrees.
-
set_direction
-
set_up
-
set_up
public void set_up(double[] up, boolean immediate) Description copied from interface:CameraAPISet the camera up vector to the given vector, in the internal reference system. Theimmediateparameter 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. -
get_up
-
set_up
public void set_up(double[] up) Description copied from interface:CameraAPISet 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, useCameraAPI.set_up(double[], boolean), with the boolean set totrue. -
set_up
-
set_state
public void set_state(double[] pos, double[] dir, double[] up) Description copied from interface:CameraAPISet the camera state (position, direction and up vector). -
set_state
-
set_state_and_time
public void set_state_and_time(double[] pos, double[] dir, double[] up, long time) Description copied from interface:CameraAPISet the camera state (position, direction and up vector) plus the current time.- Specified by:
set_state_and_timein interfaceCameraAPI- 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).
-
set_state_and_time
-
set_orientation_quaternion
public void set_orientation_quaternion(double[] quaternion) Description copied from interface:CameraAPISet the camera orientation to the given quaternion, given as an array of [x, y, z, w].- Specified by:
set_orientation_quaternionin interfaceCameraAPI- Parameters:
quaternion- The 4-component quaternion.
-
set_orientation_quaternion
-
get_orientation_quaternion
public double[] get_orientation_quaternion()Description copied from interface:CameraAPIGet the current camera orientation quaternion.- Specified by:
get_orientation_quaternionin interfaceCameraAPI- Returns:
- The current camera orientation quaternion, as an array of [x, y, z, w].
-
set_position_and_focus
Description copied from interface:CameraAPISet the focus and instantly moves the camera to a point in the line defined byfocus-otherand rotatedrotationdegrees aroundfocususing the camera up vector as a rotation axis.- Specified by:
set_position_and_focusin interfaceCameraAPI- 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.solidAngle- The target solid angle which determines the distance, in degrees.
-
set_position_and_focus
-
point_at_equatorial
public void point_at_equatorial(double ra, double dec) Description copied from interface:CameraAPISet the camera in free mode and points it to the given coordinates in equatorial system.- Specified by:
point_at_equatorialin interfaceCameraAPI- Parameters:
ra- Right ascension in degrees.dec- Declination in degrees.
-
point_at_sky_coordinate
public void point_at_sky_coordinate(long ra, long dec) -
go_to_object_instant
Description copied from interface:CameraAPISet the camera in focus mode with the given focus object and instantly moves the camera next to the focus object.- Specified by:
go_to_object_instantin interfaceCameraAPI- Parameters:
name- The name of the new focus object.
-
go_to_object
Description copied from interface:CameraAPIMove the camera to the object identified by the given name, internally using smooth camera transition calls, likeCameraAPI.transition(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.- Specified by:
go_to_objectin interfaceCameraAPI- Parameters:
name- The name of the object to go to.positionDurationSeconds- The duration of the transition in position, in seconds.ori_duration- The duration of the transition in orientation, in seconds.
-
go_to_object
Description copied from interface:CameraAPISame asCameraAPI.go_to_object(String, double, double), but with the target solid angle of the object.- Specified by:
go_to_objectin interfaceCameraAPI- 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
public void go_to_object(String name, double positionDurationSeconds, double ori_duration, boolean sync) Description copied from interface:CameraAPISame asCameraAPI.go_to_object(String, double, double), but with a boolean that indicates whether the call is synchronous.- Specified by:
go_to_objectin interfaceCameraAPI- Parameters:
name- The name of the object to go to.positionDurationSeconds- 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
public void go_to_object(String name, double sa, double pos_duration, double ori_duration, boolean sync) Description copied from interface:CameraAPISame asCameraAPI.go_to_object(String, double, double, boolean), but with the target solid angle of the object.- Specified by:
go_to_objectin interfaceCameraAPI- 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.
-
go_to_object
public void go_to_object(com.badlogic.ashley.core.Entity object, double positionDurationSeconds, double orientationDurationSeconds, boolean sync) -
go_to_object
public void go_to_object(com.badlogic.ashley.core.Entity object, double solidAngle, double positionDurationSeconds, double orientationDurationSeconds, boolean sync) -
go_to_object
public void go_to_object(com.badlogic.ashley.core.Entity object, double solidAngle, double positionDurationSeconds, double orientationDurationSeconds, boolean sync, AtomicBoolean stop) -
get_distance_to_object
Description copied from interface:CameraAPIReturn 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.- Specified by:
get_distance_to_objectin interfaceCameraAPI- 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.
-
set_max_speed
public void set_max_speed(int index) Description copied from interface:CameraAPISet 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
- Specified by:
set_max_speedin interfaceCameraAPI- Parameters:
index- The index of the maximum speed setting.
-
set_tracking_object
Description copied from interface:CameraAPISet 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.- Specified by:
set_tracking_objectin interfaceCameraAPI- Parameters:
name- The name of the new tracking object.
-
remove_tracking_object
public void remove_tracking_object()Description copied from interface:CameraAPIRemove the tracking object from the camera, if any.- Specified by:
remove_tracking_objectin interfaceCameraAPI
-
set_orientation_lock
public void set_orientation_lock(boolean lock) Description copied from interface:CameraAPILock or unlock the orientation of the camera to the focus object's rotation.- Specified by:
set_orientation_lockin interfaceCameraAPI- Parameters:
lock- Whether to lock or unlock the camera orientation to the focus.
-
get_closest_object
Description copied from interface:CameraAPIReturn the closest object to the camera in this instant as aIFocus.- Specified by:
get_closest_objectin interfaceCameraAPI- Returns:
- The closest object to the camera.
-
set_fov
public void set_fov(float fov) Description copied from interface:CameraAPISet the (vertical) field of view of the perspective matrix of the camera, in degrees.- Specified by:
set_fovin interfaceCameraAPI- Parameters:
fov- The new field of view value in degrees, betweenConstants.MIN_FOVandConstants.MAX_FOV.
-
get_fov
-
set_fov
public void set_fov(int newFov) -
transition_km
public void transition_km(double[] pos, double[] dir, double[] up, double duration) Description copied from interface:CameraAPISame asCameraAPI.transition(double[], double[], double[], double)but the camera position is given in Km.- Specified by:
transition_kmin interfaceCameraAPI- 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_km
-
transition_km
-
transition
public void transition(double[] pos, double[] dir, double[] up, double duration) Description copied from interface:CameraAPICreate 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.
- Specified by:
transitionin interfaceCameraAPI- 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
Description copied from interface:CameraAPICreate 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.
- Specified by:
transitionin interfaceCameraAPI- 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
public void transition(double[] camPos, double[] camDir, double[] camUp, long seconds) -
transition
public void transition(double[] camPos, String units, double[] camDir, double[] camUp, long seconds) -
transition
-
transition
-
transition
-
transition
-
transition
public void transition(double[] pos, double[] dir, double[] camUp, double duration, boolean sync) Description copied from interface:CameraAPICreate 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.
- Specified by:
transitionin interfaceCameraAPI- Parameters:
pos- The target camera position in the internal reference system.dir- The target camera direction in the internal reference system.camUp- 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
public void transition(double[] pos, String units, double[] dir, double[] up, double duration, boolean sync) Description copied from interface:CameraAPICreate 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.
- Specified by:
transitionin interfaceCameraAPI- 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
-
transition
public 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) Description copied from interface:CameraAPICreate 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.
- Specified by:
transitionin interfaceCameraAPI- 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
-
transition
public 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) Description copied from interface:CameraAPICreate 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.
- Specified by:
transitionin interfaceCameraAPI- 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
public void transition(double[] camPos, String units, double[] camDir, double[] camUp, double positionDurationSeconds, String positionSmoothType, double positionSmoothFactor, double orientationDurationSeconds, String orientationSmoothType, double orientationSmoothFactor, boolean sync, AtomicBoolean stop) -
transition_position
public void transition_position(double[] pos, String units, double duration, String smoothType, double smooth_factor, boolean sync) Description copied from interface:CameraAPICreate 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.
- Specified by:
transition_positionin interfaceCameraAPI- 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.smoothType- 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_position
public void transition_position(double[] camPos, String units, double duration, String smooth_type, double smooth_factor, boolean sync, AtomicBoolean stop) -
transition_orientation
public void transition_orientation(double[] dir, double[] up, double duration, String smooth_type, double smooth_factor, boolean sync) Description copied from interface:CameraAPICreate 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.
- Specified by:
transition_orientationin interfaceCameraAPI- 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_orientation
public void transition_orientation(double[] camDir, double[] camUp, double duration, String smooth_type, double smooth_factor, boolean sync, AtomicBoolean stop) -
transition
-
transition
-
transition
-
transition
-
transition_orientation
-
transition_position
-
transition_fov
public void transition_fov(double target_fov, double duration) Description copied from interface:CameraAPICreate 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.
- Specified by:
transition_fovin interfaceCameraAPI- Parameters:
target_fov- The target FOV angle.duration- The duration of the transition, in seconds.
-
transition_fov
public void transition_fov(double target_fov, double duration, String smooth_type, double smooth_factor) Description copied from interface:CameraAPICreate 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.
- Specified by:
transition_fovin interfaceCameraAPI- 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). This is ignored ifsmooth_typeis"none".
-
transition_fov
public void transition_fov(double target_fov, double duration, String smooth_type, double smooth_factor, boolean sync) Description copied from interface:CameraAPICreate 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).
- Specified by:
transition_fovin interfaceCameraAPI- 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). This is ignored ifsmooth_typeis"none".sync- If true, the call waits for the transition to finish before returning, otherwise it returns immediately.
-
dispose
-
notify
-