20 #ifndef FASTUIDRAW_VECN_HPP 21 #define FASTUIDRAW_VECN_HPP 41 template<
typename T,
size_t N>
121 for(size_type i = 0; i < N; ++i)
142 for(i = 0; i <
t_min(N, M); ++i)
162 template<
typename S,
size_type M>
168 for(i = 0; i <
t_min(N, M); ++i)
192 size_type start, size_type stride = 1,
193 const T &default_value = T())
197 for(i = 0, j = start; i < N && j < M; ++i, j += stride)
226 vecN(
const T &px,
const T &py,
const T &pz)
241 vecN(
const T &px,
const T &py,
const T &pz,
const T &pw)
258 vecN(
const T &p0,
const T &p1,
const T &p2,
259 const T &p3,
const T &p4)
278 vecN(
const T &p0,
const T &p1,
const T &p2,
279 const T &p3,
const T &p4,
const T &p5)
300 vecN(
const T &p0,
const T &p1,
const T &p2,
301 const T &p3,
const T &p4,
const T &p5,
325 vecN(
const T &p0,
const T &p1,
const T &p2,
326 const T &p3,
const T &p4,
const T &p5,
327 const T &p6,
const T &p7)
352 vecN(
const T &p0,
const T &p1,
const T &p2,
353 const T &p3,
const T &p4,
const T &p5,
354 const T &p6,
const T &p7,
const T &p8)
376 for(size_type i = 0 ; i < N - 1; ++i)
390 for(size_type i = 0; i < N; ++i)
392 m_data[i].swap(obj.m_data[i]);
406 c_ptr(
void)
const {
return m_data; }
502 for(size_type i = 0; i < N; ++i)
518 for(size_type i = 0; i < N; ++i)
534 for(size_type i = 0; i < N; ++i)
657 for(size_type i = 0;i <
t_min(M, N); ++i)
673 for(size_type i = 0; i <
t_min(M, N); ++i)
689 for(size_type i = 0; i <
t_min(N, M); ++i)
705 for(size_type i = 0; i <
t_min(M, N); ++i)
721 for(size_type i = 0; i <
t_min(M, N); ++i)
736 for(size_type i = 0; i < N; ++i)
751 for(size_type i = 0; i < N; ++i)
766 for(size_type i = 0; i < N; ++i)
806 T retval(
operator[](0) * obj[0]);
808 for(size_type i = 1; i < N; ++i)
842 T retval(
t_abs(
operator[](0)));
844 for(size_type i = 1; i < N; ++i)
846 retval +=
t_abs(
operator[](i));
861 for(size_type i = 0; i < N; ++i)
877 val =
dot(*
this, referencePt);
880 for(size_type i = 0; i < N; ++i)
898 for(size_type i = 0; i < N; ++i)
900 if (obj[i] !=
operator[](i))
933 for(size_type i = 0; i < N; ++i)
935 if (
operator[](i) < obj[i])
939 if (obj[i] <
operator[](i))
970 return obj.operator<(*this);
1060 size(
void) {
return static_cast<size_type
>(N); }
1108 front(
void)
const {
return (*
this)[0]; }
1122 template<
typename T,
size_t N>
1136 template<
typename T,
size_t N>
1151 template<
typename T,
size_t N>
1167 template<
typename T,
size_t N>
1180 template<
typename T>
1201 template<
typename T,
size_t N>
1212 template<
typename T,
size_t N>
1213 class unvecN<vecN<T, N> const >
1220 typedef T
const type;
1445 return return_value;
1457 return pack_vec4(v[0], v[1], v[2], v[3]);
1463 template<
typename T,
size_t N>
1473 d = (d0 + d1 + d2) / T(2);
1474 return t_sqrt(d * (d - d0) * (d - d1) * (d - d2));
1480 template<
typename T>
1485 a.
z() * b.
x() - a.
x() * b.
z(),
1486 a.
x() * b.
y() - a.
y() * b.
x());
vecN< uint64_t, 4 > u64vec4
vecN(const T &px, const T &py, const T &pz, const T &pw)
vecN(const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5, const T &p6, const T &p7, const T &p8)
vecN< uint16_t, 1 > u16vec1
T * pointer
STL compliant typedef.
const_reference back(void) const
void operator/=(const T &obj)
friend vecN operator/(const T &obj, const vecN &vec)
const T & const_reference
STL compliant typedef.
vecN< uint16_t, 2 > u16vec2
void operator*=(const T &obj)
vecN< uint32_t, 2 > u32vec2
float t_atan2(float y, float x)
vecN operator-(void) const
all classes and functions of FastUIDraw are in the namespace fastuidraw.
vecN operator+(const vecN &obj) const
const_reference y(void) const
T magnitudeSq(void) const
const T * c_ptr(void) const
vecN(const vecN< T, M > &obj, size_type start, size_type stride=1, const T &default_value=T())
vecN< int16_t, 1 > i16vec1
vecN(const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5, const T &p6)
pointer iterator
iterator typedef to pointer
bool operator<=(const vecN &obj) const
const vecN & fill(const T &obj)
vecN(const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5)
void operator/=(const vecN< T, M > &obj)
const vecN & operator=(const vecN &obj)
const_reference w(void) const
vecN unit_vector(void) const
vecN< int32_t, 3 > i32vec3
vecN is a simple static array class with no virtual functions and no memory overhead. Supports runtim array index checking and STL style iterators via pointer iterators.
bool operator>(const vecN &obj) const
vecN< uint8_t, 2 > u8vec2
vecN< uint32_t, 3 > uvec3
vecN< uint64_t, 1 > u64vec1
bool magnitude_compare(const vecN< T, N > &a, const vecN< T, N > &b)
const_reference x(void) const
vecN< T, 3 > cross_product(const vecN< T, 3 > &a, const vecN< T, 3 > &b)
vecN< int32_t, 1 > i32vec1
vecN< uint32_t, 4 > uvec4
vecN< int64_t, 2 > i64vec2
reference operator[](size_type j)
vecN< int64_t, 4 > i64vec4
bool operator<(const vecN &obj) const
ptrdiff_t difference_type
STL compliant typedef.
const_pointer const_iterator
iterator typedef to const_pointer
vecN< uint32_t, 2 > uvec2
vecN< uint64_t, 2 > u64vec2
#define FASTUIDRAWstatic_assert(X)
vecN(const vecN< S, M > &obj, const T &value=T())
const T & t_max(const T &a, const T &b)
vecN< int16_t, 3 > i16vec3
vecN operator*(const vecN &obj) const
vecN unit_vector(T tol) const
vecN operator/(const T &obj) const
vecN operator/(const vecN &obj) const
vecN(const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5, const T &p6, const T &p7)
vecN< int32_t, 2 > i32vec2
T triangle_area(const vecN< T, N > &p0, const vecN< T, N > &p1, const vecN< T, N > &p2)
vecN< uint32_t, 1 > u32vec1
bool operator==(const vecN &obj) const
void face_forward(const vecN &referencePt)
vecN< uint8_t, 4 > u8vec4
uvec4 pack_vec4(float x, float y, float z, float w)
const T & t_min(const T &a, const T &b)
uint32_t pack_float(float f)
bool operator!=(const vecN &obj) const
vecN< uint32_t, 3 > u32vec3
vecN operator%(const T &obj) const
const T * const_pointer
STL compliant typedef.
T dot(const vecN &obj) const
vecN(const vecN< T, N-1 > &p, const T &d)
void operator*=(const vecN< T, M > &obj)
bool operator>=(const vecN &obj) const
vecN< uint16_t, 4 > u16vec4
vecN< uint64_t, 3 > u64vec3
vecN operator-(const vecN &obj) const
const_reference operator[](size_type j) const
vecN(const T &px, const T &py, const T &pz)
vecN< int16_t, 4 > i16vec4
vecN(const vecN< T, M > &obj, const T &value=T())
const_iterator end(void) const
vecN< uint16_t, 3 > u16vec3
vecN< uint8_t, 1 > u8vec1
friend vecN operator*(const T &obj, const vecN &vec)
void operator-=(const vecN< T, M > &obj)
const_reference front(void) const
T & reference
STL compliant typedef.
T value_type
STL compliant typedef.
size_t size_type
STL compliant typedef.
const_reference z(void) const
void operator+=(const vecN< T, M > &obj)
void operator%=(const T &obj)
void AddMult(const vecN &dood, const T &mult)
vecN< int64_t, 3 > i64vec3
vecN(const T &p0, const T &p1, const T &p2, const T &p3, const T &p4)
vecN< uint32_t, 4 > u32vec4
vecN< int32_t, 4 > i32vec4
vecN< int64_t, 1 > i64vec1
vecN(const T &px, const T &py)
vecN< int16_t, 2 > i16vec2
vecN< uint32_t, 1 > uvec1
#define FASTUIDRAWassert(X)
const_iterator begin(void) const
vecN operator%(const vecN &obj) const
vecN operator*(const T &obj) const
vecN< uint8_t, 3 > u8vec3
void operator%=(const vecN< T, M > &obj)