summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorm4nu3lf <m4nu3lf@gmail.com>2017-09-16 17:50:46 +0100
committerm4nu3lf <m4nu3lf@gmail.com>2017-09-22 20:05:02 +0100
commitd4452e3a653c9539ea753cb152d82f30b7a9a126 (patch)
tree505ffb51ba6115e98006dcc3ab5c69885c590a4d /servers
parentcc30e2a9a503f4b13eb25af2a552a029d6de815b (diff)
Fix Inertia tensor update & Generic 6DOF Joint
Diffstat (limited to 'servers')
-rw-r--r--servers/physics/body_sw.cpp5
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.cpp2
2 files changed, 4 insertions, 3 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() {
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp
index 70cc549e2d..551adc7d2e 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.cpp
+++ b/servers/physics/joints/generic_6dof_joint_sw.cpp
@@ -219,7 +219,7 @@ Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform
}
void Generic6DOFJointSW::calculateAngleInfo() {
- Basis relative_frame = m_calculatedTransformA.basis.inverse() * m_calculatedTransformB.basis;
+ Basis relative_frame = m_calculatedTransformB.basis.inverse() * m_calculatedTransformA.basis;
m_calculatedAxisAngleDiff = relative_frame.get_euler();