How to use Combined Restitution (m_combinedRestitution)
Posted: Tue Jan 26, 2010 3:01 pm
Hi,
I'm trying to use the btManifoldPoint::m_combinedRestitution member for creating balls that doesn’t have the same bounciness (basket ball, super ball and others).
I'm using a custom callback:
In this callback I change the restitution parameter in order to create several bounciness according to the geometries materials:
I don't understand why but:
-> if cp.m_combinedRestitution=0.5f -> the balls never stabilises and make infinite small bouncing (on a plane as wall as on a box)
-> if cp.m_combinedRestitution=0.7f -> the bouncing is amplified several time step (0.01ms), then reduced, then amplified ..... The effect is rally not realistic
-> if cp.m_combinedRestitution=0.9f -> the bouncing is amplified at each time step like if an additional energy was added systematically
Perhaps I do not use this parameter as required?
For exemple, using ODE, 0 means no restitution (no bouncing), 0.5 makes the ball bounces for several time step then stops, and 1 means bounce infinite in the range (+H,0)
Any suggestions?
Thank you !
I'm trying to use the btManifoldPoint::m_combinedRestitution member for creating balls that doesn’t have the same bounciness (basket ball, super ball and others).
I'm using a custom callback:
Code: Select all
static bool CustomMaterialCombinerCallback(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
Code: Select all
cp.m_combinedRestitution = MIX_BOUNCE(m1->GetForceRestitutionCoef(),m2->GetForceRestitutionCoef());
-> if cp.m_combinedRestitution=0.5f -> the balls never stabilises and make infinite small bouncing (on a plane as wall as on a box)
-> if cp.m_combinedRestitution=0.7f -> the bouncing is amplified several time step (0.01ms), then reduced, then amplified ..... The effect is rally not realistic
-> if cp.m_combinedRestitution=0.9f -> the bouncing is amplified at each time step like if an additional energy was added systematically
Perhaps I do not use this parameter as required?
For exemple, using ODE, 0 means no restitution (no bouncing), 0.5 makes the ball bounces for several time step then stops, and 1 means bounce infinite in the range (+H,0)
Any suggestions?
Thank you !