[3.x] FTI - Add custom interpolation for wheels#105816
[3.x] FTI - Add custom interpolation for wheels#105816lawnjelly merged 1 commit intogodotengine:3.xfrom
Conversation
fb406ad to
e531267
Compare
e531267 to
3813d03
Compare
|
Sorry about that faffing, I fixed the wheels to wraparound to prevent float error, and had to make some adjustments for the resets to work correctly. |
3813d03 to
d8a7359
Compare
|
Although the changes are pretty small to put in local space: I'm still not absolutely convinced we should change this. The other approach is faster, and I am wondering if we should change if there is evidence that it causes a problem for a user (we are trying to future proof and predict ahead of time user problems, although I do take your point that it is in a sense compat breaking, even there is no standard yet for wheels with FTI). It's also just as possible for the user to get local space by doing this calculation themselves (multiplying by inverse parent global xform) if they really needed it. On the other hand if we do change it now, then it makes it more difficult to warrant taking it out at a later stage. 🤔 Let me know what you think, I can easily change it back. |
|
While it's not the most common thing to access a wheel's local transform, I could imagine e.g. someone using Perhaps in the future wheels could be top-level by default and it could be documented that they only work as top-level. The middle ground of setting top-level dynamically would be annoying to document and understand, though the code would be more efficient. |
d8a7359 to
7a628db
Compare
|
I'll update the 4.x PR with the changes. BTW for future reference there are several implications to local space versus global space here:
More generally physics objects update their transforms via the global xform afaik, so to some extent multiplying by inverse parent xform is "pretending" that they are in local space, but maybe that makes it easier for users to understand. It also has implications for their interpolation "track", as interpolation takes place in local space. |
|
Thanks! |
Now the 3D FTI has been moved to scene side, we have the opportunity to finally fix wheel interpolation to cope with high speed rotation.
Fixes #72207
See #52846 (comment)
See #52846 (comment)
Description
Uses a somewhat "new" approach of managing the wheel interpolation from the vehicle rather than the wheels. This should be more efficient, and I don't think there should be any downsides. The vehicle is therefore set to the default
physics_interpolation_modeON and the wheels OFF, and the vehicle controls the wheels.Notes
m_rotationreaches high values.SceneTree#104269 is merged.resetsand also vehicles first entering the tree on the frame, where transform must be reset after the first physics tick (which is the first place an xform is available).This video is 10tps showing the new wheel interpolation. Texture added to wheels to make it easier to see.
2025-04-26.19-32-17.mp4
Discussion
This doesn't provide a general solution to the problem of phasing, it is specific to wheels. If we later do decide on a general solution, this solution can easily be replaced.