Lines Matching refs:VEC
37 class vec;
47 template < template<typename T, size_t S> class VEC,
49 vec<TYPE, SIZE>& doAssign(
50 vec<TYPE, SIZE>& lhs, const VEC<TYPE, S>& rhs) {
92 template<typename T, size_t S> class VEC,
96 VEC<TYPE, SIZE> PURE doMulScalar(
97 const VEC<TYPE, SIZE>& lhs,
99 VEC<TYPE, SIZE> r;
106 template<typename T, size_t S> class VEC,
110 VEC<TYPE, SIZE> PURE doScalarMul(
112 const VEC<TYPE, SIZE>& rhs) {
113 VEC<TYPE, SIZE> r;
127 // on vec<>. Without this, an extra conversion to vec<> would be needed.
134 // "a.xyz + b" is a mixed-operation between a vbase<> and a vec<>, requiring
135 // a conversion of vbase<> to vec<>. The template gunk below avoids this,
164 template<typename T, size_t S> class VEC,
168 inline VEC<TYPE, SIZE> PURE operator * (
169 const VEC<TYPE, SIZE>& lhs,
175 template<typename T, size_t S> class VEC,
179 inline VEC<TYPE, SIZE> PURE operator * (
181 const VEC<TYPE, SIZE>& rhs) {
245 vec<TYPE, SIZE> PURE operator - (const vec<TYPE, SIZE>& lhs) {
246 vec<TYPE, SIZE> r;
300 class vec : public vbase<TYPE, SIZE>
323 vec() { }
324 vec(const vec& rhs) : base(rhs) { }
325 vec(const base& rhs) : base(rhs) { }
330 vec(pTYPE rhs) {
335 template < template<typename T, size_t S> class VEC, size_t S>
336 explicit vec(const VEC<TYPE, S>& rhs) {
340 explicit vec(TYPE const* array) {
348 vec& operator = (const vec& rhs) {
353 vec& operator = (const base& rhs) {
358 vec& operator = (pTYPE rhs) {
364 template < template<typename T, size_t S> class VEC, size_t S>
365 vec& operator = (const VEC<TYPE, S>& rhs) {
372 vec& operator += (const vec& rhs);
373 vec& operator -= (const vec& rhs);
374 vec& operator *= (pTYPE rhs);
382 // type conversion so that you can multiply a vec<float> by an scalar int
385 friend inline vec PURE operator + (const vec& lhs, const vec& rhs) {
388 friend inline vec PURE operator - (const vec& lhs, const vec& rhs) {
391 friend inline vec PURE operator * (const vec& lhs, pTYPE v) {
394 friend inline vec PURE operator * (pTYPE v, const vec& rhs) {
397 friend inline TYPE PURE dot_product(const vec& lhs, const vec& rhs) {
405 vec<TYPE, SIZE>& vec<TYPE, SIZE>::operator += (const vec<TYPE, SIZE>& rhs) {
406 vec<TYPE, SIZE>& lhs(*this);
413 vec<TYPE, SIZE>& vec<TYPE, SIZE>::operator -= (const vec<TYPE, SIZE>& rhs) {
414 vec<TYPE, SIZE>& lhs(*this);
421 vec<TYPE, SIZE>& vec<TYPE, SIZE>::operator *= (vec<TYPE, SIZE>::pTYPE rhs) {
422 vec<TYPE, SIZE>& lhs(*this);
430 typedef vec<float, 2> vec2_t;
431 typedef vec<float, 3> vec3_t;
432 typedef vec<float, 4> vec4_t;