Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Apr 24, 2012 7:58 am 
Offline

Joined: Tue Jan 06, 2009 10:04 am
Posts: 15
Hello Erwin,

I'm having a bug due to collision normal adjustment made between a static mesh & a dynamic rigid body. Indeed I'm calling btAdjustInternalEdgeContacts in a processContactPoints, but as contacts points world position is recomputed from adjusted normal, this breaks the process contact coherency in Bullet that recomputes world positions from local ones each frame and then remove contacts when they are not close enough. When this piece of code is executed in btAdjustInternalEdgeContacts :

Code:
btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
                     //               cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
                     cp.m_normalWorldOnB = newNormal;
                     // Reproject collision point along normal. (what about cp.m_distance1?)
                     cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
                     cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);


positionWorldOnB is adjusted from positionWorldOnA, thus contacts points never separates even if body are separating progressively. This leads to contact point between static mesh & dynamic rigid body never removed even both involved bodies are separating slowly (for sure bodies's aabb must overlap for this bug to occur).
In my opinion the reel problem is that processContact callback is called even if no contact point has been updated during narrowphase collision detection, Bullet waits for recomputed contact world positions being separated enough in order to remove a contact (I suppose this ensure kind of contact points temporal coherency). Do you see what I mean ? Can you reproduce this bug ? Do you need more informations ?
So what is the best solution ? Should we recompute world positions when contact normal as changed (in all case this adjustment is an approximation...) ? Should we clear manifold when no contact point is updated by narrow phase collision algorithm (my preferred solution...) ? Ant other idea ?

Thank you.

Romain


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group