nv::vec2< T > Class Template Reference

Template class for 2-tuple vector. More...

#include <NvVector.h>

List of all members.

Public Types

typedef T value_type

Public Member Functions

int32_t size () const
 vec2 (const T &t=T())
 Default/scalar constructor.
 vec2 (const T *tp)
 Construct from array.
 vec2 (const T v0, const T v1)
 Construct from explicit values.
 vec2 (const vec3< T > &u)
 "Cropping" explicit constructor from vec3 to vec2
 vec2 (const vec4< T > &u)
 "Cropping" explicit constructor from vec4 to vec2
const T * get_value () const
vec2< T > & set_value (const T *rhs)
T & operator[] (int32_t i)
const T & operator[] (int32_t i) const
 operator T * ()
 operator const T * () const

Public Attributes

union {
   struct {
      T   x
      T   y
   } 
   struct {
      T   s
      T   t
   } 
   T   _array [2]
}; 

Friends

vec2< T > & operator*= (vec2< T > &lhs, T d)
vec2< T > & operator*= (vec2< T > &lhs, const vec2< T > &rhs)
vec2< T > & operator/= (vec2< T > &lhs, T d)
vec2< T > & operator+= (vec2< T > &lhs, const vec2< T > &rhs)
vec2< T > & operator-= (vec2< T > &lhs, const vec2< T > &rhs)
vec2< T > operator- (const vec2< T > &rhs)
vec2< T > operator+ (const vec2< T > &lhs, const vec2< T > &rhs)
vec2< T > operator- (const vec2< T > &lhs, const vec2< T > &rhs)
vec2< T > operator* (const vec2< T > &lhs, T rhs)
vec2< T > operator* (T lhs, const vec2< T > &rhs)
vec2< T > operator* (const vec2< T > &lhs, const vec2< T > &rhs)
vec2< T > operator/ (const vec2< T > &lhs, T rhs)
vec2< T > operator/ (const vec2< T > &lhs, const vec2< T > &rhs)
bool operator== (const vec2< T > &lhs, const vec2< T > &rhs)
bool operator!= (const vec2< T > &lhs, const vec2< T > &rhs)


Detailed Description

template<class T>
class nv::vec2< T >

Template class for 2-tuple vector.
The documentation for this class was generated from the following file: