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.net.minecraft.world.phys.Vec3getHandRenderPos(net.minecraft.world.InteractionHand hand) Gets the position that the providedInteractionHandrenders at.org.joml.Matrix4fReturns the camera rotation for the givenRenderPassFor Gui, Mirror or Vanilla passes this returns the regular camera rotationstatic VRRenderingAPIinstance()Gets the API instance for interacting with Vivecraft for rendering.booleanReturns if the current render pass is the first render pass for this render cycle.booleanGets whether the current render pass is a vanilla render pass.voidsetupRenderingAtHand(net.minecraft.world.InteractionHand hand, com.mojang.blaze3d.vertex.PoseStack stack) Sets the providedPoseStackto render at the position of and with the rotation of the providedInteractionHand, this assumes the givenstackto be set to an identity.voidsetupRenderingAtHand(net.minecraft.world.InteractionHand hand, org.joml.Matrix4f matrix) Sets the providedMatrix4fto render at the position of and with the rotation of the providedInteractionHand, this assumes the givenmatrixto be 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
-
getRenderPassMatrix
Returns the camera rotation for the givenRenderPassFor Gui, Mirror or Vanilla passes this returns the regular camera rotation- Parameters:
pass- RenderPass to get the camera rotation for- Returns:
- The camera rotation for the given RenderPass
- Since:
- 1.3.0
-
getHandRenderPos
net.minecraft.world.phys.Vec3 getHandRenderPos(net.minecraft.world.InteractionHand hand) Gets the position that the providedInteractionHandrenders 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(net.minecraft.world.InteractionHand hand, com.mojang.blaze3d.vertex.PoseStack stack) Sets the providedPoseStackto render at the position of and with the rotation of the providedInteractionHand, this assumes the givenstackto 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(net.minecraft.world.InteractionHand hand, org.joml.Matrix4f matrix) Sets the providedMatrix4fto render at the position of and with the rotation of the providedInteractionHand, this assumes the givenmatrixto 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
-