forked from Automat-GH/minecrift
-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fishing bobber and line camera offset.
- Loading branch information
1 parent
27d6f9d
commit 11da27b
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
patches/net/minecraft/client/renderer/entity/RenderFish.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- a/net/minecraft/client/renderer/entity/RenderFish.java | ||
+++ b/net/minecraft/client/renderer/entity/RenderFish.java | ||
@@ -1,5 +1,8 @@ | ||
package net.minecraft.client.renderer.entity; | ||
|
||
+import de.fruitfly.ovr.structs.Matrix4f; | ||
+import de.fruitfly.ovr.structs.Vector3f; | ||
+import jopenvr.OpenVRUtil; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.renderer.Tessellator; | ||
import net.minecraft.entity.Entity; | ||
@@ -64,6 +67,21 @@ | ||
double var27 = p_76986_1_.angler.prevPosZ + (p_76986_1_.angler.posZ - p_76986_1_.angler.prevPosZ) * (double)p_76986_9_ + var22.zCoord; | ||
double var29 = p_76986_1_.angler == Minecraft.getMinecraft().thePlayer ? 0.0D : (double)p_76986_1_.angler.getEyeHeight(); | ||
|
||
+ // VIVE START - use controller for fishing rod start point | ||
+ if (p_76986_1_.angler == Minecraft.getMinecraft().thePlayer) | ||
+ { | ||
+ Vec3 aimSource = Minecraft.getMinecraft().lookaimController.getAimSource(0); | ||
+ Matrix4f aimRotation = Minecraft.getMinecraft().lookaimController.getAimRotation(0); | ||
+ //Matrix4f tilt = OpenVRUtil.rotationXMatrix((float)Math.PI * -0.0f); | ||
+ //aimRotation = Matrix4f.multiply(aimRotation, tilt); | ||
+ Vector3f forward = new Vector3f(0,0,1); | ||
+ Vector3f controllerDirection = aimRotation.transform(forward); | ||
+ var23 = aimSource.xCoord + controllerDirection.x * 0.28f; | ||
+ var25 = aimSource.yCoord - controllerDirection.y * 0.28f; | ||
+ var27 = aimSource.zCoord + controllerDirection.z * 0.28f; | ||
+ } | ||
+ // VIVE END - use controller for fishing rod start point | ||
+ | ||
if (this.renderManager.options.thirdPersonView > 0 || p_76986_1_.angler != Minecraft.getMinecraft().thePlayer) | ||
{ | ||
float var31 = (p_76986_1_.angler.prevRenderYawOffset + (p_76986_1_.angler.renderYawOffset - p_76986_1_.angler.prevRenderYawOffset) * p_76986_9_) * (float)Math.PI / 180.0F; |