diff --git a/SDK/include/NDK/Components/GraphicsComponent.hpp b/SDK/include/NDK/Components/GraphicsComponent.hpp index d6f565960..7450c2f6e 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.hpp +++ b/SDK/include/NDK/Components/GraphicsComponent.hpp @@ -8,16 +8,28 @@ #define NDK_COMPONENTS_GRAPHICSCOMPONENT_HPP #include +#include namespace Ndk { class NDK_API GraphicsComponent : public Component { public: - GraphicsComponent(); + GraphicsComponent() = default; ~GraphicsComponent() = default; + void AddToRenderQueue(NzAbstractRenderQueue* renderQueue, const NzMatrix4f& transformMatrix) const; + static ComponentIndex componentIndex; + + private: + struct Renderable + { + NzBoundingVolumef volume; + NzRenderableRef renderable; + }; + + std::vector m_renderables; }; } diff --git a/SDK/include/NDK/Components/GraphicsComponent.inl b/SDK/include/NDK/Components/GraphicsComponent.inl index e5f296d27..5d4479ac1 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.inl +++ b/SDK/include/NDK/Components/GraphicsComponent.inl @@ -1,3 +1,12 @@ // Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequesites.hpp + +namespace Ndk +{ + inline void GraphicsComponent::AddToRenderQueue(NzAbstractRenderQueue* renderQueue, const NzMatrix4f& transformMatrix) const + { + for (const Renderable& object : m_renderables) + object.renderable->AddToRenderQueue(renderQueue, transformMatrix); + } +} diff --git a/include/Nazara/Graphics/AbstractViewer.hpp b/include/Nazara/Graphics/AbstractViewer.hpp index 50ea34e24..65f3868fb 100644 --- a/include/Nazara/Graphics/AbstractViewer.hpp +++ b/include/Nazara/Graphics/AbstractViewer.hpp @@ -28,9 +28,6 @@ class NAZARA_API NzAbstractViewer virtual NzVector3f GetEyePosition() const = 0; virtual NzVector3f GetForward() const = 0; virtual const NzFrustumf& GetFrustum() const = 0; - virtual NzVector3f GetGlobalForward() const = 0; - virtual NzVector3f GetGlobalRight() const = 0; - virtual NzVector3f GetGlobalUp() const = 0; virtual const NzMatrix4f& GetProjectionMatrix() const = 0; virtual const NzRenderTarget* GetTarget() const = 0; virtual const NzMatrix4f& GetViewMatrix() const = 0;