// 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_BILLBOARD_HPP #define NAZARA_BILLBOARD_HPP #include #include #include class NzBillboard; using NzBillboardConstRef = NzObjectRef; using NzBillboardLibrary = NzObjectLibrary; using NzBillboardRef = NzObjectRef; class NAZARA_GRAPHICS_API NzBillboard : public NzInstancedRenderable { public: inline NzBillboard(); inline NzBillboard(NzMaterialRef material); inline NzBillboard(NzTexture* texture); inline NzBillboard(const NzBillboard& billboard); ~NzBillboard() = default; void AddToRenderQueue(NzAbstractRenderQueue* renderQueue, const InstanceData& instanceData) const override; inline const NzColor& GetColor() const; inline const NzMaterialRef& GetMaterial() const; inline float GetRotation() const; inline const NzVector2f& GetSize() const; inline void SetColor(const NzColor& color); inline void SetDefaultMaterial(); inline void SetMaterial(NzMaterialRef material, bool resizeBillboard = true); inline void SetRotation(float rotation); inline void SetSize(const NzVector2f& size); inline void SetSize(float sizeX, float sizeY); inline void SetTexture(NzTextureRef texture, bool resizeBillboard = true); inline NzBillboard& operator=(const NzBillboard& billboard); template static NzBillboardRef New(Args&&... args); private: void MakeBoundingVolume() const override; NzColor m_color; NzMaterialRef m_material; NzVector2f m_sinCos; NzVector2f m_size; float m_rotation; static NzBillboardLibrary::LibraryMap s_library; }; #include #endif // NAZARA_BILLBOARD_HPP