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
Modifier and TypeFieldDescriptionfinal DoubleArray
Contains the position (3), direction (3) and up (3) values for each step.double
Optional frame rate.long
Current step number.long
Number of steps in the current path.final com.badlogic.gdx.utils.Array
<Instant> Contains the time as a long timestamp for each step. -
Constructor Summary
ConstructorDescriptionCameraPath
(double targetFps) Create an empty camera path.CameraPath
(InputStream file) Create a camera path from a.gsc
file.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
Contains 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.gsc
file.- 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(Instant 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, as anInstant
.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
-