diff --git a/SDK/include/NDK/Components/PhysicsComponent2D.hpp b/SDK/include/NDK/Components/PhysicsComponent2D.hpp index 63abb6c40..93383d707 100644 --- a/SDK/include/NDK/Components/PhysicsComponent2D.hpp +++ b/SDK/include/NDK/Components/PhysicsComponent2D.hpp @@ -61,6 +61,7 @@ namespace Ndk inline bool IsNodeSynchronizationEnabled() const; inline bool IsSleeping() const; + inline bool IsValid() const; inline void ResetVelocityFunction(); diff --git a/SDK/include/NDK/Components/PhysicsComponent2D.inl b/SDK/include/NDK/Components/PhysicsComponent2D.inl index 6a4ae478a..f30dd8618 100644 --- a/SDK/include/NDK/Components/PhysicsComponent2D.inl +++ b/SDK/include/NDK/Components/PhysicsComponent2D.inl @@ -382,6 +382,18 @@ namespace Ndk return m_object->IsSleeping(); } + /*! + * \brief Checks if this component is bound to a valid rigid body + * + * A component may not be bound to a rigid body if the component is not bound to an entity or if this entity is being destroyed + * + * \return true If bound, false otherwise + */ + inline bool PhysicsComponent2D::IsValid() const + { + return bool(m_object); + } + /*! * \brief Reset velocity function to default one *