mojira.dev

Dominexis

Assigned

No issues.

Reported

MCPE-172242 Adding and removing thousands of unique tags to an entity causes server to force shutdown Awaiting Response MCPE-170373 Server occasionally doesn't tick rigid entity collision, allowing player to "fall" through boats and shulkers Duplicate

Comments

This happens because of how matrix decomposition works. To convert from the matrix form to the decomposed form, it uses singular value decomposition (https://en.wikipedia.org/wiki/Singular_value_decomposition). This algorithm has multiple solutions. For any given matrix input, there are 24 configurations of the scale matrix by rearranging the values and flipping their signs. This means there is ambiguity in the output.

The two transformations provided in the description resolve to the following decomposed forms:

Transformation 1:

{left_rotation: [0.70710677f, 0.0f, 0.0f, -0.7071067f], translation: [0.0625f, 1.5406357f, 0.125f], right_rotation: [-0.4539905f, 0.0f, 0.0f, 0.89100665f], scale: [1.0000002f, 1.0000001f, 0.52447176f]}

Transformation 2:

{left_rotation: [1.0f, 0.0f, 0.0f, 9.860346E-7f], translation: [0.0625f, 1.5093317f, 0.125f], right_rotation: [-0.23344587f, 0.0f, 0.0f, -0.9723699f], scale: [1.0000002f, 0.5138151f, 1.0000002f]}

Focus on the scale component specifically, it is the most plain to see here. Despite the two transformations being very similar, the Y and Z components have switched around between the two transformations. When the game interpolates between these two transformations, it has to take a much longer path than would be visually expected in-game. In the context of an entire animation, it causes a "bounce" to occur at that frame.

A fix to this would be to have the decomposition take into account the previous transformation and choose the solution which is closest to it.