Jump to content

Recommended Posts

Posted (edited)

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

Edited by TheRPGAdventurer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.