Former-commit-id: 2741c465f9acb4a190de0a29db4a3853700461fd [formerly be67ee144fe577767a11be40f79f3f2e85d030c0] [formerly 302a6d2c8a3222401890d217f01c24a03db9ebc8 [formerly 762367a1144c340b84b61eee9d7577dcdaf717c6]] Former-commit-id: 6504b78e4ce04d8eea0c10e7ce27bdda4b95f2dc [formerly 8d0fba6c2dde5dcc43cbea0e6e5fd2980af4b801] Former-commit-id: 75d1deaf21035eb1b630705017462b9e059149a9
54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
// Copyright (C) 2015 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Graphics module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#pragma once
|
|
|
|
#ifndef NAZARA_RENDERABLE_HPP
|
|
#define NAZARA_RENDERABLE_HPP
|
|
|
|
#include <Nazara/Graphics/Config.hpp>
|
|
#include <Nazara/Math/BoundingVolume.hpp>
|
|
#include <Nazara/Math/Frustum.hpp>
|
|
#include <Nazara/Math/Matrix4.hpp>
|
|
|
|
namespace Nz
|
|
{
|
|
class AbstractRenderQueue;
|
|
|
|
class NAZARA_GRAPHICS_API Renderable
|
|
{
|
|
public:
|
|
Renderable() = default;
|
|
Renderable(const Renderable& renderable) = default;
|
|
Renderable(Renderable&&) = default;
|
|
virtual ~Renderable();
|
|
|
|
virtual void AddToRenderQueue(AbstractRenderQueue* renderQueue, const Matrix4f& transformMatrix) const = 0;
|
|
|
|
virtual bool Cull(const Frustumf& frustum, const Matrix4f& transformMatrix) const;
|
|
|
|
inline void EnsureBoundingVolumeUpdated() const;
|
|
virtual const BoundingVolumef& GetBoundingVolume() const;
|
|
virtual void UpdateBoundingVolume(const Matrix4f& transformMatrix);
|
|
|
|
Renderable& operator=(const Renderable& renderable) = default;
|
|
Renderable& operator=(Renderable&& renderable) = default;
|
|
|
|
protected:
|
|
virtual void MakeBoundingVolume() const = 0;
|
|
inline void InvalidateBoundingVolume();
|
|
|
|
mutable BoundingVolumef m_boundingVolume;
|
|
|
|
private:
|
|
inline void UpdateBoundingVolume() const;
|
|
|
|
mutable bool m_boundingVolumeUpdated;
|
|
};
|
|
}
|
|
|
|
#include <Nazara/Graphics/Renderable.inl>
|
|
|
|
#endif // NAZARA_RENDERABLE_HPP
|