Sdk/GraphicsComponent: Add Detach method

Former-commit-id: 08d5c0fa0d1cd09d6f58a0dfe75a3d952b62cae6 [formerly 75463d92e087e8791feda751fe2514c18fedf942]
Former-commit-id: aebd5945083f9339294077701093184f7700704b
This commit is contained in:
Lynix
2016-06-20 13:11:31 +02:00
parent daf1dadda0
commit 31f052d405
10 changed files with 56 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <algorithm>
#include "GraphicsComponent.hpp"
namespace Ndk
{
@@ -46,6 +47,18 @@ namespace Ndk
InvalidateBoundingVolume();
}
inline void GraphicsComponent::Detach(Nz::InstancedRenderableRef renderable)
{
for (auto it = m_renderables.begin(); it != m_renderables.end(); ++it)
{
if (it->renderable == renderable)
{
m_renderables.erase(it);
break;
}
}
}
inline void GraphicsComponent::EnsureBoundingVolumeUpdate() const
{
if (!m_boundingVolumeUpdated)