summaryrefslogtreecommitdiff
path: root/servers/physics/body_sw.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-31 23:03:01 +0100
committerGitHub <noreply@github.com>2017-10-31 23:03:01 +0100
commitcb3f594b148e33bebf99955c0bb7dce02c8a50c7 (patch)
treef47a6dc447a83c323c7946ad178420ac66588c36 /servers/physics/body_sw.cpp
parent24b3733f3bc416f62d353d279733cfaab606f918 (diff)
parent3df217b1a166e2a6ed836a5bc12d05239fdce3c8 (diff)
Merge pull request #11249 from m4nu3lf/bugfix/get_euler
Fix inertia tensor update & Generic6DOFJoint & Simplify Basis::get_euler()
Diffstat (limited to 'servers/physics/body_sw.cpp')
-rw-r--r--servers/physics/body_sw.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index 46a5192e52..6ced004118 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -45,8 +45,9 @@ void BodySW::_update_transform_dependant() {
// update inertia tensor
Basis tb = principal_inertia_axes;
Basis tbt = tb.transposed();
- tb.scale(_inv_inertia);
- _inv_inertia_tensor = tb * tbt;
+ Basis diag;
+ diag.scale(_inv_inertia);
+ _inv_inertia_tensor = tb * diag * tbt;
}
void BodySW::update_inertias() {