Sdk/GraphicsComponent: Add Clear method
Former-commit-id: adcb195b1865ffdde91dcc1859005e82e5f2d047 [formerly c1886292500dfe3664f6f998de5b77f5d5e52f87] Former-commit-id: f24214e506c412dd9c330e33c53727b59c3c1b93
This commit is contained in:
parent
29a819f7b9
commit
31ce28a177
|
|
@ -31,7 +31,9 @@ namespace Ndk
|
||||||
|
|
||||||
inline void Attach(Nz::InstancedRenderableRef renderable, int renderOrder = 0);
|
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 EnsureBoundingVolumeUpdate() const;
|
||||||
inline void EnsureTransformMatrixUpdate() const;
|
inline void EnsureTransformMatrixUpdate() const;
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,20 @@ namespace Ndk
|
||||||
InvalidateBoundingVolume();
|
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)
|
for (auto it = m_renderables.begin(); it != m_renderables.end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->renderable == renderable)
|
if (it->renderable == renderable)
|
||||||
{
|
{
|
||||||
|
InvalidateBoundingVolume();
|
||||||
m_renderables.erase(it);
|
m_renderables.erase(it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue