Sdk/GraphicsComponent: Add Detach method
Former-commit-id: b80b7e52f4736f61c439a4242531adaefbdb75a2 [formerly 2c336b6480ae9a11ca1104ee1140e8f449bb2a02] Former-commit-id: 54f77c634ce1f9bfc93a00d9a14567bd25a06b26
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user