From 5702e5202c107eb90186e0576a0ece2711dfdb4f Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 29 Mar 2017 18:58:41 +0200 Subject: [PATCH] Components/GraphicsComponent: Add DoesRequireRealTimeReflections method --- SDK/include/NDK/Components/GraphicsComponent.hpp | 2 ++ SDK/include/NDK/Components/GraphicsComponent.inl | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/SDK/include/NDK/Components/GraphicsComponent.hpp b/SDK/include/NDK/Components/GraphicsComponent.hpp index 0b422c52a..f7cc20c5c 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.hpp +++ b/SDK/include/NDK/Components/GraphicsComponent.hpp @@ -42,6 +42,8 @@ namespace Ndk inline void Detach(const Nz::InstancedRenderable* renderable); + inline bool DoesRequireRealTimeReflections() const; + inline void EnsureBoundingVolumeUpdate() const; inline void EnsureTransformMatrixUpdate() const; diff --git a/SDK/include/NDK/Components/GraphicsComponent.inl b/SDK/include/NDK/Components/GraphicsComponent.inl index 81d9b121f..f6bc01f2e 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.inl +++ b/SDK/include/NDK/Components/GraphicsComponent.inl @@ -84,6 +84,18 @@ namespace Ndk } } + /*! + * \brief Checks if this graphics component requires real-time reflections to be generated + * + * If any of the materials attached to a GraphicsComponent (via the attached instanced renderable) needs real-time reflections, this function will return true. + * + * \return True if real-time reflections needs to be generated or false + */ + inline bool GraphicsComponent::DoesRequireRealTimeReflections() const + { + return m_reflectiveMaterialCount != 0; + } + /*! * \brief Ensures the bounding volume is up to date */