00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #pragma once
00030
00031 #include "../fwd.hpp"
00032 #include "type_vec.hpp"
00033 #ifdef GLM_SWIZZLE
00034 # if GLM_HAS_ANONYMOUS_UNION
00035 # include "_swizzle.hpp"
00036 # else
00037 # include "_swizzle_func.hpp"
00038 # endif
00039 #endif //GLM_SWIZZLE
00040 #include <cstddef>
00041
00042 namespace glm{
00043 namespace detail
00044 {
00045 template <typename T, precision P>
00046 struct tvec1
00047 {
00049
00050
00051 enum ctor{_null};
00052
00053 typedef tvec1<T, P> type;
00054 typedef tvec1<bool, P> bool_type;
00055 typedef T value_type;
00056
00058
00059
00060 GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
00061
00063
00064
00065 union {T x, r, s;};
00066
00068
00069
00070 GLM_FUNC_DECL T & operator[](length_t i);
00071 GLM_FUNC_DECL T const & operator[](length_t i) const;
00072
00074
00075
00076 GLM_FUNC_DECL tvec1();
00077 GLM_FUNC_DECL tvec1(tvec1<T, P> const & v);
00078 template <precision Q>
00079 GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
00080 template <typename U>
00081 GLM_FUNC_DECL tvec1(U const & s);
00082
00084
00085
00086 GLM_FUNC_DECL explicit tvec1(ctor);
00087
00089
00090
00092 template <typename U, precision Q>
00093 GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
00095 template <typename U, precision Q>
00096 GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
00098 template <typename U, precision Q>
00099 GLM_FUNC_DECL explicit tvec1(tvec3<U, Q> const & v);
00101 template <typename U, precision Q>
00102 GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
00103
00105
00106
00107 GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<T, P> const & v);
00108
00109 template <typename U>
00110 GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<U, P> const & v);
00111 template <typename U>
00112 GLM_FUNC_DECL tvec1<T, P> & operator+=(U const & s);
00113 template <typename U>
00114 GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P> const & v);
00115 template <typename U>
00116 GLM_FUNC_DECL tvec1<T, P> & operator-=(U const & s);
00117 template <typename U>
00118 GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P> const & v);
00119 template <typename U>
00120 GLM_FUNC_DECL tvec1<T, P> & operator*=(U const & s);
00121 template <typename U>
00122 GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P> const & v);
00123 template <typename U>
00124 GLM_FUNC_DECL tvec1<T, P> & operator/=(U const & s);
00125 template <typename U>
00126 GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P> const & v);
00127
00129
00130
00131 GLM_FUNC_DECL tvec1<T, P> & operator++();
00132 GLM_FUNC_DECL tvec1<T, P> & operator--();
00133 GLM_FUNC_DECL tvec1<T, P> operator++(int);
00134 GLM_FUNC_DECL tvec1<T, P> operator--(int);
00135
00137
00138
00139 template <typename U>
00140 GLM_FUNC_DECL tvec1<T, P> & operator%=(U const & s);
00141 template <typename U>
00142 GLM_FUNC_DECL tvec1<T, P> & operator%=(tvec1<U, P> const & v);
00143 template <typename U>
00144 GLM_FUNC_DECL tvec1<T, P> & operator&=(U const & s);
00145 template <typename U>
00146 GLM_FUNC_DECL tvec1<T, P> & operator&=(tvec1<U, P> const & v);
00147 template <typename U>
00148 GLM_FUNC_DECL tvec1<T, P> & operator|=(U const & s);
00149 template <typename U>
00150 GLM_FUNC_DECL tvec1<T, P> & operator|=(tvec1<U, P> const & v);
00151 template <typename U>
00152 GLM_FUNC_DECL tvec1<T, P> & operator^=(U const & s);
00153 template <typename U>
00154 GLM_FUNC_DECL tvec1<T, P> & operator^=(tvec1<U, P> const & v);
00155 template <typename U>
00156 GLM_FUNC_DECL tvec1<T, P> & operator<<=(U const & s);
00157 template <typename U>
00158 GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P> const & v);
00159 template <typename U>
00160 GLM_FUNC_DECL tvec1<T, P> & operator>>=(U const & s);
00161 template <typename U>
00162 GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P> const & v);
00163 };
00164
00165
00166 template <typename T, precision P>
00167 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s);
00168
00169 template <typename T, precision P>
00170 GLM_FUNC_DECL tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v);
00171
00172 template <typename T, precision P>
00173 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00174
00175 template <typename T, precision P>
00176 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s);
00177
00178 template <typename T, precision P>
00179 GLM_FUNC_DECL tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v);
00180
00181 template <typename T, precision P>
00182 GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00183
00184 template <typename T, precision P>
00185 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s);
00186
00187 template <typename T, precision P>
00188 GLM_FUNC_DECL tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v);
00189
00190 template <typename T, precision P>
00191 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00192
00193 template <typename T, precision P>
00194 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s);
00195
00196 template <typename T, precision P>
00197 GLM_FUNC_DECL tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v);
00198
00199 template <typename T, precision P>
00200 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00201
00202 template <typename T, precision P>
00203 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v);
00204
00205 template <typename T, precision P>
00206 GLM_FUNC_DECL bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00207
00208 template <typename T, precision P>
00209 GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00210
00211 template <typename T, precision P>
00212 GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s);
00213
00214 template <typename T, precision P>
00215 GLM_FUNC_DECL tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v);
00216
00217 template <typename T, precision P>
00218 GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00219
00220 template <typename T, precision P>
00221 GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s);
00222
00223 template <typename T, precision P>
00224 GLM_FUNC_DECL tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v);
00225
00226 template <typename T, precision P>
00227 GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00228
00229 template <typename T, precision P>
00230 GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s);
00231
00232 template <typename T, precision P>
00233 GLM_FUNC_DECL tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v);
00234
00235 template <typename T, precision P>
00236 GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00237
00238 template <typename T, precision P>
00239 GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s);
00240
00241 template <typename T, precision P>
00242 GLM_FUNC_DECL tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v);
00243
00244 template <typename T, precision P>
00245 GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00246
00247 template <typename T, precision P>
00248 GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s);
00249
00250 template <typename T, precision P>
00251 GLM_FUNC_DECL tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v);
00252
00253 template <typename T, precision P>
00254 GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00255
00256 template <typename T, precision P>
00257 GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s);
00258
00259 template <typename T, precision P>
00260 GLM_FUNC_DECL tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v);
00261
00262 template <typename T, precision P>
00263 GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
00264
00265 template <typename T, precision P>
00266 GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P> const & v);
00267
00268 }
00269 }
00270
00271 #ifndef GLM_EXTERNAL_TEMPLATE
00272 #include "type_vec1.inl"
00273 #endif//GLM_EXTERNAL_TEMPLATE