[ODE] Some patches

Kevin Reid ode at q12.org
Tue Feb 25 10:45:02 2003


"Adam D. Moss" <adam@gimp.org> wrote:
> Kevin Reid wrote:
> > Various changes I've found useful and would like to see integrated into
> > standard ODE:
snip
> > makes dGeomSetBody(non-placeable geom, NULL) allowed
> 
> Why, though?  I don't see how this could be useful unless that geom's body
> was already non-NULL, which is of course forbidden.  I'd rather get a
> warning/error if ANY body- [re]setting operation happens to a
> non-placeable geom.

Hm. That may be the right way to go.

Explanation: I am writing a network game using ODE which works by
duplicating object state across the network. So, the code for
duplicating geoms calls dGeomSetBody() (on the duplicate) with the
return value of dGeomGetBody() (on the original) without checking what
kind of geom it is.

Until recently, I've been working with a non-debug build of ODE, so the
assert in dGeomSetBody never triggered. When I decided to use the debug
build and this started failing, 'fixing' ODE seemed reasonable. However,
with my other change adding dGeomIsPlaceable(), I could easily alter my
code to not care. So either way is fine.

(An argument for allowing it: shouldn't setX(y, getX(y)) always be OK?)

> >   ########## Allow infinitely thin boxes:
> 
> I like this, though I assume that you've checked that the collision code
> all works for boxes with one or more 0-sized lengths (I imagine there
> could be lots of gotchas depending on how they're implemented).

I haven't noticed any problems. I also haven't studied the box-*
collision routines.

-- 
Kevin Reid