CustomMaterialCombinerCallback -> conveyor belt effect

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

CustomMaterialCombinerCallback -> conveyor belt effect

Post by Gickl »

Code: Select all

static bool CustomMaterialCombinerCallback(btManifoldPoint& cp,   const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
{
   cp.m_lateralFrictionInitialized = true;

   cp.m_lateralFrictionDir1.setValue(1,0,0);
   ///downscale the friction direction 2 for lower (anisotropic) friction (rather than a unit vector)
   cp.m_lateralFrictionDir2.setValue(0,0,0.1);
   ///choose a target surface velocity in the friction dir1 direction, for a conveyor belt effect
   cp.m_contactMotion1 = 1.f;

   //cp.m_contactMotion1 = 1.f;
   //cp.m_contactCFM2 = 0.1;
   //cp.m_combinedFriction = 10;
   //cp.m_combinedRestitution = calculateCombinedRestitution(restitution0,restitution1);
   return true;
}
Hi,

the code above was posted a few years ago and it should have the effect of a conveyor belt (see http://www.bulletphysics.org/Bullet/php ... ing#p15751). Erwin posted a modified version of the BasicDemo.cpp where the callback is included. There I can achieve that all the boxes drift to the right like on a conveyor belt. but when i try to change the direction of the movement by modifying the two friction directions i get odd behaviour. sometimes the boxes drift in two opposite directions and other times they drift in all directions for example.

so my problem is that i don't know exactly what the parameters and especially the two friction directions effect. can someone tell me what the friction directions exactly do? and perhaps what the other parameters are for?
i thought that the comments explain enough. but it seems that it isn't that easy...

i would be very happy!

Thank you
Gickl