[ODE] Re: plane class with half space aabb

Erwin de Vries erwin at vo.com
Mon Jun 30 09:59:01 2003


> That's a good point. I should have used only 1 byte for it and not a
> whole integer.

After compiler alignment this makes no difference.

> Surely, using the gflags would work, too. But because of the fact that
> these bits do not only regard planes but are attributes of dxGeoms in
> general, wouldn't that be a misuse of such flags? I mean, shouldn't
> these bits used for properties of dxGeoms only?
> Besides, either you accept that the same flags have different meanings
> in different geom classes, or if you assign them exclusively, you may
> eventually run out of bits.

It is perfectly legal that different geoms use the same bits for different
purposes. After all, nothing can go wrong if the type member of a geom is
valid. 16 bits for 1 geomtype is actually pretty much. I think 8 bits would
be enough as well. This would leave us with 24 bits for the baseclass, which
i feel should be more than enough.

The dxGeom baseclass itself can be optimized to use 4 or 8 bytes less memory
as well. I proposed an optimisation once, and i think it would still be a
valid one.

Erwin