Ndk/GraphicsComponent: Update
Former-commit-id: 4f4ca46fb58582abb0c61b7f081b77e9cd95ee0f
This commit is contained in:
parent
2d0cf1794e
commit
11e7748d85
|
|
@ -8,16 +8,28 @@
|
||||||
#define NDK_COMPONENTS_GRAPHICSCOMPONENT_HPP
|
#define NDK_COMPONENTS_GRAPHICSCOMPONENT_HPP
|
||||||
|
|
||||||
#include <NDK/Component.hpp>
|
#include <NDK/Component.hpp>
|
||||||
|
#include <Nazara/Graphics/Renderable.hpp>
|
||||||
|
|
||||||
namespace Ndk
|
namespace Ndk
|
||||||
{
|
{
|
||||||
class NDK_API GraphicsComponent : public Component<GraphicsComponent>
|
class NDK_API GraphicsComponent : public Component<GraphicsComponent>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GraphicsComponent();
|
GraphicsComponent() = default;
|
||||||
~GraphicsComponent() = default;
|
~GraphicsComponent() = default;
|
||||||
|
|
||||||
|
void AddToRenderQueue(NzAbstractRenderQueue* renderQueue, const NzMatrix4f& transformMatrix) const;
|
||||||
|
|
||||||
static ComponentIndex componentIndex;
|
static ComponentIndex componentIndex;
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct Renderable
|
||||||
|
{
|
||||||
|
NzBoundingVolumef volume;
|
||||||
|
NzRenderableRef renderable;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<Renderable> m_renderables;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,12 @@
|
||||||
// Copyright (C) 2015 Jérôme Leclercq
|
// Copyright (C) 2015 Jérôme Leclercq
|
||||||
// This file is part of the "Nazara Development Kit"
|
// This file is part of the "Nazara Development Kit"
|
||||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,6 @@ class NAZARA_API NzAbstractViewer
|
||||||
virtual NzVector3f GetEyePosition() const = 0;
|
virtual NzVector3f GetEyePosition() const = 0;
|
||||||
virtual NzVector3f GetForward() const = 0;
|
virtual NzVector3f GetForward() const = 0;
|
||||||
virtual const NzFrustumf& GetFrustum() 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 NzMatrix4f& GetProjectionMatrix() const = 0;
|
||||||
virtual const NzRenderTarget* GetTarget() const = 0;
|
virtual const NzRenderTarget* GetTarget() const = 0;
|
||||||
virtual const NzMatrix4f& GetViewMatrix() const = 0;
|
virtual const NzMatrix4f& GetViewMatrix() const = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue