Skip to content

Commit

Permalink
Fix fishing bobber and line camera offset.
Browse files Browse the repository at this point in the history
  • Loading branch information
Automat-GH committed Mar 20, 2016
1 parent 27d6f9d commit 11da27b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions patches/net/minecraft/client/renderer/entity/RenderFish.java.patch
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;

0 comments on commit 11da27b

Please sign in to comment.