summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorJohan Manuel <johan.manuel@live.fr>2017-07-04 14:57:15 +0200
committerJohan Manuel <johan.manuel@live.fr>2017-07-05 15:14:12 +0200
commit00afca31c65812ecc5dfe6c4c92627c476ea8ea5 (patch)
treeb389c4fe6e25f296f03b6a723fbb59216291f2ac /scene/3d
parent6f63a01302355077af2459c96a17e299c32b2960 (diff)
Use the gravity constant to calculate weights
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/physics_body.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index 2a7a804470..718daab75a 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -520,11 +520,11 @@ real_t RigidBody::get_mass() const {
void RigidBody::set_weight(real_t p_weight) {
- set_mass(p_weight / 9.8);
+ set_mass(p_weight / real_t(GLOBAL_DEF("physics/3d/default_gravity", 9.8)));
}
real_t RigidBody::get_weight() const {
- return mass * 9.8;
+ return mass * real_t(GLOBAL_DEF("physics/3d/default_gravity", 9.8));
}
void RigidBody::set_friction(real_t p_friction) {