Allow to change the gravity vector of the DynamicsWorld

This commit is contained in:
Daniel Chappuis 2015-06-29 23:35:50 +02:00
parent 39ddabb6f5
commit 80cf65ccf2

View File

@ -220,6 +220,9 @@ class DynamicsWorld : public CollisionWorld {
/// Return the gravity vector of the world
Vector3 getGravity() const;
/// Set the gravity vector of the world
void setGravity(Vector3& gravity);
/// Return if the gravity is on
bool isGravityEnabled() const;
@ -366,6 +369,14 @@ inline Vector3 DynamicsWorld::getGravity() const {
return mGravity;
}
// Set the gravity vector of the world
/**
* @param gravity The gravity vector (in meter per seconds squared)
*/
inline Vector3 DynamicsWorld::setGravity(Vector3& gravity) {
mGravity = gravity;
}
// Return if the gravity is enaled
/**
* @return True if the gravity is enabled in the world