Vector2D Class Reference

2D vector More...

#include <vector.h>

List of all members.

Public Member Functions

 Vector2D (float X=0.0f, float Y=0.0f)
 Constructs a vector form given components.
Vector2D operator+ (const Vector2D &v) const
 Adds two vectors.
Vector2D operator- (const Vector2D &v) const
 Subtracts two vectors.
Vector2D operator * (const float f) const
 Multiplies the vector with a scalar.
const float * toFloatPointer (void) const
 Allows accessing the components via index.

Public Attributes

float x
 X component.
float y
 Y component.


Detailed Description

2D vector

A vector class with self-explaining members.


Constructor & Destructor Documentation

Vector2D::Vector2D ( float  X = 0.0f,
float  Y = 0.0f 
) [inline]

Constructs a vector form given components.


Member Function Documentation

Vector2D Vector2D::operator+ ( const Vector2D v  )  const [inline]

Adds two vectors.

Vector2D Vector2D::operator- ( const Vector2D v  )  const [inline]

Subtracts two vectors.

Returns:
this - v.

Vector2D Vector2D::operator * ( const float  f  )  const [inline]

Multiplies the vector with a scalar.

Parameters:
f Scaling factor.
Returns:
The scaled vector.

const float* Vector2D::toFloatPointer ( void   )  const [inline]

Allows accessing the components via index.

Returns:
The address of the X component.
Precondition:
Assumes the compiler places x,y,z,w in this sequence without padding.


The documentation for this class was generated from the following file:
Generated on Sun Mar 2 17:12:32 2008 for Shader Maker by  doxygen 1.5.4