// Copyright (C) 2012 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 #ifndef NAZARA_AXISALIGNEDBOX_HPP #define NAZARA_AXISALIGNEDBOX_HPP #include #include #include #include #include template class NzAxisAlignedBox { public: NzAxisAlignedBox(); NzAxisAlignedBox(nzExtend Extend); NzAxisAlignedBox(T X, T Y, T Z, T Width, T Height, T Depth); NzAxisAlignedBox(const NzCube& Cube); NzAxisAlignedBox(const NzVector3& vec1, const NzVector3& vec2); template explicit NzAxisAlignedBox(const NzAxisAlignedBox& box); NzAxisAlignedBox(const NzAxisAlignedBox& box) = default; ~NzAxisAlignedBox() = default; bool Contains(T X, T Y, T Z) const; bool Contains(const NzAxisAlignedBox& box) const; bool Contains(const NzVector3& vector) const; NzAxisAlignedBox& ExtendTo(T X, T Y, T Z); NzAxisAlignedBox& ExtendTo(const NzAxisAlignedBox& box); NzAxisAlignedBox& ExtendTo(const NzVector3& vector); NzVector3 GetCorner(nzCorner corner) const; NzVector3 GetCenter() const; NzCube GetCube() const; nzExtend GetExtend() const; NzVector3 GetNegativeVertex(const NzVector3& normal) const; NzVector3 GetPosition() const; NzVector3 GetPositiveVertex(const NzVector3& normal) const; NzVector3 GetSize() const; bool Intersect(const NzAxisAlignedBox& box, NzAxisAlignedBox* intersection = nullptr) const; bool IsFinite() const; bool IsInfinite() const; bool IsNull() const; NzAxisAlignedBox& MakeInfinite(); NzAxisAlignedBox& MakeNull(); NzAxisAlignedBox& Set(nzExtend Extend); NzAxisAlignedBox& Set(T X, T Y, T Z, T Width, T Height, T Depth); NzAxisAlignedBox& Set(const NzAxisAlignedBox& box); NzAxisAlignedBox& Set(const NzCube& Cube); NzAxisAlignedBox& Set(const NzVector3& vec1, const NzVector3& vec2); template NzAxisAlignedBox& Set(const NzAxisAlignedBox& box); NzString ToString() const; NzAxisAlignedBox& Transform(const NzMatrix4& matrix, bool applyTranslation = true); NzAxisAlignedBox operator*(T scalar) const; NzAxisAlignedBox& operator*=(T scalar); bool operator==(const NzAxisAlignedBox& box) const; bool operator!=(const NzAxisAlignedBox& box) const; static NzAxisAlignedBox Infinite(); static NzAxisAlignedBox Lerp(const NzAxisAlignedBox& from, const NzAxisAlignedBox& to, T interpolation); static NzAxisAlignedBox Null(); nzExtend extend; NzCube cube; }; template std::ostream& operator<<(std::ostream& out, const NzAxisAlignedBox& box); typedef NzAxisAlignedBox NzAxisAlignedBoxd; typedef NzAxisAlignedBox NzAxisAlignedBoxf; #include #endif // NAZARA_AXISALIGNEDBOX_HPP