Friction and restitution is now set
This commit is contained in:
parent
c18eb668aa
commit
8547d17d0f
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue