Package com.biodigital.humansdk
Class HKTimeline
java.lang.Object
com.biodigital.humansdk.HKTimeline
public class HKTimeline
extends java.lang.Object
Timeline object - for interacting with chapters and animations in a scene
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<java.lang.String>
chapterList
An ordered list of chapter IDsjava.util.HashMap<java.lang.String,HKChapter>
chapters
A map of chapter IDs to Chapter objects.HKChapter
currentChapter
A map of chapter IDs to Chapter objects.double
currentTime
The current animation timedouble
duration
The current animation durationboolean
playing
true if the animation is currently playing -
Constructor Summary
Constructors Constructor Description HKTimeline()
-
Method Summary
Modifier and Type Method Description void
loop(java.lang.String chapterId)
Jump to the chapter with the given ID and play it in a loopvoid
moveToChapter(java.lang.String chapterId)
Jump to the chapter with the given IDvoid
moveToTime(double time)
Jump to the given time in the current scene's current animationvoid
nextChapter()
Jump to the next chaptervoid
pause()
Pause the animationvoid
play()
Play the animation from the beginningvoid
prevChapter()
Jump to the previous chaptervoid
unpause()
Unpause the animation
-
Field Details
-
currentChapter
A map of chapter IDs to Chapter objects. -
chapters
A map of chapter IDs to Chapter objects. -
chapterList
public java.util.ArrayList<java.lang.String> chapterListAn ordered list of chapter IDs -
currentTime
public double currentTimeThe current animation time -
duration
public double durationThe current animation duration -
playing
public boolean playingtrue if the animation is currently playing
-
-
Constructor Details
-
HKTimeline
public HKTimeline()
-
-
Method Details
-
play
public void play()Play the animation from the beginning -
pause
public void pause()Pause the animation -
unpause
public void unpause()Unpause the animation -
nextChapter
public void nextChapter()Jump to the next chapter -
prevChapter
public void prevChapter()Jump to the previous chapter -
moveToChapter
public void moveToChapter(java.lang.String chapterId)Jump to the chapter with the given ID- Parameters:
chapterId
- ID of the chapter
-
moveToTime
public void moveToTime(double time)Jump to the given time in the current scene's current animation- Parameters:
time
- animation offset in seconds
-
loop
public void loop(java.lang.String chapterId)Jump to the chapter with the given ID and play it in a loop- Parameters:
chapterId
- ID of the chapter
-