00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef INCLUDE_3D_COORDONATE_H
00024 #define INCLUDE_3D_COORDONATE_H
00025
00031 template <class T> class Coordonate
00032 {
00033 public:
00034 union
00035 {
00036 T value[4];
00037 struct
00038 {
00039 T x;
00040 T y;
00041 T z;
00042 T w;
00043 };
00044 };
00045 BOOL isEnable;
00046
00047 public:
00048 Coordonate()
00049 {
00050 Zero();
00051 }
00052
00053 void Zero()
00054 {
00055 x=0;
00056 y=0;
00057 z=0;
00058 isEnable = FALSE;
00059 }
00060
00061 void operator=(Coordonate &source)
00062 {
00063 isEnable = source.isEnable;
00064 x = source.x;
00065 y = source.y;
00066 z = source.z;
00067 w = source.w;
00068 }
00069
00070 void Set(T _x,T _y,T _z=0,T _w=0)
00071 {
00072 x = _x;
00073 y = _y;
00074 z = _z;
00075 w = _w;
00076 isEnable = TRUE;
00077 }
00078
00079 operator T *() const
00080 {
00081 return (T *)&value;
00082 }
00083
00084 void ToString (MyString &source)
00085 {
00086 source<<"[enable,x,y,z,w]: "<<isEnable<<" , "<<x<<" , "<<y<<" , "<<z<<" , "<<w;
00087 }
00088 };
00089
00090 #endif