diff --git a/src/FDM/YASim/RigidBody.cpp b/src/FDM/YASim/RigidBody.cpp index e1fb94b70..495098525 100644 --- a/src/FDM/YASim/RigidBody.cpp +++ b/src/FDM/YASim/RigidBody.cpp @@ -55,13 +55,12 @@ void RigidBody::setMass(int handle, float mass) void RigidBody::setMass(int handle, float mass, const float* pos, bool isStatic) { - _masses[handle].m = mass; _masses[handle].isStatic = isStatic; Math::set3(pos, _masses[handle].p); + setMass(handle, mass); if (_bodyN != 0) { SGPropertyNode_ptr n = _bodyN->getChild("mass", handle, true); n->getNode("isStatic", true)->setValue(isStatic); - n->getNode("mass", true)->setFloatValue(mass); n->getNode("pos-x", true)->setFloatValue(pos[0]); n->getNode("pos-y", true)->setFloatValue(pos[1]); n->getNode("pos-z", true)->setFloatValue(pos[2]); diff --git a/src/FDM/YASim/RigidBody.hpp b/src/FDM/YASim/RigidBody.hpp index d7ca39939..4b982e070 100644 --- a/src/FDM/YASim/RigidBody.hpp +++ b/src/FDM/YASim/RigidBody.hpp @@ -82,7 +82,7 @@ public: void setBodySpin(const float* rotation) { Math::set3(rotation, _spin); } // Returns the center of gravity of the masses, in the body - // coordinate system. + // coordinate system. valid only after recalc() void getCG(float* cgOut) { Math::set3(_cg, cgOut); } // Returns the acceleration of the body's c.g. relative to the