Add: [Get/Set]AngularDamping for standardization (#173)

* Update

* Add: [Get/Set]AngularDaming for standardization
This commit is contained in:
Faymoon 2018-07-31 13:24:19 +02:00 committed by Jérôme Leclercq
parent 7b6cc47e03
commit abedc30747
2 changed files with 25 additions and 0 deletions

View File

@ -41,6 +41,7 @@ namespace Nz
void EnableSimulation(bool simulation);
Rectf GetAABB() const;
inline float GetAngularDamping() const;
float GetAngularVelocity() const;
Vector2f GetCenterOfGravity(CoordSys coordSys = CoordSys_Local) const;
const Collider2DRef& GetGeom() const;
@ -59,6 +60,7 @@ namespace Nz
bool IsSleeping() const;
bool IsStatic() const;
inline void SetAngularDamping(float angularDamping);
void SetAngularVelocity(float angularVelocity);
void SetGeom(Collider2DRef geom, bool recomputeMoment = true);
void SetMass(float mass, bool recomputeMoment = true);
@ -99,4 +101,6 @@ namespace Nz
};
}
#include <Nazara/Physics2D/RigidBody2D.inl>
#endif // NAZARA_RIGIDBODY2D_HPP

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Physics 2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Physics2D/RigidBody2D.hpp>
#include <Nazara/Physics2D/Debug.hpp>
namespace Nz
{
inline float RigidBody2D::GetAngularDamping() const
{
return GetMomentOfInertia();
}
inline void RigidBody2D::SetAngularDamping(float angularDamping)
{
SetMomentOfInertia(angularDamping);
}
}
#include <Nazara/Physics2D/DebugOff.hpp>