Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Physics] Parenting and transform hierarchy #13862

Closed
CedricGuillemet opened this issue May 15, 2023 · 2 comments · Fixed by #13914
Closed

[Physics] Parenting and transform hierarchy #13862

CedricGuillemet opened this issue May 15, 2023 · 2 comments · Fixed by #13914
Assignees
Milestone

Comments

@CedricGuillemet
Copy link
Contributor

CedricGuillemet commented May 15, 2023

Parenting and physics is a bit difficult because of local/world space changes. In V1, parenting was not allowed and a warning was displayed. I believe we can do better with V2.
At the price of more CPU costly sync, it's possible to handle parenting.
Regressions are easy to do, so better be rigorous.

Related forum thread: https://forum.babylonjs.com/t/havoc-problems-with-parented-meshes/40584/5

Resolution/testing should be part of documentation (what parenting + precondition => effect) so users can decide how they want to parent and control their meshes.

Test/dev PG:
https://playground.babylonjs.com/#R9DTZ0
There are commented lines (parent with physics, LH/RH hand scene,...). Every variation should be working (RH + physicalized parent + disable pre-step for example)

Also expectation is physics match the rendering. But also, if prestep is enabled, then moving a parent should also move the physics.

Also, update documentation for a page specificly for that purpose.
Physics with thin instances should stay the same. Hence, without parent or a warning is logged.

@carolhmj
Copy link
Contributor

https://playground.babylonjs.com/#9VHNB0 Another parenting check case we can use, this one doesn't load from a GLTF to allow checking the two cases (root parent with and without the GLTF transforms) manually

@CedricGuillemet
Copy link
Contributor Author

Yes, a part of the testing can be done programmaticaly. In practice, I believe this use case of hierarchy will come from .gltf. and the fact that it's right handed and get loaded with a root transform to change space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants