Contact point refreshing

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
mikeshafer
Posts: 49
Joined: Fri Feb 24, 2012 10:45 am

Contact point refreshing

Post by mikeshafer »

So I finished and released my game demo which you all can download at http://mikeshafer2009.com. It has the rag-doll which I implemented that bullet inspired.

I've come to revisit collision detection for another project I'm doing. It's in 2D, but it's still applicable.

I'm looking at refreshContactPoints in bullet and it seems like the two transforms (m_rootTransA, m_rootTransB) that are passed in, ironically, never get refreshed. My bullet setup is a capsule on a box so it's using btConvexConvexAlgorithm. I see refreshContacts is being called in there, but nowhere else! Unless I'm missing something in the overlapping pairs section, it's not clear to me how this capsule rolls (it rolls beautifully--bullet still looks better than my physics engine). I think maybe the broad phase is detecting a separation and dumping the entire manifold instead of the narrow phase updating the contact points. I could be way off, but it's pretty hard to tell what the heck is going on.

I would appreciate any help on this.

Basically, my problem is this:

I'm doing a 2D physics setup with balls and boxes. I'm detecting contact points, but I don't know how to manage the contact points. Maximize area, sure. But the seperation of objects seems to be a problem. On another note, I commented out my version of refreshContacts from my engine and the rag-dolls don't go through the floor anymore, BUT they slide around on the ground as if ghost objects are pushing them. My broadphase is really dumb, I'm doing OBBIntersectOBB which is like 13 cross products if I remember correctly :D. What do you guys think?

Mike
mikeshafer
Posts: 49
Joined: Fri Feb 24, 2012 10:45 am

Re: Contact point refreshing

Post by mikeshafer »

Well I figured out one of my questions. It seems like bullet makes a temporary btManifoldResult every frame. The persistent manifold as a pointer inside this temp btManifoldResult. Since the constructor takes 2 transforms as input, this is where m_rootTransA and m_rootTransB are being "set". I was trying to follow program flow with a data breakpoint and you're not going to like the results this way :D.

In essence, I was confused. You could write a more straightforward version that refreshes contact points in a for loop. So my engine is doing it correctly. Thanks anyways you guys.

Mike
Post Reply