Package org.vivecraft.api.client
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 ClassesModifier and TypeInterfaceDescriptionstatic enum
The process type used for processing trackers. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activeProcess
(LocalPlayer player) Called for the local player if this tracker is active, which is whenisActive(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. SeeTracker.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 benull
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 beforeactiveProcess(LocalPlayer)
,inactiveProcess(LocalPlayer)
, andisActive(LocalPlayer)
are called.- Parameters:
player
- Player to do an idle process for. Will benull
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 whenisActive(LocalPlayer)
returns true.- Parameters:
player
- Player to run this tracker for, which is the local player. Will benull
when not in a world. Onlynull
ifisActive(LocalPlayer)
also gotnull
.- Since:
- 1.3.0
-
inactiveProcess
default void inactiveProcess(@Nullable LocalPlayer player) Called to reset this tracker's state. This is called wheneverisActive(LocalPlayer)
returns false.- Parameters:
player
- The local player. Will benull
when not in a world. Onlynull
ifisActive(LocalPlayer)
also gotnull
.- Since:
- 1.3.0
-