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 IDs
    java.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 time
    double duration
    The current animation duration
    boolean 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 loop
    void moveToChapter​(java.lang.String chapterId)
    Jump to the chapter with the given ID
    void moveToTime​(double time)
    Jump to the given time in the current scene's current animation
    void nextChapter()
    Jump to the next chapter
    void pause()
    Pause the animation
    void play()
    Play the animation from the beginning
    void prevChapter()
    Jump to the previous chapter
    void unpause()
    Unpause the animation

    Methods inherited from class java.lang.Object

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

    • currentChapter

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

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

      public java.util.ArrayList<java.lang.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

  • 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