Skip to content

Conversation

@gfodor
Copy link

@gfodor gfodor commented Jan 2, 2021

This fixes an issue where the physics system does not properly handle the case where a new body is added that is initially set to DYNAMIC. Dynamic bodies are currently always synced out of the physics engine on every tick, however this means that if a body starts out as dynamic, its initial transform is never written to the physics engine (so it ends up just getting an identity transform in the physics engine.)

To fix this, bodies now explicitly track the first three sync passes in a counter, and if a body is dynamic and its first and second syncs are seen while its dynamic, then the worker waits for the initial transform to be written by the host process, syncs it to physics, and then proceeds as usual.

Also addresses a potential bug where the matrix offset in the buffer was not being used when resetting dynamic objects.

gfodor added 2 commits January 2, 2021 09:35
…to explicitly manage the first 3 initial physics syncs to coordinate the host process setting the initial transform properly before physics starts driving it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant