Package gaiasky.util.camera.rec
Class CameraPath
java.lang.Object
gaiasky.util.camera.rec.CameraPath
Contains the in-memory data for a specific camera path.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DoubleArrayContains the position (3), direction (3) and up (3) values for each step.longCurrent step number.longNumber of steps in the current path.final com.badlogic.gdx.utils.LongArrayContains the time as a long timestamp for each step. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty camera path.CameraPath(com.badlogic.gdx.utils.Array<Keyframe> keyframes, KeyframesManager.PathPart[] posSplines) Create a camera path from a list of keyframes and its respective array of path parts.CameraPath(InputStream file) Create a camera path from a.gscfile. -
Method Summary
-
Field Details
-
n
public long nNumber of steps in the current path. -
times
public final com.badlogic.gdx.utils.LongArray timesContains the time as a long timestamp for each step. -
data
Contains the position (3), direction (3) and up (3) values for each step. -
i
public long iCurrent step number.
-
-
Constructor Details
-
CameraPath
public CameraPath()Create an empty camera path. -
CameraPath
Create a camera path from a.gscfile.- Parameters:
file- The file.- Throws:
RuntimeException- If the file can't be read, is not in the right format, or does not exist.
-
CameraPath
public CameraPath(com.badlogic.gdx.utils.Array<Keyframe> keyframes, KeyframesManager.PathPart[] posSplines) Create a camera path from a list of keyframes and its respective array of path parts.- Parameters:
keyframes- Array of keyframes.posSplines- Array of path parts.
-
-
Method Details
-
add
public void add(long time, double px, double py, double pz, double dx, double dy, double dz, double ux, double uy, double uz) Add a new time step at the end of the path.- Parameters:
time- The time, in milliseconds.px- The x-position.py- The y-position.pz- The z-position.dx- The x-direction.dy- The y-direction.dz- The z-direction.ux- The x-up.uy- The y-up.uz- The z-up.
-
persist
Persist the current camera path to the file pointed by the given path.- Parameters:
f- The path of the file.- Returns:
- True if the persist operation succeeded.
- Throws:
IOException- If the path does not point to a file, or the file could not be written.Exception
-