Ndk/GraphicsComponent: Add GetAttachedRenderables
Former-commit-id: 6a5a017caf0af3fd5c40ead7d67d30b640eba243 [formerly 2796343e15655263669366fc7dd5ff8b3ca65d76] Former-commit-id: 7738d1c5a929d3cd1261aaa1c9899bddf0ad1541
This commit is contained in:
parent
068465b6b9
commit
3b1dddf26d
|
|
@ -23,6 +23,8 @@ namespace Ndk
|
|||
friend class RenderSystem;
|
||||
|
||||
public:
|
||||
using RenderableList = std::vector<Nz::InstancedRenderableRef>;
|
||||
|
||||
GraphicsComponent() = default;
|
||||
inline GraphicsComponent(const GraphicsComponent& graphicsComponent);
|
||||
~GraphicsComponent() = default;
|
||||
|
|
@ -38,6 +40,9 @@ namespace Ndk
|
|||
inline void EnsureBoundingVolumeUpdate() const;
|
||||
inline void EnsureTransformMatrixUpdate() const;
|
||||
|
||||
inline void GetAttachedRenderables(Nz::InstancedRenderableRef* renderables) const;
|
||||
inline std::size_t GetAttachedRenderableCount() const;
|
||||
|
||||
inline const Nz::BoundingVolumef& GetBoundingVolume() const;
|
||||
|
||||
static ComponentIndex componentIndex;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,20 @@ namespace Ndk
|
|||
UpdateTransformMatrix();
|
||||
}
|
||||
|
||||
inline void GraphicsComponent::GetAttachedRenderables(RenderableList* renderables) const
|
||||
{
|
||||
NazaraAssert(renderables, "Invalid renderable list");
|
||||
|
||||
renderables->reserve(renderables->size() + m_renderables.size());
|
||||
for (const Renderable& r : m_renderables)
|
||||
renderables->push_back(r.renderable);
|
||||
}
|
||||
|
||||
inline std::size_t GraphicsComponent::GetAttachedRenderableCount() const
|
||||
{
|
||||
return m_renderables.size();
|
||||
}
|
||||
|
||||
inline const Nz::BoundingVolumef& GraphicsComponent::GetBoundingVolume() const
|
||||
{
|
||||
EnsureBoundingVolumeUpdate();
|
||||
|
|
|
|||
Loading…
Reference in New Issue