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
IKConstraint produces NaN (formerly [ue4] Meshes disappear) #903
Comments
Not a spine-c problem, works in Cocos2d-X runtime. |
Can reproduce in test scene playing |
Getting NaN's in vertex positions for back_downskirt in last frame of death animation! |
Bone data for |
It's a bug in path constraint, constraint |
Seems to be a bug in IKConstraint, produces NaNs for rotation. |
|
Turns out IKConstraint produces a NaN. In the reference implementation, the NaN gets eliminated by accident and not distributed throughout the whole skeleton update. In spine-c using MSVC++, the code takes a different path, resulting in NaN's everywhere. This needs to be fixed in all runtimes. @NathanSweet please take a look. Here is the repro:
The C implementation enters the body in line 255 (line number in ref impl), so the NaN is assigned to In the reference implementation, the first two if statements after line 250 are not evaluated, so As a quickfix i detect if Mhhhhh, NaN. |
Fix in C implementation https://gist.github.com/badlogic/dfc9d397cd9cc85d4e30374008572a54 |
It should not be possible for a NaN returned from ACOS to escape IkConstraint:
It is a bit odd for the IK algorithm to rely on NaN, but the above should work across all languages. Before adding a NaN check, I'd like to understand how |
Can't rely on IEEE 754 NaN behavior in C. Sad. Might as well avoid trig/NaN in all runtimes. |
See this forum thread plus email from Frank Staff for repro files http://esotericsoftware.com/forum/Problem-exporting-in-Unreal-8555?p=38913&hilit=unreal#p38913
The text was updated successfully, but these errors were encountered: