Package org.vivecraft.api.client
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 TypeMethodDescriptionGets the current render pass.Vec3
getHandRenderPos
(InteractionHand hand) Gets the position that the providedInteractionHand
renders at.static VRRenderingAPI
instance()
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 providedMatrix4f
to render at the position of and with the rotation of the providedInteractionHand
, this assumes the givenmatrix
to be an identity.void
setupRenderingAtHand
(InteractionHand hand, PoseStack stack) Sets the providedPoseStack
to render at the position of and with the rotation of the providedInteractionHand
, this assumes the givenstack
to be set to an identity.
-
Method Details
-
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 providedInteractionHand
renders at. UnlikeVRPose.getHand(InteractionHand)
fromVRClientAPI.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 providedPoseStack
to render at the position of and with the rotation of the providedInteractionHand
, this assumes the givenstack
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 providedMatrix4f
to render at the position of and with the rotation of the providedInteractionHand
, this assumes the givenmatrix
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
-