glc_vector2df.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025 #ifndef GLC_VECTOR2DF_H_
00026 #define GLC_VECTOR2DF_H_
00027
00028 #include "glc_utils_maths.h"
00029
00030 #include "../glc_config.h"
00031
00033
00035
00038
00042
00043
00044 class GLC_LIB_EXPORT GLC_Vector2df
00045 {
00046 friend class GLC_Vector2d;
00048
00050
00051 public:
00057 inline GLC_Vector2df()
00058 {
00059 vector[0]= 0.0f;
00060 vector[1]= 0.0f;
00061 }
00062
00064 inline GLC_Vector2df(const float &dX, const float &dY)
00065 {
00066 vector[0]= dX;
00067 vector[1]= dY;
00068 }
00069
00076 inline GLC_Vector2df(const GLC_Vector2df &Vect)
00077 {
00078 vector[0]= Vect.vector[0];
00079 vector[1]= Vect.vector[1];
00080 }
00082
00084
00086
00087 public:
00089 inline GLC_Vector2df& setX(const float &dX)
00090 {
00091 vector[0]= dX;
00092 return *this;
00093 }
00094
00096 inline GLC_Vector2df& setY(const float &dY)
00097 {
00098 vector[1]= dY;
00099 return *this;
00100 }
00101
00103 inline GLC_Vector2df& setVect(const float &dX, const float &dY)
00104 {
00105 vector[0]= dX;
00106 vector[1]= dY;
00107 return *this;
00108 }
00109
00111 inline GLC_Vector2df& setVect(const GLC_Vector2df &Vect)
00112 {
00113 vector[0]= Vect.vector[0];
00114 vector[1]= Vect.vector[1];
00115 return *this;
00116 }
00117
00119
00121
00123
00124 public:
00126 inline float X(void) const
00127 {
00128 return vector[0];
00129 }
00131 inline float Y(void) const
00132 {
00133 return vector[1];
00134 }
00136 inline const float *return_dVect(void) const
00137 {
00138 return vector;
00139 }
00141 inline bool isNull(void) const
00142 {
00143 return (qFuzzyCompare(vector[0], 0.0f) && qFuzzyCompare(vector[1], 0.0f));
00144 }
00145
00147
00149
00151 private:
00156 float vector[2];
00157
00158 };
00159
00161 typedef GLC_Vector2df GLC_Point2df;
00162
00163 #endif