Re[2]: [ODE] using dCreateGeomClass in the last ode version

slipch slipch <slipch at gsc-game.kiev.ua>
Wed Nov 27 01:55:01 2002


Hello Russ,

Tuesday, November 26, 2002, 8:55:31 PM, you wrote:



RS> i don't know what problem you are talking about - can you describe it more
RS> precisely? but the new collision system uses constant class numbers, not
RS> variable class numbers, so this should not be a problem (except perhaps
RS> for user defined classes set up through the C API??).

Yes, I mean user definite classes.
When I create geometry class
//////////////////////////////////////////////
    dGeomClass c;
    c.bytes = sizeof (dxCylinder);
    c.collider = &dMyClassColliderFn;
    c.aabb = &dMyClassAABB;
    c.aabb_test = 0;
    c.dtor = 0;
    dMyClass=dCreateGeomClass (&c);

//////////////////////////////////////////
static dColliderFn * dMyClassColliderFn (int num)
{
  if (num == dBoxClass) return (dColliderFn *) &dCollideMyClassBox;
  if (num == dSphereClass) return (dColliderFn *) &dCollideMyClasSphere;
  if (num == dMyClass) return (dColliderFn *)&dCollideMyClassMyClass;
  if (num == dPlaneClass) return (dColliderFn *) &dCollideMyClassPlane;
  return 0;
}

dMyClassColliderFn do not return     dCollideMyClassMyClass in
dCreateGeomClass because  dMyClass is not set until it return and
dCollideMyClassMyClass do not set in colliders array.

It is not a bug but I do not know how to set collider for  MyClass -
MyClass collision.

-- 
Best regards,
 Konstantin Slipchenko                            mailto:slipch@gsc-game.kiev.ua

 Sorry for sometimes I use reply button by mistake :).