qaf::Vector3D Class Reference

#include <qafVector3D.h>

List of all members.


Detailed Description

Vector in the R3 space, with (x, y, z) components.

This class overloads several operators to make evaluating formulae easier.

The multiplication operator (*) can be used with a scalar argument (i.e., a float value), or with another vector, in which case it stands for the dot product.

The modulus operator (%%) represents a cross product.


Public Member Functions

 Vector3D (float _x, float _y, float _z)
 Vector3D (int _x, int _y, int _z)
Vector3Doperator= (const Vector3D &v)
float length () const
 Returns the Euclidian norm of this vector.
Vector3D unit () const
 Returns a copy of the vector, with length equal to 1.
float dist (const Vector3D &that) const
 Returns the distance between the points denoted by this and that.
void normalize ()
 Resizes the vector so it will have length equal to 1.
Vector3D project (const Vector3D &onto) const
 Returns the projection of this vector onto another.
Vector3D reflect (const Vector3D &around) const
 Returns the reflection of this vector relative to around.
Vector3D rotate (const Vector3D &axis, float angle) const
 Returns a rotated copy of this vector around axis.
Vector3Doperator+= (const Vector3D &v)
Vector3Doperator-= (const Vector3D &v)
Vector3D operator+ (const Vector3D &v) const
Vector3D operator- (const Vector3D &v) const
Vector3D operator- () const
Vector3Doperator *= (float s)
Vector3D operator * (float s) const
Vector3Doperator/= (float s)
Vector3D operator/ (float s) const
float operator * (const Vector3D &v) const
 Returns the dot product of this vector and v.
Vector3Doperator%= (const Vector3D &v)
 Returns the cross product of this vector and v.
Vector3D operator% (const Vector3D &v) const
 Returns the cross product of this vector and v.

Public Attributes

float x
float y
float z


Member Function Documentation

float qaf::Vector3D::length (  )  const [inline]

Returns the Euclidian norm of this vector.

Vector3D qaf::Vector3D::unit (  )  const [inline]

Returns a copy of the vector, with length equal to 1.

float qaf::Vector3D::dist ( const Vector3D that  )  const [inline]

Returns the distance between the points denoted by this and that.

void qaf::Vector3D::normalize (  )  [inline]

Resizes the vector so it will have length equal to 1.

Vector3D qaf::Vector3D::project ( const Vector3D onto  )  const [inline]

Returns the projection of this vector onto another.

Vector3D qaf::Vector3D::reflect ( const Vector3D around  )  const [inline]

Returns the reflection of this vector relative to around.

Vector3D qaf::Vector3D::rotate ( const Vector3D axis,
float  angle 
) const [inline]

Returns a rotated copy of this vector around axis.

float qaf::Vector3D::operator * ( const Vector3D v  )  const [inline]

Returns the dot product of this vector and v.

Vector3D & qaf::Vector3D::operator%= ( const Vector3D v  )  [inline]

Returns the cross product of this vector and v.

Vector3D qaf::Vector3D::operator% ( const Vector3D v  )  const [inline]

Returns the cross product of this vector and v.


The documentation for this class was generated from the following file:
Generated on Sun Mar 25 12:32:15 2007 for Qaf Framework by  doxygen 1.5.1-p1