• entries
    205
  • comments
    228
  • views
    112909

Basic Collisions

Sign in to follow this  

316 views


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.

overhead ogre

I put a quick
">video up on YouTube which shows the simple bouncing collisions in action. The video quality is totally crappy as it ends up it's far more difficult than I imagined to capture a desktop video on a mac than on a PC. I rely on FRAPS to do the job for PC but there really is no equivalent in the mac world, at least not one that I could find.

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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now