• Advertisement
Sign in to follow this  

Contact points generated, but collider sinks through the floor

This topic is 781 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

Hey all,

 

I'm working on 3D collision detection between OBBs. Right now what I have is this:
 

[attachment=30872:Capture.JPG]

 

The contact points are being generated right (I think). But the impulses that are generated are really wonky. They are either too high or too low, and do not lead to the mesh stabilizing over time. 

 

The collider can also sink through the floor some times, even though the contact points are generated.

 

What could be the cause of this?

Share this post


Link to post
Share on other sites
Advertisement
Hi there,

You should debug the shapes and contacts using an API that has functions for line and point drawing. Collision detection assumes everything off-line is setup correctly in order to work. Believe me, we've done (and still do this) many times. :). Think about TDD: Before writing a piece of code, write a test first!

Particularly:

Render the contact normals, friction directions, center of masses, rotation matrices, face planes, and so forth.

Believe me, this is probably small error in your code, and you'll need to be patient to find out what is wrong.

Share this post


Link to post
Share on other sites
It can be many things. You should be able to compare your engine with another. It is difficult to guess what is wrong with pictures and without being able to step through your code. I can recommend Bounce Lite or even Box2D (although in 3D things are slightly more complex) for practical learning. You'll learn many things from general physics engine architecture to collision detection, etc. If those things are not possible then please describe your problem in a more detailed fashion. :)

Share this post


Link to post
Share on other sites

I see three possibilities:

 

1) Inconsistent normal direction

2) Wrong inertia tensor for specific rotations

3) You miss some contact points between frames

 

As Irlan pointed out correctly you really need to visualize your data. You can also assert that you have a separating velocity at each contact point after the solve. I don't think that a variable timestep would create that issue.

Edited by Dirk Gregorius

Share this post


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

  • Advertisement