// Author: Hector Navarro (hnavarro@ciens.ucv.ve)
//         Juan Carlos De Abreu (jcabreur@gmail.com)

#ifndef AABB_INL_H__
#define AABB_INL_H__

#include "../global.h"
#include "aabb.h"

BEGIN_TEG_NAMESPACE();

inline const Vec3f& AABB::min_vertex() const {
  return min_vertex_;
}

inline const Vec3f& AABB::max_vertex() const {
  return max_vertex_;
}

inline void AABB::set_min_vertex(const Vec3f& min_vertex) {
  min_vertex_ = min_vertex;
}

inline void AABB::set_max_vertex(const Vec3f& max_vertex) {
  max_vertex_ = max_vertex;
}

inline Vec3f AABB::GetSize() const {
	return max_vertex_ - min_vertex_;
}

inline Vec3f AABB::GetCenter() const {
	return (min_vertex_ + max_vertex_) / 2.0f;
}

inline bool AABB::IsInside(const Vec3f& vertex) const {
	return vertex >= min_vertex_ && vertex <= max_vertex_;
}

END_TEG_NAMESPACE();

#endif  // AABB_INL_H__
