SDK/GraphicsComponent: Add ForEachRenderable method
This commit is contained in:
parent
bc2f6f67cc
commit
056bd0efdd
|
|
@ -159,6 +159,7 @@ Nazara Development Kit:
|
|||
- ⚠️ TextAreaWidget::GetHoveredGlyph now returns a two-dimensional position instead of a single glyph position
|
||||
- Fixed Entity::OnEntityDestruction signal not being properly moved and thus not being called.
|
||||
- Fixed EntityOwner move assignment which was losing entity ownership
|
||||
- Add GraphicsComponent:ForEachRenderable method
|
||||
|
||||
# 0.4:
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ namespace Ndk
|
|||
|
||||
inline bool DoesRequireRealTimeReflections() const;
|
||||
|
||||
template<typename Func> void ForEachRenderable(const Func& func) const;
|
||||
|
||||
inline void EnsureBoundingVolumeUpdate() const;
|
||||
inline void EnsureTransformMatrixUpdate() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,18 @@ namespace Ndk
|
|||
return m_reflectiveMaterialCount != 0 && m_reflectionMap;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Calls a function for every renderable attached to this component
|
||||
*
|
||||
* \param func Callback function which will be called with renderable data
|
||||
*/
|
||||
template<typename Func>
|
||||
void GraphicsComponent::ForEachRenderable(const Func& func) const
|
||||
{
|
||||
for (const auto& renderableData : m_renderables)
|
||||
func(renderableData.renderable, renderableData.data.localMatrix, renderableData.data.renderOrder);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Ensures the bounding volume is up to date
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue