tweak rolling friction in RaytestDemo

This commit is contained in:
erwin.coumans
2012-09-16 17:23:39 +00:00
parent 22fb7d5c1e
commit 4934ce61fa

View File

@@ -199,7 +199,8 @@ void RaytestDemo::initPhysics()
btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform); btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,groundShape,localInertia); btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,groundShape,localInertia);
btRigidBody* body = new btRigidBody(rbInfo); btRigidBody* body = new btRigidBody(rbInfo);
body->setRollingFriction(1);
body->setFriction(1);
//add the body to the dynamics world //add the body to the dynamics world
m_dynamicsWorld->addRigidBody(body); m_dynamicsWorld->addRigidBody(body);
} }
@@ -263,6 +264,9 @@ void RaytestDemo::initPhysics()
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,0,colShape,localInertia); btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,0,colShape,localInertia);
rbInfo.m_startWorldTransform = startTransform; rbInfo.m_startWorldTransform = startTransform;
btRigidBody* body = new btRigidBody(rbInfo); btRigidBody* body = new btRigidBody(rbInfo);
body->setRollingFriction(0.03);
body->setFriction(1);
body->setAnisotropicFriction(colShape->getAnisotropicRollingFrictionDirection(),btCollisionObject::CF_ANISOTROPIC_ROLLING_FRICTION);
m_dynamicsWorld->addRigidBody(body); m_dynamicsWorld->addRigidBody(body);