Once again I didn't get a lot of time this week for coding but I did manage to make a little bit of progress. I got the basics of ODE collision detection working. I now have my node objects encapsulate ODE geometry bodies independent of their Ogre3D visible bodies. For now I just have spheres, boxes and planes hooked up but will add rays, cylinders and meshes if and when I need them. To show off the functionality I moved the camera to an overhead view and set up 4 planes as walls around the outside edge of the viewing field. I then created a bounding sphere for the ogre head and set it flying around. I make the world have zero friction so the head will keep bouncing off walls forever.
I put a quick
There wasn't a whole lot of coding involved in getting collisions working. Most of the work was spent debugging around why things weren't working at first. The weirdest thing that was happening to me was that parameters that were being passed to ODE functions ended up turning into crap on the receiving end. Stepping through the code I couldn't find anything that would cause it. As it ends up I had recompiled the ODE library to change to double precision away from single precision but hadn't added the appropriate define into my code which would make my ODE calls hook up with the right double precision methods
Once I got the whole precision issue out of the way I was still running into a bunch of ODE runtime asserts that were are cryptic as you can get. Luckily the last time I used ODE I also ran into this type of problem. Physics simulations end up having a tendency to blow up if you don't use the right settings. Anytime you have a setting set to infinity or zero it's worth checking out. Tweaking some numbers around the creation of collision joints solved my problems.
Now that I have the basics of Ogre3D and ODE tied together the next step is to do a little code cleanup and then start fooling around with prototyping.
The latest code drop can be found here.