Friction and restitution is now set

This commit is contained in:
Robin Engman 2014-02-10 14:22:10 +01:00
parent c18eb668aa
commit 8547d17d0f
1 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,8 @@ ICustomBody* API_Impl::AddCollisionSphere(float radius, ::Oyster::Math::Float4 r
collisionShape->calculateLocalInertia(mass, fallInertia); collisionShape->calculateLocalInertia(mass, fallInertia);
btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia); btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia);
btRigidBody* rigidBody = new btRigidBody(rigidBodyCI); btRigidBody* rigidBody = new btRigidBody(rigidBodyCI);
rigidBody->setFriction(staticFriction);
rigidBody->setRestitution(restitution);
rigidBody->setUserPointer(body); rigidBody->setUserPointer(body);
body->SetRigidBody(rigidBody); body->SetRigidBody(rigidBody);
@ -91,6 +93,8 @@ ICustomBody* API_Impl::AddCollisionBox(Float3 halfSize, ::Oyster::Math::Float4 r
collisionShape->calculateLocalInertia(mass, fallInertia); collisionShape->calculateLocalInertia(mass, fallInertia);
btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia); btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia);
btRigidBody* rigidBody = new btRigidBody(rigidBodyCI); btRigidBody* rigidBody = new btRigidBody(rigidBodyCI);
rigidBody->setFriction(staticFriction);
rigidBody->setRestitution(restitution);
rigidBody->setUserPointer(body); rigidBody->setUserPointer(body);
body->SetRigidBody(rigidBody); body->SetRigidBody(rigidBody);
@ -118,6 +122,8 @@ ICustomBody* API_Impl::AddCollisionCylinder(::Oyster::Math::Float3 halfSize, ::O
collisionShape->calculateLocalInertia(mass, fallInertia); collisionShape->calculateLocalInertia(mass, fallInertia);
btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia); btRigidBody::btRigidBodyConstructionInfo rigidBodyCI(mass, motionState, collisionShape, fallInertia);
btRigidBody* rigidBody = new btRigidBody(rigidBodyCI); btRigidBody* rigidBody = new btRigidBody(rigidBodyCI);
rigidBody->setFriction(staticFriction);
rigidBody->setRestitution(restitution);
rigidBody->setUserPointer(body); rigidBody->setUserPointer(body);
body->SetRigidBody(rigidBody); body->SetRigidBody(rigidBody);