From 80cf65ccf2c25c2d710a891a2c448ded82c39254 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Mon, 29 Jun 2015 23:35:50 +0200 Subject: [PATCH] Allow to change the gravity vector of the DynamicsWorld --- src/engine/DynamicsWorld.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/engine/DynamicsWorld.h b/src/engine/DynamicsWorld.h index 482bc66e..975bf661 100644 --- a/src/engine/DynamicsWorld.h +++ b/src/engine/DynamicsWorld.h @@ -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