Remove the use of the old transform variable in CollisionBody
This commit is contained in:
parent
5ab2ee4df1
commit
6279867964
|
@ -41,8 +41,6 @@ CollisionBody::CollisionBody(const Transform& transform, CollisionWorld& world,
|
||||||
: Body(id), mType(DYNAMIC), mTransform(transform), mProxyCollisionShapes(NULL),
|
: Body(id), mType(DYNAMIC), mTransform(transform), mProxyCollisionShapes(NULL),
|
||||||
mNbCollisionShapes(0), mContactManifoldsList(NULL), mWorld(world) {
|
mNbCollisionShapes(0), mContactManifoldsList(NULL), mWorld(world) {
|
||||||
|
|
||||||
// Initialize the old transform
|
|
||||||
mOldTransform = transform;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
|
@ -73,9 +73,6 @@ class CollisionBody : public Body {
|
||||||
/// Position and orientation of the body
|
/// Position and orientation of the body
|
||||||
Transform mTransform;
|
Transform mTransform;
|
||||||
|
|
||||||
/// Last position and orientation of the body
|
|
||||||
Transform mOldTransform;
|
|
||||||
|
|
||||||
/// First element of the linked list of proxy collision shapes of this body
|
/// First element of the linked list of proxy collision shapes of this body
|
||||||
ProxyShape* mProxyCollisionShapes;
|
ProxyShape* mProxyCollisionShapes;
|
||||||
|
|
||||||
|
@ -102,9 +99,6 @@ class CollisionBody : public Body {
|
||||||
/// Remove all the collision shapes
|
/// Remove all the collision shapes
|
||||||
void removeAllCollisionShapes();
|
void removeAllCollisionShapes();
|
||||||
|
|
||||||
/// Update the old transform with the current one.
|
|
||||||
void updateOldTransform();
|
|
||||||
|
|
||||||
/// Update the broad-phase state for this body (because it has moved for instance)
|
/// Update the broad-phase state for this body (because it has moved for instance)
|
||||||
virtual void updateBroadPhaseState() const;
|
virtual void updateBroadPhaseState() const;
|
||||||
|
|
||||||
|
@ -241,12 +235,6 @@ inline void CollisionBody::setTransform(const Transform& transform) {
|
||||||
updateBroadPhaseState();
|
updateBroadPhaseState();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the old transform with the current one.
|
|
||||||
/// This is used to compute the interpolated position and orientation of the body
|
|
||||||
inline void CollisionBody::updateOldTransform() {
|
|
||||||
mOldTransform = mTransform;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the first element of the linked list of contact manifolds involving this body
|
// Return the first element of the linked list of contact manifolds involving this body
|
||||||
/**
|
/**
|
||||||
* @return A pointer to the first element of the linked-list with the contact
|
* @return A pointer to the first element of the linked-list with the contact
|
||||||
|
|
|
@ -328,9 +328,6 @@ void DynamicsWorld::integrateRigidBodiesVelocities() {
|
||||||
mConstrainedAngularVelocities[indexBody] *= clamp(angularDamping, decimal(0.0),
|
mConstrainedAngularVelocities[indexBody] *= clamp(angularDamping, decimal(0.0),
|
||||||
decimal(1.0));
|
decimal(1.0));
|
||||||
|
|
||||||
// Update the old Transform of the body
|
|
||||||
bodies[b]->updateOldTransform();
|
|
||||||
|
|
||||||
indexBody++;
|
indexBody++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user