tweak rolling friction in RaytestDemo
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user