Advertisement

question for ODE users

Started by January 03, 2005 06:43 PM
4 comments, last by vidalsasoon 19 years, 8 months ago
I have an object that I drop onto a plane (I set my plane to ignore gravity). The problem is that when the object hits the plane both items go spiraling out of control. how could i set my plane to be an object that is collidable but does not move?
Don't create a body for the plane, just the geom. You should understand the different between bodies and geoms. bodies are point masses that handle dynamics (they have no collision), geoms are massless collidable shapes (they dont move on their own, have no dynamics, etc), basically you are giving your plane geom a body which is does not need. I believe this exact issue is in the docs. Also, have you tried using the ODE mailing list?
Advertisement
ah, very helpful thank you.
question part 2:

I'm now using a mesh as a plane. when my object falls on it, it sometimes behaves OK (doesnt crash). However, sometimes the object will go halfway through the plane (and program crashes). any suggestion on how I could make my mesh inpenetrable?

I tried changing the collision "space" and increasing the step.
Make sure you're using dWorldQuickStep instead of dWorldStep, becuase that can cause a LOT of crashes.

As for the objects falling through the ground, the problem lays within your collision detection. The best way to overcome this is to store 'types' of objects into the bodies themselves (a plane doesn't have one, so when you use dGeomGetBody(), it will return 0), then based upon the object types, handle the collisions appropriately.

For fixed objects (such as a plane), I set the contact properties like this:
mode = dContactSlip1 | dContactSlip2 | dContactSoftERP | dContactSoftCFM | dContactApprox1
mu = dInfinity
slip1 = 0.0f
slip2 = 0.0f
soft_erp = 0.0f
soft_cfm = 0.0f

Without the slipping, and with no softness, objects can't fall through it unless they're travelling fast enough that they actually miss the plane/object comletely upon the next update (which is possible).

Anyway, the contact joint MUST be attached to the object hitting the fixed object, and the world, since you don't want the fixed object moving. This will also work for objects that aren't planes.

I currently use 3 different collision types (fixed, solid and fluid). I plan on adding other collision types to it (2 different solids, etc.) in the future, but it's a fair bit of work. I hope this helps.
ah, nice. thanks

This topic is closed to new replies.

Advertisement