// Copyright (C) 2015 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_BOUNDINGVOLUME_HPP #define NAZARA_BOUNDINGVOLUME_HPP #include #include #include #include #include #include #include namespace Nz { template class BoundingVolume { public: BoundingVolume(); BoundingVolume(Extend Extend); BoundingVolume(T X, T Y, T Z, T Width, T Height, T Depth); BoundingVolume(const Box& box); BoundingVolume(const OrientedBox& orientedBox); BoundingVolume(const Vector3& vec1, const Vector3& vec2); template explicit BoundingVolume(const BoundingVolume& volume); BoundingVolume(const BoundingVolume& volume) = default; ~BoundingVolume() = default; bool IsFinite() const; bool IsInfinite() const; bool IsNull() const; BoundingVolume& MakeInfinite(); BoundingVolume& MakeNull(); BoundingVolume& Set(Extend Extend); BoundingVolume& Set(T X, T Y, T Z, T Width, T Height, T Depth); BoundingVolume& Set(const BoundingVolume& volume); BoundingVolume& Set(const Box& box); BoundingVolume& Set(const OrientedBox& orientedBox); BoundingVolume& Set(const Vector3& vec1, const Vector3& vec2); template BoundingVolume& Set(const BoundingVolume& volume); String ToString() const; void Update(const Matrix4& transformMatrix); void Update(const Vector3& translation); BoundingVolume operator*(T scalar) const; BoundingVolume& operator*=(T scalar); bool operator==(const BoundingVolume& volume) const; bool operator!=(const BoundingVolume& volume) const; static BoundingVolume Infinite(); static BoundingVolume Lerp(const BoundingVolume& from, const BoundingVolume& to, T interpolation); static BoundingVolume Null(); Extend extend; Box aabb; OrientedBox obb; }; typedef BoundingVolume BoundingVolumed; typedef BoundingVolume BoundingVolumef; template bool Serialize(SerializationContext& context, const BoundingVolume& boundingVolume); template bool Unserialize(SerializationContext& context, BoundingVolume* boundingVolume); } template std::ostream& operator<<(std::ostream& out, const Nz::BoundingVolume& volume); #include #endif // NAZARA_BOUNDINGVOLUME_HPP