When I use SpuGatheringCollisionDispatcher and btParallelSequentialImpulseSolver on Win32/Xbox360, I couldn't change the friction and restitution of rigid body at all no matter what values I use for btRigidBody constructor. I realized the m_combinedFriction and m_combinedRestitution are hard-coded and I couldn't change the behavior of rigid body even if I change the values. I looked at the code base, and realized that m_combinedFriction and m_combinedRestitution in SpuContactResult.cpp line 138 are hard-coded, and the code ignores the values stored in btCollisionObjects.
Code: Select all
#ifdef DEBUG_SPU_COLLISION_DETECTION
spu_printf("SPU: same contact detected, nothing done\n");
#endif //DEBUG_SPU_COLLISION_DETECTION
// This is not needed, just use the old info! saves a DMA transfer as well
} else
{
newPt.m_combinedFriction = 0.25f;//calculateCombinedFriction(m_body0,m_body1);
newPt.m_combinedRestitution = 0.0f;//calculateCombinedRestitution(m_body0,m_body1);
Code: Select all
#ifdef DEBUG_SPU_COLLISION_DETECTION
spu_printf("SPU: same contact detected, nothing done\n");
#endif //DEBUG_SPU_COLLISION_DETECTION
// This is not needed, just use the old info! saves a DMA transfer as well
} else
{
btCollisionObject* body0 = (btCollisionObject*)manifoldPtr->getBody0();
btCollisionObject* body1 = (btCollisionObject*)manifoldPtr->getBody1();
newPt.m_combinedFriction = calculateCombinedFriction(body0,body1);
newPt.m_combinedRestitution = calculateCombinedRestitution(body0,body1);
However, If I use btParallelSequentialImpulseSolver instead of btSequentialImpulseConstraintSolver, the restitution value seems ignored again.
I am planing to use Bullet on PS3 and Xbox360, and it is very important to utilize multiple cpu cores. So if you can fix this or give me some hints to correct this, that would be great.
Thanks in advance, Masaki