00001 /****************************************************************************\ 00002 * * 00003 * 29.03.2006 * 00004 * TPlane - Header File * 00005 * * 00006 * (c) Raphael Charwot, Robert Hausmair * 00007 * * 00008 \****************************************************************************/ 00009 00010 #ifndef __TPLANE_H__ 00011 #define __TPLANE_H__ 00012 00013 /****************************************************************************\ 00014 * REQUIRED HEADERS * 00015 \****************************************************************************/ 00016 #include <Definitions.h> 00017 00018 #include <Memory/mmgr.h> 00019 #include "TVector3.h" 00020 00021 /****************************************************************************\ 00022 * DEFINITIONS * 00023 \****************************************************************************/ 00024 00025 /****************************************************************************\ 00026 * CLASS * 00027 \****************************************************************************/ 00028 template<typename T> 00029 class TPlane 00030 { 00031 /**************************************************************************\ 00032 * PUBLIC CLASS FUNCTIONS * 00033 \**************************************************************************/ 00034 public: 00035 TPlane() {} 00036 TPlane(const T &a, const T &b, const T &c, const T &d) {m_A = a; m_B = b; m_C = c; m_D = d;} 00037 TPlane(const TPlane<T> &other) {m_A = other.m_A; m_B = other.m_B; m_C = other.m_C; m_D = other.m_D;} 00038 const TPlane<T> &operator =(const TPlane &other) {m_A = other.m_A; m_B = other.m_B; m_C = other.m_C; m_D = other.m_D; return *this;} 00039 00040 void Set(const T &a, const T &b, const T &c, const T &d) {m_A = a; m_B = b; m_C = c; m_D = d;} 00041 00042 inline T Distance(const TVector3<T> &vec) const 00043 { 00044 return m_A * vec.m_X + m_B * vec.m_Y + m_C * vec.m_Z + m_D; 00045 } 00046 00047 /**************************************************************************\ 00048 * PROTECTED CLASS FUNCTIONS * 00049 \**************************************************************************/ 00050 protected: 00051 00052 /**************************************************************************\ 00053 * PRIVATE CLASS FUNCTIONS * 00054 \**************************************************************************/ 00055 private: 00056 00057 /**************************************************************************\ 00058 * PUBLIC CLASS MEMBERS * 00059 \**************************************************************************/ 00060 public: 00061 T m_A, m_B, m_C, m_D; 00062 }; 00063 00064 typedef TPlane<float> CPlanef; 00065 00066 #endif