Jump to content
  • Advertisement
Sign in to follow this  

question for ODE users

This topic is 4887 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!