more compounds work, the basics work. now some stackless tree-tree traversal is needed to speedup compound versus compound.

This commit is contained in:
ejcoumans
2006-07-24 23:06:59 +00:00
parent fdaa3a7abc
commit 50a2694c5b
12 changed files with 92 additions and 24 deletions

View File

@@ -72,11 +72,20 @@ void CompoundCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,BroadphaseP
//temporarily exchange parent CollisionShape with childShape, and recurse
CollisionShape* childShape = compoundShape->GetChildShape(i);
CollisionObject* colObj = static_cast<CollisionObject*>(m_childProxies[i].m_clientObject);
//backup
SimdTransform orgTrans = colObj->m_worldTransform;
CollisionShape* orgShape = colObj->m_collisionShape;
SimdTransform childTrans = compoundShape->GetChildTransform(i);
SimdTransform newChildWorldTrans = orgTrans*childTrans ;
colObj->m_worldTransform = newChildWorldTrans;
colObj->m_collisionShape = childShape;
m_childCollisionAlgorithms[i]->ProcessCollision(&m_childProxies[i],&m_otherProxy,dispatchInfo);
//revert back
colObj->m_collisionShape =orgShape;
colObj->m_worldTransform = orgTrans;
}
}