implemented rolling friction, using a contact constraint. Useful to get rolling spheres to rest, even on a slightly sloped plane.

See http://www.youtube.com/watch?v=RV7sBAsKu4M and Bullet/Demos/RollingFrictionDemo
Fixes in FractureDemo (mouse picking constraint needs to be removed, otherwise constraint solver crashes/asserts)
This commit is contained in:
erwin.coumans
2012-09-15 06:52:17 +00:00
parent 54744b6ab9
commit 7eebb79ced
14 changed files with 263 additions and 44 deletions

View File

@@ -223,7 +223,7 @@ void CcdPhysicsDemo::initPhysics()
btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,groundShape,localInertia);
btRigidBody* body = new btRigidBody(rbInfo);
body->setRollingFriction(0.3);
//add the body to the dynamics world
m_dynamicsWorld->addRigidBody(body);
}
@@ -282,7 +282,7 @@ void CcdPhysicsDemo::initPhysics()
btRigidBody* body = localCreateRigidBody(mass,trans,shape);
body->setRollingFriction(0.1);
///when using m_ccdMode
if (m_ccdMode==USE_CCD)
{