Interface Tracker

All Known Subinterfaces:
ItemInUseTracker

public interface Tracker
A tracker is an object that is run for the local player during the game tick or before rendering a frame only if they are in VR. Using trackers is one of the cleanest ways to interact with Vivecraft's data, it's how Vivecraft itself does. Trackers should generally use VRClientAPI.getPreTickWorldPose() when using the Tracker.ProcessType.PER_TICK process type and VRClientAPI.getWorldRenderPose() when using the Tracker.ProcessType.PER_FRAME process type, as this provides the most up-to-date data and relevant data. Furthermore, other methods such as VRClientAPI.getPostTickWorldPose() or VRAPI.getVRPose(Player) may not have data available when the tracker is run.
Since:
1.3.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The process type used for processing trackers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activeProcess(LocalPlayer player)
    Called for the local player if this tracker is active, which is when isActive(LocalPlayer) returns true.
    default void
    idleProcess(LocalPlayer player)
    Called for the local player, whether the tracker is active or not.
    default void
    inactiveProcess(LocalPlayer player)
    Called to reset this tracker's state.
    boolean
    isActive(LocalPlayer player)
    Whether the tracker is active for the local player.
    The process type for this tracker.
  • Method Details

    • processType

      Tracker.ProcessType processType()
      The process type for this tracker. Determines when and how frequently it is Processed. See Tracker.ProcessType for possible options.
      Returns:
      The process type this tracker should use.
      Since:
      1.3.0
    • isActive

      boolean isActive(@Nullable LocalPlayer player)
      Whether the tracker is active for the local player.
      Parameters:
      player - Player being checked if they are active for this tracker instance. Will be null when not in a world.
      Returns:
      true if the tracker is active for the specified player.
      Since:
      1.3.0
    • idleProcess

      default void idleProcess(@Nullable LocalPlayer player)
      Called for the local player, whether the tracker is active or not. This is called before activeProcess(LocalPlayer), inactiveProcess(LocalPlayer), and isActive(LocalPlayer) are called.
      Parameters:
      player - Player to do an idle process for. Will be null when not in a world.
      Since:
      1.3.0
    • activeProcess

      void activeProcess(@Nullable LocalPlayer player)
      Called for the local player if this tracker is active, which is when isActive(LocalPlayer) returns true.
      Parameters:
      player - Player to run this tracker for, which is the local player. Will be null when not in a world. Only null if isActive(LocalPlayer) also got null.
      Since:
      1.3.0
    • inactiveProcess

      default void inactiveProcess(@Nullable LocalPlayer player)
      Called to reset this tracker's state. This is called whenever isActive(LocalPlayer) returns false.
      Parameters:
      player - The local player. Will be null when not in a world. Only null if isActive(LocalPlayer) also got null.
      Since:
      1.3.0