Interface VRRenderingAPI


public interface VRRenderingAPI
The main interface for interacting with Vivecraft from rendering code. For other client-side code, one should use VRClientAPI.
Since:
1.3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the current render pass.
    Vec3
    getHandRenderPos(InteractionHand hand)
    Gets the position that the provided InteractionHand renders at.
    Gets the API instance for interacting with Vivecraft for rendering.
    boolean
    Returns if the current render pass is the first render pass for this render cycle.
    boolean
    Gets whether the current render pass is a vanilla render pass.
    void
    setupRenderingAtHand(InteractionHand hand, org.joml.Matrix4f matrix)
    Sets the provided Matrix4f to render at the position of and with the rotation of the provided InteractionHand, this assumes the given matrix to be an identity.
    void
    setupRenderingAtHand(InteractionHand hand, PoseStack stack)
    Sets the provided PoseStack to render at the position of and with the rotation of the provided InteractionHand, this assumes the given stack to be set to an identity.
  • Method Details

    • instance

      static VRRenderingAPI instance()
      Gets the API instance for interacting with Vivecraft for rendering.
      Returns:
      The Vivecraft API instance for interacting with Vivecraft's rendering API.
      Since:
      1.3.0
    • isVanillaRenderPass

      boolean isVanillaRenderPass()
      Gets whether the current render pass is a vanilla render pass. This method's return value is only valid if this method was called while rendering.
      Returns:
      Whether the current render pass is a vanilla render pass.
      Since:
      1.3.0
    • getCurrentRenderPass

      RenderPass getCurrentRenderPass()
      Gets the current render pass. This method's return value is only valid if this method was called while rendering.
      Returns:
      The current render pass Vivecraft is performing.
      Since:
      1.3.0
    • isFirstRenderPass

      boolean isFirstRenderPass()
      Returns if the current render pass is the first render pass for this render cycle. This method's return value is only valid if this method was called while rendering.
      Returns:
      Whether the current render pass is the first one performed for this render cycle.
      Since:
      1.3.0
    • getHandRenderPos

      Vec3 getHandRenderPos(InteractionHand hand)
      Gets the position that the provided InteractionHand renders at. Unlike VRPose.getHand(InteractionHand) from VRClientAPI.getWorldRenderPose(), this returns a reasonable, default value for seated mode.
      Parameters:
      hand - The hand to get the rendering position of.
      Returns:
      The rendering position for the provided hand.
      Since:
      1.3.0
    • setupRenderingAtHand

      void setupRenderingAtHand(InteractionHand hand, PoseStack stack)
      Sets the provided PoseStack to render at the position of and with the rotation of the provided InteractionHand, this assumes the given stack to be set to an identity.
      Parameters:
      hand - The hand to set the PoseStack to.
      stack - The PoseStack to be set.
      Since:
      1.3.0
    • setupRenderingAtHand

      void setupRenderingAtHand(InteractionHand hand, org.joml.Matrix4f matrix)
      Sets the provided Matrix4f to render at the position of and with the rotation of the provided InteractionHand, this assumes the given matrix to be an identity.
      Parameters:
      hand - The hand to set the Matrix4f to.
      matrix - The Matrix4f to be set.
      Since:
      1.3.0, Minecraft 1.20.5