Add: [Get/Set]AngularDamping for standardization (#173)
* Update * Add: [Get/Set]AngularDaming for standardization
This commit is contained in:
parent
7b6cc47e03
commit
abedc30747
|
|
@ -41,6 +41,7 @@ namespace Nz
|
||||||
void EnableSimulation(bool simulation);
|
void EnableSimulation(bool simulation);
|
||||||
|
|
||||||
Rectf GetAABB() const;
|
Rectf GetAABB() const;
|
||||||
|
inline float GetAngularDamping() const;
|
||||||
float GetAngularVelocity() const;
|
float GetAngularVelocity() const;
|
||||||
Vector2f GetCenterOfGravity(CoordSys coordSys = CoordSys_Local) const;
|
Vector2f GetCenterOfGravity(CoordSys coordSys = CoordSys_Local) const;
|
||||||
const Collider2DRef& GetGeom() const;
|
const Collider2DRef& GetGeom() const;
|
||||||
|
|
@ -59,6 +60,7 @@ namespace Nz
|
||||||
bool IsSleeping() const;
|
bool IsSleeping() const;
|
||||||
bool IsStatic() const;
|
bool IsStatic() const;
|
||||||
|
|
||||||
|
inline void SetAngularDamping(float angularDamping);
|
||||||
void SetAngularVelocity(float angularVelocity);
|
void SetAngularVelocity(float angularVelocity);
|
||||||
void SetGeom(Collider2DRef geom, bool recomputeMoment = true);
|
void SetGeom(Collider2DRef geom, bool recomputeMoment = true);
|
||||||
void SetMass(float mass, 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
|
#endif // NAZARA_RIGIDBODY2D_HPP
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
Loading…
Reference in New Issue