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.doubleOptional frame rate.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
ConstructorsConstructorDescriptionCameraPath(double targetFps) Create an empty camera path.CameraPath(InputStream file) Create a camera path from a.gscfile.CameraPath(List<Keyframe> keyframes, KeyframesManager.PathPart[] posSplines) Create a camera path from a list of keyframes and its respective array of path parts. -
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. -
frameRate
public double frameRateOptional frame rate. If < 0, it is considered uncapped. -
i
public long iCurrent step number.
-
-
Constructor Details
-
CameraPath
public CameraPath(double targetFps) 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
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.- Throws:
RuntimeException- If the path does not point to a file, or the file could not be written.Exception
-