Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
VectorT Class Reference
Inheritance diagram for VectorT:
Inheritance graph
[legend]
Collaboration diagram for VectorT:
Collaboration graph
[legend]

Public Member Functions

float dotProduct (const VectorT< T > &vectorB) const
 get dot product for this vector with a 2nd vector
 
float vectorLength () const
 get length as a vector (distance from origin)
 
float vectorAngle () const
 get angle (in radians) for this vector
 
VectorT< T > normal () const
 get the Normal (vector with length 1) for this vector
 
 VectorT (const OffsetT< T > &o)
 create a vector and set its x & y values
 
 VectorT (const PointT< T > &p)
 create a point and set its x & y values
 
 VectorT (T ix, T iy)
 create a point and set its x & y values
 
 VectorT ()
 create a point at the origin (0,0)
 
- Public Member Functions inherited from OffsetT< T >
bool operator== (const OffsetT< T > &p2) const
 return true if this point is equal to the other
 
bool operator!= (const OffsetT< T > &p2) const
 return true if this point is not equal to the other
 
OffsetT< T > & operator= (const OffsetT< T > &p2)
 set point equal to another
 
OffsetT< T > operator+ (const OffsetT< T > &p2) const
 add two points together by adding x & y coordinates
 
OffsetT< T > operator- (const OffsetT< T > &p2) const
 subtract a point from another by subtracting x & y coordinates
 
OffsetT< T > & operator+= (const OffsetT< T > &p2)
 add another point to this one by adding x & y coordinates
 
OffsetT< T > & operator-= (const OffsetT< T > &p2)
 subtract another point from this one by subtracting x & y coordinates
 
OffsetT< T > & operator*= (float n)
 scale the offset
 
OffsetT< T > & operator/= (float n)
 scale the offset
 
OffsetT< T > operator* (float n) const
 scale an offset from by a factor
 
OffsetT< T > operator/ (float n) const
 scale an offset from by a factor
 
bool zero () const
 see if it's (0,0)
 
 OffsetT (T ix, T iy)
 create a point and set its x & y values
 
 OffsetT ()
 create a point at the origin (0,0)
 

Additional Inherited Members

- Public Attributes inherited from OffsetT< T >
x
 x coordinate of point on a grid or screen
 
y
 y coordinate of point on a grid or screen
 

Constructor & Destructor Documentation

VectorT ( const OffsetT< T > &  o)
inline

create a vector and set its x & y values

VectorT ( const PointT< T > &  p)
inline

create a point and set its x & y values

VectorT ( ix,
iy 
)
inline

create a point and set its x & y values

VectorT ( )
inline

create a point at the origin (0,0)

Member Function Documentation

float dotProduct ( const VectorT< T > &  vectorB) const

get dot product for this vector with a 2nd vector

VectorT<T> normal ( ) const

get the Normal (vector with length 1) for this vector

float vectorAngle ( ) const

get angle (in radians) for this vector

float vectorLength ( ) const

get length as a vector (distance from origin)