Add: [Get/Set]AngularDamping for standardization (#173)
* Update * Add: [Get/Set]AngularDaming for standardization
This commit is contained in:
@@ -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
|
||||
|
||||
21
include/Nazara/Physics2D/RigidBody2D.inl
Normal file
21
include/Nazara/Physics2D/RigidBody2D.inl
Normal 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>
|
||||
Reference in New Issue
Block a user