[ODE] Collision callback pattern

David Walker david.walker530 at ntlworld.com
Mon Sep 1 23:34:01 2003


I thought this was an interesting idea as well and so started
implementing it in my .NET wrapper. 
You can apply a material to any geom. A material is basically just the
surface properties that are set during contact creation. When a contact
is made the values for friction etc, are calculated by averaging the
values of the two materials. I was going to add an override for unusual
material combinations as well but never got around to that.

I made it optional so you can use the old fashioned callback if you
like. I also added events to the geoms so that you could still get
feedback whenever a collision was detected. 

There are also two special materials, default (guess what that does) and
nocontact. If you set the material of a geom to the nocontact material,
no contacts will be made, but the collision events will still be fired,
good for triggers and stuff. I used it for a ball reset in a simple
pinball game.

I haven't got any comments on it yet so I don't think anyone is using it
:-( 

David


-----Original Message-----
From: ode-admin@q12.org [mailto:ode-admin@q12.org] On Behalf Of Dave
Lloyd
Sent: 02 September 2003 05:44
To: ode@q12.org
Subject: Re: [ODE] Collision callback pattern


Nate W wrote:

>On Tue, 2 Sep 2003, Dave Lloyd wrote:
>
>  
>
>>Thanks for the pointers, Nate. I like the approach you're suggesting 
>>here - I was having similar thoughts but I wasn't sure how to handle
the 
>>mutual interaction of the two surfaces in contact.
>>    
>>
>
>To be honest, I'm not really sure either. :-)  Would the contact
friction
>be the average of the two materials, or the lesser of the two?  Would
>bouncyness be the greater of the two, or the sum?  I guess the latter
in
>both cases, but it's just a guess.
>
Seems like a good strategy then would be to blend the materials 
empirically according to 'typical physics' (i.e., best guess) and 
provide escape mechanisms for unusual material combinations. An 
alternative would be to provide a rule for each pair of surface types - 
admittedly more awkward to introduce new surfaces as each combination 
must be considered but I suspect in many cases there won't be that many 
surface types. Each surface type could of course be parameterised. This 
would allow us to distinguish the effect of chunky tyres on tarmac 
versus slicks on tarmac or studded tyres on ice. We may also need to 
have a finer detail description of the surface than the geom - I use a 
trimesh geom for each terrain patch (roughly 32m square) but might have 
surface details at the triangle level. Hmm.

I also like the idea of setting rules for other effects driven by the 
contacts: e.g., dust particles from rubber/sand proportional to the 
linear velocity.

Cheers,
Dave

_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode