realXtend / tundra

realXtend Tundra SDK, a 3D virtual world application platform.
www.realxtend.org
Apache License 2.0
84 stars 70 forks source link

Rigidbody is stuck when placeable has a parent ref #747

Closed tapanij closed 10 years ago

tapanij commented 10 years ago

Tried to move a child entity by adding linear velocity. Will stay in one point unless I remove the parent ref.

Example scene: https://dl.dropboxusercontent.com/u/60485425/Playsign/parentBug.txml

jonnenauha commented 10 years ago

I would assume this is how it should work? Once parented the child is just along for the ride and physics impulses etc. should be applied to the parent?

cadaver commented 10 years ago

Bullet always operates in world space, so when a rigid body is parented and it moves, the transform needs to be changed back into the parent's space. Support for this has been implemented but apparently it has broken, or has never worked properly for moving rigidbodies.

cadaver commented 10 years ago

In general, a parented rigidbody should be avoided, because a rigidbody is supposed to represent a free-standing object in the world, and when the parent is moved, the rigidbody will move also (non-physically). The extra coordinate space transformations will also cost performance.