question for ODE users
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?
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement