// Copyright (C) 2013 Jérôme Leclercq // This file is part of the "Nazara Engine - Mathematics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_ORIENTEDBOX_HPP #define NAZARA_ORIENTEDBOX_HPP #include #include #include #include template class NzOrientedBox { public: NzOrientedBox() = default; NzOrientedBox(T X, T Y, T Z, T Width, T Height, T Depth); NzOrientedBox(const NzBox& box); NzOrientedBox(const NzVector3& vec1, const NzVector3& vec2); template explicit NzOrientedBox(const NzOrientedBox& orientedBox); NzOrientedBox(const NzOrientedBox& orientedBox) = default; ~NzOrientedBox() = default; const NzVector3& GetCorner(nzCorner corner) const; bool IsValid() const; NzOrientedBox& MakeZero(); NzOrientedBox& Set(T X, T Y, T Z, T Width, T Height, T Depth); NzOrientedBox& Set(const NzBox& box); NzOrientedBox& Set(const NzOrientedBox& orientedBox); NzOrientedBox& Set(const NzVector3& vec1, const NzVector3& vec2); template NzOrientedBox& Set(const NzOrientedBox& orientedBox); NzString ToString() const; void Update(const NzMatrix4& transformMatrix); operator NzVector3*(); operator const NzVector3*() const; NzVector3& operator()(unsigned int i); NzVector3 operator()(unsigned int i) const; NzOrientedBox operator*(T scalar) const; NzOrientedBox& operator*=(T scalar); bool operator==(const NzOrientedBox& box) const; bool operator!=(const NzOrientedBox& box) const; static NzOrientedBox Lerp(const NzOrientedBox& from, const NzOrientedBox& to, T interpolation); static NzOrientedBox Zero(); NzBox localBox; private: NzVector3 m_corners[nzCorner_Max+1]; // Ne peuvent pas être modifiés directement }; template std::ostream& operator<<(std::ostream& out, const NzOrientedBox& orientedBox); typedef NzOrientedBox NzOrientedBoxd; typedef NzOrientedBox NzOrientedBoxf; #include #endif // NAZARA_ORIENTEDBOX_HPP