Skip to content

FTI - Add custom interpolation for wheels#105915

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
lawnjelly:fti_hotwheels4
Apr 30, 2025
Merged

FTI - Add custom interpolation for wheels#105915
Repiteo merged 1 commit intogodotengine:masterfrom
lawnjelly:fti_hotwheels4

Conversation

@lawnjelly
Copy link
Copy Markdown
Member

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
Forward port of #105816

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_mode ON and the wheels OFF, and the vehicle controls the wheels.

Notes

  • Adds bespoke interpolation code to cope with wheels rotating at more than 180 degrees per tick.
  • Now handles wrapping of the rotation to prevent float error once m_rotation reaches high values.
  • Custom wheel interpolation solutions are no longer required in games after this PR.
  • Handles resets and 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).

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.

@lawnjelly
Copy link
Copy Markdown
Member Author

Last push, changed to specify wheels in local space on the server rather than using top_level and global space, as requested by @rburing . See #105816 for details.

@lawnjelly
Copy link
Copy Markdown
Member Author

Rebased as there is some problem today with CI with static checks. No change to code.

@Repiteo Repiteo merged commit 2428db2 into godotengine:master Apr 30, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Apr 30, 2025

Thanks!

@lawnjelly lawnjelly deleted the fti_hotwheels4 branch April 30, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shrinking VehicleWheel when using physics interpolation

3 participants