tentone / nunuStudio

Web powered cross-platform 3D, WebXR game engine.
https://nunustudio.org
MIT License
2.13k stars 319 forks source link

How to make the child physical model object rotate with the parent object #404

Open guocheng0519 opened 4 years ago

guocheng0519 commented 4 years ago

How to make the child physical model object rotate with the parent object

22

Description

When I rotate a model object, I find that the physical model of the child does not rotate, resulting in no effect of collision with another physical object

Version位
Platform
tentone commented 4 years ago

Hello

Physics are not affected by the parent transforms since they are always calculated in world coordinates.

They do affect their child position so for example if a physics object has a box as a child the box with move exactly as its physics model but if the box being moved has a physics object child the physics object will keep its position.

I can possibly add a new physics mode other than the two already available that ensures that the physics body follows the tree transform it would mean that i have to apply "infinite" force sometimes on the object and this can lead to some "funny" results on the physics engine.

Thanks a lot!

guocheng0519 commented 4 years ago

Hello Thank you very much for your answerIf ,It's been bothering me for a long time. If there's a good solution, please let me know. Thanks a lot!