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
00023
00024
00026
00027 #ifndef GLC_VECTOR2DF_H_
00028 #define GLC_VECTOR2DF_H_
00029
00030 #include "glc_utils_maths.h"
00031
00032 #include "../glc_config.h"
00033
00035
00037
00040
00044
00045
00046 class GLC_LIB_EXPORT GLC_Vector2df
00047 {
00048 friend class GLC_Vector2d;
00050
00052
00053 public:
00059 inline GLC_Vector2df()
00060 {
00061 vector[0]= 0.0f;
00062 vector[1]= 0.0f;
00063 }
00064
00066 inline GLC_Vector2df(const float &dX, const float &dY)
00067 {
00068 vector[0]= dX;
00069 vector[1]= dY;
00070 }
00071
00078 inline GLC_Vector2df(const GLC_Vector2df &Vect)
00079 {
00080 vector[0]= Vect.vector[0];
00081 vector[1]= Vect.vector[1];
00082 }
00084
00086
00088
00089 public:
00091 inline GLC_Vector2df& setX(const float &dX)
00092 {
00093 vector[0]= dX;
00094 return *this;
00095 }
00096
00098 inline GLC_Vector2df& setY(const float &dY)
00099 {
00100 vector[1]= dY;
00101 return *this;
00102 }
00103
00105 inline GLC_Vector2df& setVect(const float &dX, const float &dY)
00106 {
00107 vector[0]= dX;
00108 vector[1]= dY;
00109 return *this;
00110 }
00111
00113 inline GLC_Vector2df& setVect(const GLC_Vector2df &Vect)
00114 {
00115 vector[0]= Vect.vector[0];
00116 vector[1]= Vect.vector[1];
00117 return *this;
00118 }
00119
00121
00123
00125
00126 public:
00128 inline float X(void) const
00129 {
00130 return vector[0];
00131 }
00133 inline float Y(void) const
00134 {
00135 return vector[1];
00136 }
00138 inline const float *return_dVect(void) const
00139 {
00140 return vector;
00141 }
00143 inline bool isNull(void) const
00144 {
00145 return (qFuzzyCompare(vector[0], 0.0f) && qFuzzyCompare(vector[1], 0.0f));
00146 }
00147
00149
00151
00153 private:
00158 float vector[2];
00159
00160 };
00161
00163 typedef GLC_Vector2df GLC_Point2df;
00164
00165 #endif