Vehicle collision issues when moving between meshes

Post Reply
Silverlan
Posts: 27
Joined: Thu Oct 30, 2014 9:15 pm

Vehicle collision issues when moving between meshes

Post by Silverlan »

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

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;
}
As a test, I've tried setting the collision normal to a fixed value:

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;
}
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. :)
Post Reply