Class HKTimeline

java.lang.Object
com.biodigital.humansdk.HKTimeline

public class HKTimeline extends Object
Timeline object - for interacting with chapters and animations in a scene
  • Field Details

    • currentChapter

      public HKChapter currentChapter
      A map of chapter IDs to Chapter objects.
    • chapters

      public HashMap<String,HKChapter> chapters
      A map of chapter IDs to Chapter objects.
    • chapterList

      public ArrayList<String> chapterList
      An ordered list of chapter IDs
    • currentTime

      public double currentTime
      The current animation time
    • duration

      public double duration
      The current animation duration
    • playing

      public boolean playing
      true 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(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(String chapterId)
      Jump to the chapter with the given ID and play it in a loop
      Parameters:
      chapterId - ID of the chapter