Customize the contacts-cache SaveState
function.
#611
AndreaCatania
started this conversation in
General
Replies: 1 comment 25 replies
-
Hello, The contact cache is something I'd rather not expose as it contains a lot of internal interface that users are not supposed to call. I'm also not 100% sure if the simulation will be deterministic if you don't have the exact same bodies on both sides (it may be but is totally untested). In any case you need to be very careful in synching BodyIDs between simulation. What about adding 2 virtual functions to StateRecorder that you can override? Something like:
and
So that the contact cache (and body + constraint manager) can ask the recorder if the state of a particular body / constraint needs to be saved. |
Beta Was this translation helpful? Give feedback.
25 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I need to send the physics state, recorded using
SaveState
, from server to clients so that they can simulate the physics in a deterministic way.I need to optimize the data sent, so I'm writing a custom
SaveState
that collects only the body state that the client is simulating. Notice, the server is simulating a large world and the clients are simulating only few bodies around the character.So far this task seems doable, as the
SaveState
is already public, however theContact cache
is private and I'm wondering if I can PR a change that makes it public so I can write a customSaveState
that fetches only the contacts relative to the bodies simulated by the client.Can I open a PR that allows that?
Beta Was this translation helpful? Give feedback.
All reactions