Hi everyone, i recently fixed the bug when riding a dragon that would cause the camera to be used as an xray passing through the blocks below, basing from rideable vanilla mobs like horse or pigs they orient the camera by using raytraceresult and subtract the distance from behind hence reducing the zoom dist thus fixing xray, their parameters are filled with rarely used methods what are their purposes?
for (int i = 0; i < 8; ++i) // max thirdPersonDistance = 4 so 8 is a X 2 version?
{
float f3 = (float)((i & 1) * 2 - 1); // is 2 half of thirdPersonDistance?
float f4 = (float)((i >> 1 & 1) * 2 - 1); // what the point of 1?
float f5 = (float)((i >> 2 & 1) * 2 - 1);
f3 = f3 * 0.1F; // why are they converted to 10 %?
f4 = f4 * 0.1F;
f5 = f5 * 0.1F;
RayTraceResult raytraceresult = this.mc.world.rayTraceBlocks(new Vec3d(d0 + (double)f3, d1 + (double)f4, d2 + (double)f5), new Vec3d(d0 - d4 + (double)f3 + (double)f5, d1 - d6 + (double)f4, d2 - d5 + (double)f5));
Their purpose might help improve my xray fix. It isnt perfect XD