SDK/PhysicsComponent2D: Add missing parameter to SetMass

This commit is contained in:
Lynix
2018-10-20 23:52:32 +02:00
parent 5e45983953
commit 9674d7373c
3 changed files with 5 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ namespace Ndk
inline void SetElasticity(std::size_t shapeIndex, float friction);
inline void SetFriction(float friction);
inline void SetFriction(std::size_t shapeIndex, float friction);
inline void SetMass(float mass);
inline void SetMass(float mass, bool recomputeMoment = true);
inline void SetMassCenter(const Nz::Vector2f& center, Nz::CoordSys coordSys = Nz::CoordSys_Local);
inline void SetMomentOfInertia(float moment);
inline void SetPosition(const Nz::Vector2f& position);

View File

@@ -429,15 +429,16 @@ namespace Ndk
* \brief Sets the mass of the physics object
*
* \param mass Mass of the object
* \param recomputeMoment Should the moment of inertia be recomputed according to the new mass
*
* \remark Mass must be positive or zero
*/
inline void PhysicsComponent2D::SetMass(float mass)
inline void PhysicsComponent2D::SetMass(float mass, bool recomputeMoment)
{
NazaraAssert(m_object, "Invalid physics object");
NazaraAssert(mass >= 0.f, "Mass should be positive");
m_object->SetMass(mass);
m_object->SetMass(mass, recomputeMoment);
}
/*!