Sdk/GraphicsComponent: Add Clear method
Former-commit-id: 7a00890f7ac8d3e41a292c40729cbf82d67e36bf [formerly 4f374228719546822f1aca22740cad962b77725e] Former-commit-id: d10271976c1128f0f9479fb1c9b245d1189e3604
This commit is contained in:
@@ -31,7 +31,9 @@ namespace Ndk
|
||||
|
||||
inline void Attach(Nz::InstancedRenderableRef renderable, int renderOrder = 0);
|
||||
|
||||
inline void Detach(Nz::InstancedRenderableRef renderable);
|
||||
inline void Clear();
|
||||
|
||||
inline void Detach(const Nz::InstancedRenderableRef& renderable);
|
||||
|
||||
inline void EnsureBoundingVolumeUpdate() const;
|
||||
inline void EnsureTransformMatrixUpdate() const;
|
||||
|
||||
@@ -47,12 +47,20 @@ namespace Ndk
|
||||
InvalidateBoundingVolume();
|
||||
}
|
||||
|
||||
inline void GraphicsComponent::Detach(Nz::InstancedRenderableRef renderable)
|
||||
inline void GraphicsComponent::Clear()
|
||||
{
|
||||
m_renderables.clear();
|
||||
|
||||
InvalidateBoundingVolume();
|
||||
}
|
||||
|
||||
inline void GraphicsComponent::Detach(const Nz::InstancedRenderableRef& renderable)
|
||||
{
|
||||
for (auto it = m_renderables.begin(); it != m_renderables.end(); ++it)
|
||||
{
|
||||
if (it->renderable == renderable)
|
||||
{
|
||||
InvalidateBoundingVolume();
|
||||
m_renderables.erase(it);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user