Vehicle wheels bouncing (not btRaycastVehicle)

Post Reply
firo
Posts: 4
Joined: Thu Sep 30, 2010 2:55 pm

Vehicle wheels bouncing (not btRaycastVehicle)

Post by firo » Sat Apr 16, 2011 10:49 am

Hi,
I am doing truck simulation in my engine, not with btRaycastVehicle. Wheels are connected to vehicle skeleton with constraints.

On faster movement the wheels bouncing.

Each wheel is connected to vehicle in order:
btRigidBody (vehicle skeleton) -> btGeneric6DofSpringConstraint (as spring) -> btRigidBody (axle) -> btGeneric6DofConstraint (engine + steering) -> btRigidBody (wheel)

Drawed with btIDebugDraw: https://docs.google.com/leaf?id=0B8G7oN ... ist&num=50

Video: https://docs.google.com/leaf?id=0B8G7oN ... ist&num=50 (terrain is btBvhTriangleMeshShape)

Whose constraints parameters i should set (ERP, CFM, ...) to disable bouncing ?

Thanks in Advance..

argez
Posts: 6
Joined: Wed Jul 27, 2011 5:18 pm

Re: Vehicle wheels bouncing (not btRaycastVehicle)

Post by argez » Sat Jul 30, 2011 5:23 pm

this looks like a case of internal edge collision. Are you using a btBvhTriangleMeshShape for the terrain?

if you are using btHeightfieldTerrainShape, change it for a btBvhTriangleMeshShape and look into the InternalEdgeDemo source code for details on how to use the internal edge utility to adjust the edge normals.

In a nutshell:

1. Add this callback

Code: Select all

static bool CustomMaterialCombinerCallback(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
{
	btAdjustInternalEdgeContacts(cp,colObj1,colObj0, partId1,index1);
	return true;
}

extern ContactAddedCallback		gContactAddedCallback;
2. After building the btBvhTriangleMeshShape add this code where pGroundBody is your btBvhTriangleMeshShape instance

Code: Select all

// Enable custom material callback
pGroundBody->setCollisionFlags(pGroundBody->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);

btTriangleInfoMap* triangleInfoMap = new btTriangleInfoMap();
btGenerateInternalEdgeInfo(pGroundShape, triangleInfoMap);
That worked perfectly for me when i had exactly the same issue as you.

julieth11
Posts: 1
Joined: Mon Aug 29, 2011 11:45 am

Re: Vehicle wheels bouncing (not btRaycastVehicle)

Post by julieth11 » Mon Aug 29, 2011 11:47 am

Hi,
thank you, exactly what I'm looking for!

Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

Re: Vehicle wheels bouncing (not btRaycastVehicle)

Post by Gickl » Tue Jul 02, 2013 1:21 pm

Hey,

now i know that i have to add the callback to the rigid bodies. but where can i put the implementation?

i have several classes where i construct the rigid bodies and add them to a global dynamic world. all the classes have a header- and src-file...

Best regards
Gickl

Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

Re: Vehicle wheels bouncing (not btRaycastVehicle)

Post by Gickl » Tue Jul 02, 2013 1:48 pm

ok, i think i solved the problem! i just had a look in the internaledgedemo

Post Reply