SDK/PhysicsComponent2D: Add missing parameter to SetMass
This commit is contained in:
parent
5e45983953
commit
9674d7373c
|
|
@ -221,6 +221,7 @@ Nazara Development Kit:
|
||||||
- PhysicsComponent2D now allows massless bodies (zero mass)
|
- PhysicsComponent2D now allows massless bodies (zero mass)
|
||||||
- ⚠️ Use of the new Angle class instead of floating point angle
|
- ⚠️ Use of the new Angle class instead of floating point angle
|
||||||
- Added EntityOwner::Release
|
- Added EntityOwner::Release
|
||||||
|
- Add missing `recomputeMoment` parameter to PhysicsComponent2D::SetMass
|
||||||
|
|
||||||
# 0.4:
|
# 0.4:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ namespace Ndk
|
||||||
inline void SetElasticity(std::size_t shapeIndex, float friction);
|
inline void SetElasticity(std::size_t shapeIndex, float friction);
|
||||||
inline void SetFriction(float friction);
|
inline void SetFriction(float friction);
|
||||||
inline void SetFriction(std::size_t shapeIndex, 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 SetMassCenter(const Nz::Vector2f& center, Nz::CoordSys coordSys = Nz::CoordSys_Local);
|
||||||
inline void SetMomentOfInertia(float moment);
|
inline void SetMomentOfInertia(float moment);
|
||||||
inline void SetPosition(const Nz::Vector2f& position);
|
inline void SetPosition(const Nz::Vector2f& position);
|
||||||
|
|
|
||||||
|
|
@ -429,15 +429,16 @@ namespace Ndk
|
||||||
* \brief Sets the mass of the physics object
|
* \brief Sets the mass of the physics object
|
||||||
*
|
*
|
||||||
* \param mass Mass of the 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
|
* \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(m_object, "Invalid physics object");
|
||||||
NazaraAssert(mass >= 0.f, "Mass should be positive");
|
NazaraAssert(mass >= 0.f, "Mass should be positive");
|
||||||
|
|
||||||
m_object->SetMass(mass);
|
m_object->SetMass(mass, recomputeMoment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue