Used the new btRigidBody constructor, since the old constructor
is not as flexible and will be deprecated. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1429 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
de6b4a3ae0
commit
257508179f
@ -84,10 +84,11 @@ void Moveable::createBody(float mass, btTransform& trans,
|
||||
shape->calculateLocalInertia(mass, inertia);
|
||||
m_motion_state = new btDefaultMotionState(trans);
|
||||
|
||||
btRigidBody::btRigidBodyConstructionInfo info(mass, m_motion_state, shape, inertia);
|
||||
|
||||
// Then create a rigid body
|
||||
// ------------------------
|
||||
m_body = new btRigidBody(mass, m_motion_state,
|
||||
shape, inertia);
|
||||
m_body = new btRigidBody(info);
|
||||
// This MUST actually be set from the actual class, otherwise this
|
||||
// is only a pointer to moveable, not to (say) kart, and virtual
|
||||
// functions are not called correctly.
|
||||
|
@ -182,8 +182,9 @@ void MovingPhysics::init()
|
||||
m_motion_state = new btDefaultMotionState(trans);
|
||||
btVector3 inertia;
|
||||
m_shape->calculateLocalInertia(m_mass, inertia);
|
||||
m_body = new btRigidBody(m_mass, m_motion_state, m_shape, inertia);
|
||||
//m_body->setDamping(2.0f, 2.0f);
|
||||
btRigidBody::btRigidBodyConstructionInfo info(m_mass, m_motion_state, m_shape, inertia);
|
||||
|
||||
m_body = new btRigidBody(info);
|
||||
world->getPhysics()->addBody(m_body);
|
||||
} // init
|
||||
|
||||
|
@ -55,7 +55,8 @@ void TriangleMesh::createBody(btCollisionObject::CollisionFlags flags)
|
||||
btTransform startTransform;
|
||||
startTransform.setIdentity();
|
||||
m_motion_state = new btDefaultMotionState(startTransform);
|
||||
m_body=new btRigidBody(0.0f, m_motion_state, m_collision_shape);
|
||||
btRigidBody::btRigidBodyConstructionInfo info(0.0f, m_motion_state, m_collision_shape);
|
||||
m_body=new btRigidBody(info);
|
||||
|
||||
world->getPhysics()->addBody(m_body);
|
||||
m_user_pointer.set(UserPointer::UP_TRACK, this);
|
||||
|
Loading…
Reference in New Issue
Block a user