// 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_ORIENTEDCUBE_HPP #define NAZARA_ORIENTEDCUBE_HPP #include #include #include #include template class NzOrientedCube { public: NzOrientedCube() = default; NzOrientedCube(T X, T Y, T Z, T Width, T Height, T Depth); NzOrientedCube(const NzCube& cube); NzOrientedCube(const NzVector3& vec1, const NzVector3& vec2); template explicit NzOrientedCube(const NzOrientedCube& orientedCube); NzOrientedCube(const NzOrientedCube& orientedCube) = default; ~NzOrientedCube() = default; const NzVector3& GetCorner(nzCorner corner) const; bool IsValid() const; NzOrientedCube& MakeZero(); NzOrientedCube& Set(T X, T Y, T Z, T Width, T Height, T Depth); NzOrientedCube& Set(const NzCube& cube); NzOrientedCube& Set(const NzOrientedCube& orientedCube); NzOrientedCube& Set(const NzVector3& vec1, const NzVector3& vec2); template NzOrientedCube& Set(const NzOrientedCube& orientedCube); 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; NzOrientedCube operator*(T scalar) const; NzOrientedCube& operator*=(T scalar); bool operator==(const NzOrientedCube& cube) const; bool operator!=(const NzOrientedCube& cube) const; static NzOrientedCube Lerp(const NzOrientedCube& from, const NzOrientedCube& to, T interpolation); static NzOrientedCube Zero(); NzCube localCube; private: NzVector3 m_corners[nzCorner_Max+1]; // Ne peuvent pas être modifiés directement }; template std::ostream& operator<<(std::ostream& out, const NzOrientedCube& orientedCube); typedef NzOrientedCube NzOrientedCubed; typedef NzOrientedCube NzOrientedCubef; #include #endif // NAZARA_ORIENTEDCUBE_HPP