Class CameraPath

java.lang.Object
gaiasky.util.camera.rec.CameraPath

public class CameraPath extends Object
Contains the in-memory data for a specific camera path.
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    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 Link icon

    Constructors
    Constructor
    Description
    CameraPath(double targetFps)
    Create an empty camera path.
    Create a camera path from a .gsc file.
    Create a camera path from a list of keyframes and its respective array of path parts.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    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.
    void
    Persist the current camera path to the file pointed by the given path.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details Link icon

    • n Link icon

      public long n
      Number of steps in the current path.
    • times Link icon

      public final com.badlogic.gdx.utils.Array<Instant> times
      Contains the time as a long timestamp for each step.
    • data Link icon

      public final DoubleArray data
      Contains the position (3), direction (3) and up (3) values for each step.
    • frameRate Link icon

      public double frameRate
      Optional frame rate. If < 0, it is considered uncapped.
    • i Link icon

      public long i
      Current step number.
  • Constructor Details Link icon

    • CameraPath Link icon

      public CameraPath(double targetFps)
      Create an empty camera path.
    • CameraPath Link icon

      public CameraPath(InputStream file) throws RuntimeException
      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 Link icon

      public CameraPath(List<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 Link icon

    • add Link icon

      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 an Instant.
      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 Link icon

      public void persist(Path f) throws Exception
      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