Package gaiasky.util.camera.rec
Class KeyframesManager
java.lang.Object
gaiasky.util.camera.rec.KeyframesManager
- All Implemented Interfaces:
IObserver
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
-
Field Summary
Modifier and TypeFieldDescriptionThe current camera path, used for direct playback.Reference to current camera orientation.static KeyframesManager
Singletonfinal com.badlogic.gdx.utils.Array
<Keyframe> Current keyframesReference to current camera position.Play state.Reference to current time.Reference to current camera orientation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks that all keyframe timings fall perfectly on a frame, so that t(kf) * FPS % 1 = 0 holds.void
clean()
Cleans the current configuration of keyframes.void
exportKeyframesFile
(com.badlogic.gdx.utils.Array<Keyframe> keyframes, String fileName) long
Gets the frame number of the given keyframe using the current target frame rate setting.static void
boolean
isIdle()
boolean
boolean
com.badlogic.gdx.utils.Array
<Keyframe> loadKeyframesFile
(Path file) void
Event notification call.void
pause()
Sets the manager in pause mode.void
play()
Sets the manager in play mode.void
Re-generates the camera path object from the current keyframes list.double[]
samplePaths
(com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<Vector3d>> pointsSep, double[] points, int samplesPerSegment, KeyframesManager.PathType pathType) void
saveKeyframesFile
(com.badlogic.gdx.utils.Array<Keyframe> keyframes, String fileName) void
skip
(long frame) Skips to the given frame.void
stepping()
Sets the manager in stepping mode.
-
Field Details
-
instance
Singleton -
keyframes
Current keyframes -
pos
Reference to current camera position. -
dir
Reference to current camera orientation. -
up
Reference to current camera orientation. -
t
Reference to current time. -
currentPath
The current camera path, used for direct playback. -
state
Play state.
-
-
Constructor Details
-
KeyframesManager
public KeyframesManager()
-
-
Method Details
-
initialize
public static void initialize() -
regenerateCameraPath
public void regenerateCameraPath()Re-generates the camera path object from the current keyframes list. -
clean
public void clean()Cleans the current configuration of keyframes. -
getFrameNumber
Gets the frame number of the given keyframe using the current target frame rate setting.- Parameters:
kf
- The keyframe.- Returns:
- The frame number corresponding to exactly this keyframe if the keyframe is valid and in the keyframes list, otherwise -1. The frame number is in [0,n-1].
-
loadKeyframesFile
- Throws:
RuntimeException
-
saveKeyframesFile
-
samplePaths
public double[] samplePaths(com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<Vector3d>> pointsSep, double[] points, int samplesPerSegment, KeyframesManager.PathType pathType) -
exportKeyframesFile
-
play
public void play()Sets the manager in play mode. -
isPlaying
public boolean isPlaying() -
pause
public void pause()Sets the manager in pause mode. -
isIdle
public boolean isIdle() -
stepping
public void stepping()Sets the manager in stepping mode. -
isStepping
public boolean isStepping() -
skip
public void skip(long frame) Skips to the given frame.- Parameters:
frame
- The frame number.
-
checkKeyframeTimings
public boolean checkKeyframeTimings()Checks that all keyframe timings fall perfectly on a frame, so that t(kf) * FPS % 1 = 0 holds.- Returns:
- True if the keyframe timings are consistent with the camcorder FPS setting.
-
notify
Description copied from interface:IObserver
Event notification call.
-