Rework constraint2D
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
// Copyright (C) 2019 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequisites.hpp
|
||||
|
||||
#include <NDK/Components/ConstraintComponent2D.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
ConstraintComponent2D::ConstraintComponent2D(const ConstraintComponent2D& /*joint*/)
|
||||
{
|
||||
}
|
||||
|
||||
bool ConstraintComponent2D::RemoveConstraint(Nz::Constraint2D* constraintPtr)
|
||||
{
|
||||
auto it = std::find_if(m_constraints.begin(), m_constraints.end(), [constraintPtr](const ConstraintData& constraintData) { return constraintData.constraint.get() == constraintPtr; });
|
||||
if (it != m_constraints.end())
|
||||
m_constraints.erase(it);
|
||||
|
||||
return !m_constraints.empty();
|
||||
}
|
||||
|
||||
ComponentIndex ConstraintComponent2D::componentIndex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user