Sdk/GraphicsComponent: Add methods to update local matrix and render order
This commit is contained in:
parent
f6fe589b03
commit
e3514db87f
|
|
@ -51,6 +51,9 @@ namespace Ndk
|
||||||
|
|
||||||
inline void RemoveFromCullingList(GraphicsComponentCullingList* cullingList) const;
|
inline void RemoveFromCullingList(GraphicsComponentCullingList* cullingList) const;
|
||||||
|
|
||||||
|
inline void UpdateLocalMatrix(const Nz::InstancedRenderable* instancedRenderable, const Nz::Matrix4f& localMatrix);
|
||||||
|
inline void UpdateRenderOrder(const Nz::InstancedRenderable* instancedRenderable, int renderOrder);
|
||||||
|
|
||||||
static ComponentIndex componentIndex;
|
static ComponentIndex componentIndex;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,32 @@ namespace Ndk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void GraphicsComponent::UpdateLocalMatrix(const Nz::InstancedRenderable* instancedRenderable, const Nz::Matrix4f& localMatrix)
|
||||||
|
{
|
||||||
|
for (auto& renderable : m_renderables)
|
||||||
|
{
|
||||||
|
if (renderable.renderable == instancedRenderable)
|
||||||
|
{
|
||||||
|
renderable.data.localMatrix = localMatrix;
|
||||||
|
|
||||||
|
InvalidateBoundingVolume();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void GraphicsComponent::UpdateRenderOrder(const Nz::InstancedRenderable* instancedRenderable, int renderOrder)
|
||||||
|
{
|
||||||
|
for (auto& renderable : m_renderables)
|
||||||
|
{
|
||||||
|
if (renderable.renderable == instancedRenderable)
|
||||||
|
{
|
||||||
|
renderable.data.renderOrder = renderOrder;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Invalidates the bounding volume
|
* \brief Invalidates the bounding volume
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue