Interface VRAPI


public interface VRAPI
The main interface for interacting with Vivecraft from common code.
Since:
1.3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    getHistoricalVRPoses(Player player)
    Returns the history of VR poses for the player.
    getVRPose(Player player)
    Returns the VR pose for the given player.
    static VRAPI
     
    boolean
    isVRPlayer(Player player)
    Check whether a given player is currently in VR.
  • Method Details

    • instance

      static VRAPI instance()
      Returns:
      The Vivecraft API instance for interacting with Vivecraft's common API.
      Since:
      1.3.0
    • isVRPlayer

      boolean isVRPlayer(Player player)
      Check whether a given player is currently in VR.
      Parameters:
      player - The player to check the VR status of.
      Returns:
      true if the player is in VR.
      Since:
      1.3.0
    • getVRPose

      @Nullable VRPose getVRPose(Player player)
      Returns the VR pose for the given player. Will return null if the player isn't in VR, or if being called from the client and the client has yet to receive any data for the player.
      Parameters:
      player - Player to get the VR pose of.
      Returns:
      The VR pose for a player, or null if the player isn't in VR or no data has been received for said player.
      Since:
      1.3.0
    • getHistoricalVRPoses

      @Nullable VRPoseHistory getHistoricalVRPoses(Player player)
      Returns the history of VR poses for the player. If one only needs the history for the local player, this can be more conveniently called using VRClientAPI.getHistoricalVRPoses().
      Note that due to the inherent latency of networking, historical VR data retrieved either by the server or by the client for a client other than the local player may be unideal.
      Returns:
      The history of VR poses for the player. Will be null if the player isn't in VR or if VR-specific data hasn't been received.
      Since:
      1.3.0