Vehicle collision issues when moving between meshes
Posted: Thu Sep 08, 2016 4:28 pm
I've already set up the internal edge utility, which fixes the collision issues on triangle meshes, however that doesn't fix the problem for edges between different meshes:
https://youtu.be/AjjBGM01Nl0?t=12s
As a test, I've tried setting the collision normal to a fixed value:
This fixes the problem for flat surfaces (As demonstrated in the video, starting at 01:05), but how can I implement this properly?
Has someone tried something like this already? I'm not too familiar with bullet, I'd just like some tips on how to go about this issue.
https://youtu.be/AjjBGM01Nl0?t=12s
Code: Select all
static bool custom_material_combiner_callback(btManifoldPoint &cp,const btCollisionObjectWrapper *colObj0Wrapper,int partId0,int index0,const btCollisionObjectWrapper *colObj1Wrapper,int partId1,int index1)
{
btAdjustInternalEdgeContacts(cp,colObj1Wrapper,colObj0Wrapper,partId1,index1);
return true;
}
Code: Select all
static bool custom_material_combiner_callback(btManifoldPoint &cp,const btCollisionObjectWrapper *colObj0Wrapper,int partId0,int index0,const btCollisionObjectWrapper *colObj1Wrapper,int partId1,int index1)
{
if(colObj0Wrap->getCollisionShape()->getShapeType() != TRIANGLE_SHAPE_PROXYTYPE)
{
cp.m_normalWorldOnB = btVector3(0,1,0); // Up-vector
return;
}
else
btAdjustInternalEdgeContacts(cp,colObj1Wrapper,colObj0Wrapper,partId1,index1);
return true;
}
Has someone tried something like this already? I'm not too familiar with bullet, I'd just like some tips on how to go about this issue.