How to use Combined Restitution (m_combinedRestitution)

Post Reply
bonjovi
Posts: 35
Joined: Mon Jul 20, 2009 12:58 pm

How to use Combined Restitution (m_combinedRestitution)

Post by bonjovi »

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:

Code: Select all

static bool CustomMaterialCombinerCallback(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
In this callback I change the restitution parameter in order to create several bounciness according to the geometries materials:

Code: Select all

cp.m_combinedRestitution = MIX_BOUNCE(m1->GetForceRestitutionCoef(),m2->GetForceRestitutionCoef());
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 !
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: How to use Combined Restitution (m_combinedRestitution)

Post by Erwin Coumans »

It would be good to look into this, there might be some issues with the restitution.

Can you provide a (modified) Bullet sample with the restitution tests, as well as the ODE sample code that shows the restitution of 0, 0.5 and 1 working properly?

Thanks,
Erwin
bonjovi
Posts: 35
Joined: Mon Jul 20, 2009 12:58 pm

Re: How to use Combined Restitution (m_combinedRestitution)

Post by bonjovi »

I've made a video that shows the differences:
http://files.marilou-roboticsstudio.com ... Bullet.wmv

-> The spheres are both dynamics, mass = 1.0 kg, radius about 0.16 meter
-> Time step =0.01
-> Using the latest bullet version (not the trunk)

-> The floor is a static plane
-> I've made tests on a static plane and on a static box : it gives similar results (not exactly the same ...)
Post Reply