-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physics interpolation seems to break Sprite2D #93586
Comments
I checked out the mrp and this issue seems to be caused by that fact that transform interpolation isn't implemented correctly. The following unit test fails (values are copied from the transform of row 2, column 2 in the mrp): TEST_CASE("[TransformInterpolator] Skewed Transform -- prev == cur") {
Transform2D skewed = Transform2D(Vector2(1.f, 0.f), Vector2(-0.766044676f,0.642787337f), Vector2(0.f, 0.f));
Transform2D result = Transform2D();
TransformInterpolator::interpolate_transform_2d(skewed, skewed, result, 0.f);
CHECK(result == skewed);
}
I know the test shouldn't be checking for equality because of floating point error, but clearly the second column of the result transform is incorrect. |
Ah sorry I missed this, can reproduce in 3.x. Great issue, the order of operations is likely the wrong way around in the interpolator (a while since I did this, but I suspect copy pasted from elsewhere in the engine). It may not have been reported before in 3.x because we don't have a skew and it is rarely used. Will see if I can fix this up before 3.6 RC 1. 👍 EDIT: I'll likely copy paste the fixed @rburing looks like you can fix in 4.x with this:
(I put |
If I'd be happy to put up the PR for this |
Tested versions
Reproducible in both 4.3 betas and current master.
System information
Godot v4.3.dev (4a01602) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 Threads)
Issue description
It seems like a number of scenarios break
Sprite2D
at runtime when enabling physics interpolation.skew
seems to be ignored entirely,rotation
andscale
work by themselves, but not when used together with a non-proportional scale value.Steps to reproduce
In the screenshots below,
Sprite2D
properties.skew
only.rotation
only.rotation
and a non-proportionalscale
value.Besides that, it's a fresh empty project without a single line of code (MRP included below).
Setup inside the editor (looks as expected):
At runtime, physics interpolation OFF (looks as expected):
At runtime, physics interpolation ON (broken):
Minimal reproduction project (MRP)
SpriteBugMRP.zip
Enable physics interpolation on/off in
Project Settings > Physics > Common (Advanced Settings)
. Note that you might have to run the project, close it, and run it again every time you change the setting for it to take effect.The text was updated successfully, but these errors were encountered: