[ODE] new ODE collision

David McClurg dmcclurg at pandemicstudios.com.au
Thu Nov 28 17:44:02 2002


In findLevel(), just check for -dInfinity too because...

  bounds[0] == dInfinity;
  bounds[1] == -dInfinity;
  (bounds[1] - bounds[0]) => -dInfinity

Here's the patch to findLevel():

static int findLevel (dReal bounds[6])
{
  // compute q
  dReal q,q2;
  q = bounds[1] - bounds[0];	// x bounds
  q2 = bounds[3] - bounds[2];	// y bounds
  if (q2 > q) q = q2;
  q2 = bounds[5] - bounds[4];	// z bounds
  if (q2 > q) q = q2;

  if (q == dInfinity || q == -dInfinity) return MAXINT;

  // find level such that 0.5 * 2^level < q <= 2^level
  int level;
  frexp (q,&level);	// q = (0.5 .. 1.0) * 2^level (definition of frexp)
  return level;
}

-----Original Message-----
From: David McClurg 
Sent: Friday, 29 November 2002 10:34 AM
To: ode@q12.org
Subject: RE: [ODE] new ODE collision


should it be allowable to have an empty space in another space?  it is convenient for my application because i add/remove geoms to/from groups on the fly to optimize collisions.

if it's ok and i'm pretty sure it used to work with an empty group inside a hash space, then i think there is a problem.  currently, i get a floating point invalid operation in findLevel() because q=dInfinity

  frexp (q,&level);

this is because the AABB for an empty group (ie, simple space) is set to infinities in dxSpace::computeAABB() in collision_space.cpp
_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode