mojira.dev
MC-306546

Extreme camera movement leads to floating-point precision loss and overflow in view angles.

Overview

Rotating the view by 5,599,994 full circles causes floating-point precision loss, resulting in stuttering when moving the view.
The test environment is completely vanilla Minecraft with no mods installed.

Actual Results

  1. View Offset: There is a significant discrepancy between where the player is looking and the actual view direction. In third-person perspective, the player model's orientation does not match the view direction. (Clearly visible in the video)

  2. Precision Loss: Moving the view horizontally becomes very difficult — small movements have no effect at all, likely due to float precision loss.

Affected Environments

  • Single-player mode

  • Multiplayer mode

This issue is nearly 100% reproducible across all Minecraft versions.

Reproduction Steps

  1. The C++ source code I used (TestCode.cpp) is attached. You can compile and run it yourself. This program only simulates mouse movement, contains no malicious code, and runs on Windows systems.

  2. Observe the phenomena: They match the description in Actual Results.

Root Cause Speculation (Personal Opinion)

  • If rotation exceeds 200,000 full circles, the float value overflows, leading to the phenomena described in Actual Results.

  • This value exceeds the maximum integer that floating-point numbers can precisely represent, causing severe floating-point precision loss and resulting in the abnormal phenomena described above.

Expected Results

View rotation (yaw/pitch angles) and player movement should function normally, without numerical overflow, freezing, or game crashes.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media]

COM1919

(Unassigned)

Unconfirmed

(Unassigned)

1.21.11

Retrieved