Add AddImpulse for PhysicsComponent2D (#141)
* Update PhysicsComponent2D.hpp * Update LuaBinding_SDK.hpp * Update LuaBinding_SDK.cpp * Update LuaBinding_SDK.cpp * Add : AddImpulse * Add : AddImpulse * Add : binding of PhysicsComponent2D * add : handle * fix alphabetical order * complete PhysicsComponent2D binding * Update LuaBinding_SDK.cpp * Update LuaBinding_SDK.hpp * Update PhysicsComponent2D.hpp * Update PhysicsComponent2D.inl * forgot : use namespace Nz and open namespace Ndk * Update PhysicsComponent2D.hpp * Add Addimpulse * Update PhysicsComponent3D.hpp
This commit is contained in:
parent
f991a9529e
commit
06ac8cf904
|
|
@ -25,6 +25,8 @@ namespace Ndk
|
|||
|
||||
void AddForce(const Nz::Vector2f& force, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
void AddForce(const Nz::Vector2f& force, const Nz::Vector2f& point, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
void AddImpulse(const Nz::Vector2f& impulse, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
void AddImpulse(const Nz::Vector2f& impulse, const Nz::Vector2f& point, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
void AddTorque(float torque);
|
||||
|
||||
Nz::Rectf GetAABB() const;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,37 @@ namespace Ndk
|
|||
m_object->AddForce(force, point, coordSys);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Applies a impulse to the entity
|
||||
*
|
||||
* \param impulse Impulse to apply on the entity
|
||||
*
|
||||
* \remark Produces a NazaraAssert if the physics object is invalid
|
||||
*/
|
||||
|
||||
inline void PhysicsComponent2D::AddImpulse(const Nz::Vector2f& impulse, Nz::CoordSys coordSys)
|
||||
{
|
||||
NazaraAssert(m_object, "Invalid physics object");
|
||||
|
||||
m_object->AddImpulse(impulse, coordSys);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Applies a impulse to the entity
|
||||
*
|
||||
* \param impulse Impulse to apply on the entity
|
||||
* \param point Point where the impulse is applied
|
||||
*
|
||||
* \remark Produces a NazaraAssert if the physics object is invalid
|
||||
*/
|
||||
|
||||
inline void PhysicsComponent2D::AddImpulse(const Nz::Vector2f& impulse, const Nz::Vector2f& point, Nz::CoordSys coordSys)
|
||||
{
|
||||
NazaraAssert(m_object, "Invalid physics object");
|
||||
|
||||
m_object->AddImpulse(impulse, point, coordSys);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Applies a torque to the entity
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2017 Jérôme Leclercq, Arnaud Cadot
|
||||
// Copyright (C) 2017 Jérôme Leclercq, Arnaud Cadot
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue