[ODE] [Fwd: Re: implementation of nearCallback]

Jaroslav Sinecky sinecky at telefonica.net
Wed Apr 19 09:21:11 MST 2006


Did get over to the list, trying again ...

-------- Original Message --------
Subject: 	Re: [ODE] implementation of nearCallback
Date: 	Wed, 19 Apr 2006 12:30:05 +0200
From: 	Jaroslav Sinecky <sinecky at telefonica.net>
To: 	Patrik Stellmann <stellmann at tu-harburg.de>
CC: 	ode at q12.org
References: 	<4445E062.2030205 at tu-harburg.de>



This looks like real problem. Also if you have space A with only space B 
inside (or AABB box of space B doesn't collide with other geoms in space 
A), inner collisions of space B will not be checked, right?
It's probably really bad design for space hierarchies, since 
nearCallback is there for collision PAIRS. How about providing other 
callback that would be called exactly one time for every single space 
inside space? Or call directly dSpaceCollide for such a space?
Shouldn't be much complicated to implement this change in collide 
procedures of each space.

Jaroslav


Patrik Stellmann wrote:
> Hi there,
>
> I'm wondering if the implementation of nearCallback from the 
> documentation is really suitable for a hierachical space-structure:
>
> void nearCallback(void *data, dGeomID o1, dGeomID o2)
> {
> if (dGeomIsSpace(o1) || dGeomIsSpace(o2)) {
>   dSpaceCollide2(o1,o2,data,&nearCallback);
>   if (dGeomIsSpace(o1)) dSpaceCollide(o1,data,&nearCallback);
>   if (dGeomIsSpace(o2)) dSpaceCollide(o2,data,&nearCallback);
> }
> else {
>   int num_contact = dCollide(o1,o2,max_contacts,contact_array,skip);
>   [...]
> }
> }
>
> let's imagine that we have the spaces A and B and the geoms w, x, y and 
> z. Their dependency is like this:
> A = {B, w, x}
> B = {y, z}
> When I call dSpaceCollide for A I' expect nearCallback to be called for 
> the following pairs:
> {B, w}, {B, x}, {w, x}
> But with the nearCallback above this would result in dSpaceCollide(B) 
> beeing called twice!?
>
> Is there any internal voodoo that avoids this problem, did I get 
> anything wrong or is the implementation of nearCallback just unsuitable 
> for such kinds of space-hierarchies?
>
> (I implemented it now that way, that I never call dSpaceCollide(...) in 
> nearCallback(...) and hold a list of spaces which should generate 
> internal collisions and call it for them)
>
> Thanks for any comments!
>
> Patrik
>
>
>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>   




More information about the ODE mailing list