Contact points generated, but collider sinks through the floor

Started by
3 comments, last by Dirk Gregorius 8 years, 2 months ago

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?

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.
Are you using a fixed time step?


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

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. :)

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.

This topic is closed to new replies.

Advertisement