// Copyright (C) 2017 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 #include #include #include namespace Nz { class AbstractRenderQueue; class NAZARA_GRAPHICS_API Renderable { public: Renderable() = default; Renderable(const Renderable& renderable) = default; Renderable(Renderable&&) noexcept = 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) noexcept = default; protected: virtual void MakeBoundingVolume() const = 0; inline void InvalidateBoundingVolume(); mutable BoundingVolumef m_boundingVolume; private: inline void UpdateBoundingVolume() const; mutable bool m_boundingVolumeUpdated; }; } #include #endif // NAZARA_RENDERABLE_HPP