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>chapterListAn ordered list of chapter IDsjava.util.HashMap<java.lang.String,HKChapter>chaptersA map of chapter IDs to Chapter objects.HKChaptercurrentChapterA map of chapter IDs to Chapter objects.doublecurrentTimeThe current animation timedoubledurationThe current animation durationbooleanplayingtrue if the animation is currently playing -
Constructor Summary
Constructors Constructor Description HKTimeline() -
Method Summary
Modifier and Type Method Description voidloop(java.lang.String chapterId)Jump to the chapter with the given ID and play it in a loopvoidmoveToChapter(java.lang.String chapterId)Jump to the chapter with the given IDvoidmoveToTime(double time)Jump to the given time in the current scene's current animationvoidnextChapter()Jump to the next chaptervoidpause()Pause the animationvoidplay()Play the animation from the beginningvoidprevChapter()Jump to the previous chaptervoidunpause()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
-