Graphics/GraphicsComponent: Add constructor taking an instanced renderable

This commit is contained in:
SirLynix 2023-04-05 08:51:58 +02:00
parent 40b6102977
commit 3cf50221c5
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@ namespace Nz
static constexpr std::size_t MaxRenderableCount = 8;
inline GraphicsComponent(bool initiallyVisible = true);
inline GraphicsComponent(std::shared_ptr<InstancedRenderable> renderable, UInt32 renderMask = 0xFFFFFFFF, bool initiallyVisible = true);
GraphicsComponent(const GraphicsComponent&) = default;
GraphicsComponent(GraphicsComponent&&) = default;
~GraphicsComponent() = default;

View File

@ -12,6 +12,12 @@ namespace Nz
{
m_worldInstance = std::make_shared<WorldInstance>(); //< FIXME: Use pools
}
inline GraphicsComponent::GraphicsComponent(std::shared_ptr<InstancedRenderable> renderable, UInt32 renderMask, bool initiallyVisible) :
GraphicsComponent(initiallyVisible)
{
AttachRenderable(std::move(renderable), renderMask);
}
inline void GraphicsComponent::AttachRenderable(std::shared_ptr<InstancedRenderable> renderable, UInt32 renderMask)
{