Mojira Archive
MC-30845

Camera is glitching through tall grass, sea grass, and kelp in F5 (third-person) mode

The bug

When a player walks through a block which is transparent or translucent in some way, the third-person camera forces the viewport to not exceed the internal boundary of the object, blocking the view until the player leaves the block which encases their head. This visibly affects all tall plants, the Nether portal block, and presumably anything else which is a non-opaque block but doesn't fully block the player's motion. This would make sense if the blocks were physically solid, but you can easily walk through sugar cane or grass.

Steps to reproduce

  1. Switch view to third-person
  2. Walk into a certain block (such as tall grass)
    → Notice what happens to the camera
  3. Walk out of the block
    → Notice how the camera is now at the maximum viewing position again

Video

Fix proposal

A simple fix for this would be to make F5 ignore blocks with no bounding box. Currently the method EntityRenderer.orientCamera(partialTicks) calls the method World.rayTraceBlocks(Vec3d, Vec3d) to find the surrounding blocks. World also has the method rayTraceBlocks(Vec3d, Vec3d, stopOnLiquid, ignoreBlocksWithoutBoundingBox, returnLastUncollidableBlocks) that could be used instead.