[ODE] Joint Groups

Adam Moravanszky amoravanszky at dplanet.ch
Fri Nov 16 05:56:01 MST 2001


Is there any reason for explicit joint groups with a fixed size.  This
strikes me as a very primitive interface.  If it is possible to create
bodies without a fixed size body group, then surely ODE could also manage
joint groups as some internal data structure.  My primary problem is having
to set a maximum number -- there is no reason why I should know how many
joints I will need.  I would have no problem with an initial size hint on
which you can base your growing strategy on.

Other problems with the interface, while we're at it:

I would use classes (read structs for C interface) for Matrix, Vector, and
Quat.  They don't need operators, I just want to subclass them so they
transparently cast to my own math classes.

Why do the vector set methods take 3 scalars, while setQuaternion takes your
quat typedef?

The second imbalance is that you let the dBodyGet*() functions return an
ugly pointer to a scalar (one can only assume, even after reading the docs,
that the pointer actually references an entire vector or matrix -- so much
for type safety) internal data to avoid a copy, but you don't let my methods
for Set*() pass in a pointer to my own internal data; rather, I have to pick
my vectors apart into their elements.  A more type safe interface would be
especially important because most people will be using 32 bit floats in
their own code, and doubles for ODE.  So any violent casting and memcpy-ing
can quickly go bad.  Especially if they don't notice that your 3D vectors
and matrices are padded to 4 elements, which is also not apparent when you
boldy declare something like:
const dReal * dBodyGetRotation   (dBodyID);

The C++ wrapper for the C interface in odecpp.h is a joke -- the only
additional functionality it seems to provide over C is constructors and
destructors.  It could be effectively used to address all my problems above,
and much more.

--
-- Adam Moravanszky
http://n.ethz.ch/student/adammo/





More information about the ODE mailing list