Commit fd5520b 1 parent 137a3aa commit fd5520b Copy full SHA for fd5520b
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8030,7 +8030,18 @@ void afGhostObject::update(double dt)
8030
8030
// cTransform trans;
8031
8031
// trans << m_bulletGhostObject->getWorldTransform();
8032
8032
// setLocalTransform(trans);
8033
- m_bulletGhostObject->setWorldTransform (to_btTransform (m_globalTransform));
8033
+ cTransform T_g_p = getLocalTransform ();
8034
+ if (m_parentObject){
8035
+ cTransform T_p_w;
8036
+ if (m_parentObject->getType () == afType::RIGID_BODY || m_parentObject->getType () == afType::SOFT_BODY || m_parentObject->getType () == afType::GHOST_OBJECT){
8037
+ T_p_w << ((afInertialObject*)m_parentObject)->getCOMTransform ();
8038
+ }
8039
+ else {
8040
+ T_p_w = m_parentObject->getGlobalTransform ();
8041
+ }
8042
+ T_g_p = T_p_w * T_g_p;
8043
+ }
8044
+ m_bulletGhostObject->setWorldTransform (to_btTransform (T_g_p));
8034
8045
m_sensedObjectsMaps.clear ();
8035
8046
8036
8047
btManifoldArray* manifoldArray = new btManifoldArray ();
You can’t perform that action at this time.
0 commit comments