[3.x] Physics Interpolation - Add 3D helper for using servers directly.#104518
[3.x] Physics Interpolation - Add 3D helper for using servers directly.#104518lawnjelly wants to merge 1 commit intogodotengine:3.xfrom
Conversation
67cd9a1 to
937c8d2
Compare
937c8d2 to
516d573
Compare
|
Here's a naive idea I had to reduce boilerplate for users: use the same RID for the visual instance and the FTI instance, and refer to both as an "instance with FTI". The RID will refer to the visual instance, so the existing
This sounds like a pretty nice API to me but the implementation wouldn't work the same as the current one with Do you think there's a way to make something like this work? |
I did initially look at this but there are a couple of restrictions:
I'll try and have another look at this. |
|
Ok I've thought of a alternative which may be better from a user perspective (not sure) .. so opinions welcome. The issue is the lifetime of both the An alternative may be when creating an There are two gotchas as a result:
Let me know if this is preferred. Perhaps I can create this as a separate PR to make it easier to see. |
516d573 to
4962b23
Compare
|
Closing for now in favour of #112119. This can be re-opened if desired, the new PR mentioned handles more cases (especially with FTI off) and should be easier in terms of use. |
#103685 by design removes server side physics interpolation, which has the side effect of removing in-built physics interpolation for users who create 3D nodes directly using servers, rather than via
SceneTreenodes, and ideally we don't want these users to feel they are "losing out".This use case is far simpler than
SceneTreeinterpolation, because only global xforms need be supported.There are several options to deal with this area, including:
addonThis PR provides a simple solution for (3) for
instanceson the server, via a wrapper object calledfti_instance.It should be fairly simple to use, although admittedly there are a couple more lines to type than the old system.
The
fti_instanceis created inVisualServerlike an instance, but must be linked to aninstancevia theprepare()call.Then the user should call
fti_set_transform()on thefti_instanceinstead ofinstance_set_transform(), and can callfti_instance_reset()to reset physics interpolation.Everything else should work automagically. Nearly everything in 3D works via instances so this should cover most cases.
Camerasare not covered and would have to be interpolated manually, but as far as I remember this was also the case before #103685.Model at 5 ticks per second with FTI
2025-04-03.09-27-22.mp4
Usage Example
Notes
SceneTree#104269 if we merge the main PRs.