00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __TBOX3_H__
00013 #define __TBOX3_H__
00014
00015
00016
00017
00018 #include <Definitions.h>
00019
00020 #include <Memory/mmgr.h>
00021 #include "TVector3.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030 template<typename T>
00031 class TBox3
00032 {
00033
00034
00035
00036 public:
00037 TBox3() {}
00038 TBox3(const TVector3<T> &vPoint, const TVector3<T> &vA,
00039 const TVector3<T> &vB, const TVector3<T> &vC) : m_vPoint(vPoint), m_vA(vA), m_vB(vB), m_vC(vC) {}
00040 TBox3<T>(const TBox3<T> &other) : m_vPoint(other.m_vPoint), m_vA(other.m_vA), m_vB(other.m_vB), m_vC(other.m_vC) {}
00041 const TBox3<T> &operator =(const TBox3<T> &other) {m_vPoint = other.m_vPoint; m_vA = other.m_vA; m_vB = other.m_vB; m_vC = other.m_vC;
00042 return *this;}
00043
00044 const TBox3<T> operator+(const TVector3<T> &vec) const {return TBox3<T>(m_vPoint + vec, m_vA, m_vB, m_vC);}
00045 const TBox3<T> &operator+=(const TVector3<T> &vec) {m_vPoint += vec; return *this;}
00046
00047 const CVector3f Center() const {return (m_vPoint + m_vA/2.0f + m_vB/2.0f + m_vC/2.0f);}
00048
00049
00050
00051 public:
00052 TVector3<T> m_vPoint;
00053 TVector3<T> m_vA, m_vB, m_vC;
00054
00055 };
00056
00057 typedef TBox3<float> CBox3f;
00058
00059 #endif