MAK Legion API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Legion::Vector2f Class Reference
+ Collaboration diagram for Legion::Vector2f:

Public Member Functions

 Vector2f ()
 
 Vector2f (const float x, const float y)
 
 Vector2f (const float *tuple)
 
 Vector2f (const Vector2f &other)
 
 Vector2f (const Vector2d &other)
 
Vector2foperator= (const Vector2f &vec)
 
bool operator== (const Vector2f &vec) const
 
bool operator!= (const Vector2f &vec) const
 
bool operator< (const Vector2f &vec) const
 
bool operator<= (const Vector2f &vec) const
 
bool operator> (const Vector2f &vec) const
 
bool operator>= (const Vector2f &vec) const
 
Vector2f operator+ (const Vector2f &vec) const
 
Vector2f operator- (const Vector2f &vec) const
 
Vector2f operator* (float scalar) const
 
Vector2f operator/ (float scalar) const
 
Vector2f operator- () const
 
Vector2foperator+= (const Vector2f &vec)
 
Vector2foperator-= (const Vector2f &vec)
 
Vector2foperator*= (float scalar)
 
Vector2foperator/= (float scalar)
 
float length () const
 
float lengthSquared () const
 
float dot (const Vector2f &vec) const
 
float normalize ()
 
float distanceFrom (const Vector2f &other) const
 
float distanceFromSquared (const Vector2f &other) const
 
void setLength (float newLength)
 
void invert ()
 
bool isZero ()
 
Vector2f perpendicular () const
 
Vector2f unitPerp () const
 
float dotPerp (const Vector2f &vec) const
 
void rotateBy (float degrees, const Vector2f &center)
 rotates the point around a center by an amount of degrees. More...
 
float angleTrig () const
 Calculates the angle of this vector in grad in the trigonometric sense. More...
 
float angle () const
 Calculates the angle of this vector in grad in the counter trigonometric sense. More...
 
float angleBetween (const Vector2f &b) const
 Calculates the angle between this vector and another one in grad. More...
 
bool isBetweenPoints (const Vector2f &begin, const Vector2f &end) const
 Returns if this vector interpreted as a point is on a line between two other points. More...
 

Static Public Member Functions

static Vector2f interpolate (const Vector2f &v0, const Vector2f &v1, float t)
 returns interpolated vector More...
 

Public Attributes

union {
   struct {
      float   x
 
      float   y
 
   } 
 
   float   data [2]
 
}; 
 

Constructor & Destructor Documentation

Legion::Vector2f::Vector2f ( )
Legion::Vector2f::Vector2f ( const float  x,
const float  y 
)
Legion::Vector2f::Vector2f ( const float *  tuple)
Legion::Vector2f::Vector2f ( const Vector2f other)
Legion::Vector2f::Vector2f ( const Vector2d other)

Member Function Documentation

float Legion::Vector2f::angle ( ) const
inline

Calculates the angle of this vector in grad in the counter trigonometric sense.

Returns
Returns a value between 0 and 360.
float Legion::Vector2f::angleBetween ( const Vector2f b) const
inline

Calculates the angle between this vector and another one in grad.

Returns
Returns a value between 0 and 90.
float Legion::Vector2f::angleTrig ( ) const
inline

Calculates the angle of this vector in grad in the trigonometric sense.

Returns
Returns a value between 0 and 360.
float Legion::Vector2f::distanceFrom ( const Vector2f other) const
inline
float Legion::Vector2f::distanceFromSquared ( const Vector2f other) const
inline
float Legion::Vector2f::dot ( const Vector2f vec) const
inline
float Legion::Vector2f::dotPerp ( const Vector2f vec) const
inline
static Vector2f Legion::Vector2f::interpolate ( const Vector2f v0,
const Vector2f v1,
float  t 
)
static

returns interpolated vector

Parameters
other,:other vector to interpolate between
d,:value between 0.0f and 1.0f.
void Legion::Vector2f::invert ( )
inline
bool Legion::Vector2f::isBetweenPoints ( const Vector2f begin,
const Vector2f end 
) const
inline

Returns if this vector interpreted as a point is on a line between two other points.

It is assumed that the point is on the line.

Parameters
begin,:Beginning vector to compare between.
end,:Ending vector to compare between.
Returns
True if this vector is between begin and end. False if not.
bool Legion::Vector2f::isZero ( )
inline
float Legion::Vector2f::length ( ) const
inline
float Legion::Vector2f::lengthSquared ( ) const
inline
float Legion::Vector2f::normalize ( )
inline
bool Legion::Vector2f::operator!= ( const Vector2f vec) const
inline
Vector2f Legion::Vector2f::operator* ( float  scalar) const
inline
Vector2f& Legion::Vector2f::operator*= ( float  scalar)
inline
Vector2f Legion::Vector2f::operator+ ( const Vector2f vec) const
inline
Vector2f& Legion::Vector2f::operator+= ( const Vector2f vec)
inline
Vector2f Legion::Vector2f::operator- ( const Vector2f vec) const
inline
Vector2f Legion::Vector2f::operator- ( ) const
inline
Vector2f& Legion::Vector2f::operator-= ( const Vector2f vec)
inline
Vector2f Legion::Vector2f::operator/ ( float  scalar) const
inline
Vector2f& Legion::Vector2f::operator/= ( float  scalar)
inline
bool Legion::Vector2f::operator< ( const Vector2f vec) const
inline
bool Legion::Vector2f::operator<= ( const Vector2f vec) const
inline
Vector2f& Legion::Vector2f::operator= ( const Vector2f vec)
inline
bool Legion::Vector2f::operator== ( const Vector2f vec) const
inline
bool Legion::Vector2f::operator> ( const Vector2f vec) const
inline
bool Legion::Vector2f::operator>= ( const Vector2f vec) const
inline
Vector2f Legion::Vector2f::perpendicular ( ) const
inline
void Legion::Vector2f::rotateBy ( float  degrees,
const Vector2f center 
)
inline

rotates the point around a center by an amount of degrees.

void Legion::Vector2f::setLength ( float  newLength)
inline
Vector2f Legion::Vector2f::unitPerp ( ) const
inline

Member Data Documentation

union { ... }
float Legion::Vector2f::data[2]
float Legion::Vector2f::x
float Legion::Vector2f::y

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Mar 8 15:11:30 EST 2021 from SVN revision 225633
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)