[ODE] Re: Problems w/ tri-collider and ODE 0.035

Chris Klein cdkode at ennui.dnsalias.net
Thu Jan 2 07:13:01 2003


On Wed, 1 Jan 2003, Paul T. Pham wrote:

> > I am trying to compile the tri-collider code in contrib with
> > ODE 0.035 and OPCODE 1.2; I just changed the reference in

Paul,

I have a working version of the tricollider code on linux using OPCODE
1.2 (but ODE 0.03).  I ran into the same problems as you, as well as
other problems.  I then mentioned these to Erwin who asked me to send him
the changes, which I was going to, "right after I cleaned them up".  That
was about 3 months ago.  Oops.

Anyway, the compiler errors were a result of differences between g++
behaviour and vc++ compiler behaviour.  The dReal's coming out of ODE are
3 (or 4?) float arrays in this case (and here's part of the reason why the
tricollider is single-precision only) and the dcVector3 is a struct {
float x, float y, float z }.  You can cast one to the other very quickly
but I can't imagine how you sleep at night doing so! :)

There's another set of problems to correct before it will work.  Again,
for speed, a macro is used to stride across raw memory using (IIRC)
sizeof( byte ) in a modulus.  I'm surprised you don't mention it here -
byte is a win32ism (or so I think.)  sizeof( char ) should work.

Finally a bunch of compiler _warnings_ came up about some of the
references being taken being references to temporary copies.  Since
changes are made to the contents of the objects being referenced, this
seemed not the desired outcome and another probable compiler behaviour
difference.

I'll pull out my patched code and go over it again tonight or tomorrow.  I
should try and build it against 0.035 and see if it still works.

> > Also, if someone already has gotten ODE, tri-collider, OPCODE,
> > Demeter, and OpenSceneGraph to play nice with each other, I would
> > greatly appreciate seeing your source code.

(Paul, I also have some code which may help you get your combination of
libs working.  I was using OSG and Demeter for a while though I am not
anymore.  I expect you're trying to feed the demeter terrain into the
tricollider - unless demeter's changed in the last few months you can't
actually get enough data from demeter to get vertex and polygon
information from it!  I had to hack demeter to give me access to the
vertex data and tesselate it myself to give tricollider the tri's it
wants. Email me separately and I'll see what I can dig up over the next
few days.)

--Chris