Crevaya 0.1-PreAlpha

Vector3 Class Reference

Contains a vector in 3D space. More...

#include <Vector3.h>

List of all members.

Public Member Functions

 Vector3 (float px=0.0, float py=0.0, float pz=0.0)
 Vector3 (wxString string)
 ~Vector3 (void)
wxString ToString (void) const
void FromString (wxString const &string)
float Abs ()
 Calculate the absolut length of a vector.
Vector3operator+= (const Vector3 &a)
 Overloaded operator for vector addition.
const Vector3 operator+ (const Vector3 &a) const
 Overloaded operator for vector addition.
Vector3operator-= (const Vector3 &a)
 Overloaded operator for vector subtraction.
const Vector3 operator- (const Vector3 &a) const
 Overloaded operator for vector subtraction.
const Vector3 operator- () const
 Overloaded operator for vector negation.
Vector3operator*= (const Vector3 &b)
 Overloaded operator for vector product.
Vector3operator*= (const float &b)
 Overloaded operator for scalar product.
const Vector3 operator* (const Vector3 &b) const
const Vector3 operator* (const float &b) const
 Overloaded operator for scalar product.
float Dot (const Vector3 &b)
 Calculates the dot product (inner product) of two vectors.
Vector3operator/= (const float &b)
 Overloaded operator for scalar division.
const Vector3 operator/ (const float &b) const
 Overloaded operator for scalar division.
bool operator== (const Vector3 &b) const
 Comparison operator.
bool operator!= (const Vector3 &b) const
 Comparison operator.
void Zero (void)
 Zeros a vector.
void Set (float x, float y, float z)
 Sets the vector to the given coordinates.
void Swap (Vector3 &b)
 Swap the vector with a given vector.
Vector3 Normalize (void)
 Normalizes the length of a vector.

Public Attributes

float x
float y
float z

Detailed Description

Contains a vector in 3D space.


Constructor & Destructor Documentation

Vector3::Vector3 ( float  px = 0.0,
float  py = 0.0,
float  pz = 0.0 
) [inline]
Vector3::Vector3 ( wxString  string) [inline]
Vector3::~Vector3 ( void  ) [inline]

Member Function Documentation

float Vector3::Abs ( void  )

Calculate the absolut length of a vector.

float Vector3::Dot ( const Vector3 b) [inline]

Calculates the dot product (inner product) of two vectors.

void Vector3::FromString ( wxString const &  string)
Vector3 Vector3::Normalize ( void  )

Normalizes the length of a vector.

bool Vector3::operator!= ( const Vector3 b) const [inline]

Comparison operator.

const Vector3 Vector3::operator* ( const Vector3 b) const [inline]
const Vector3 Vector3::operator* ( const float &  b) const [inline]

Overloaded operator for scalar product.

Vector3& Vector3::operator*= ( const Vector3 b) [inline]

Overloaded operator for vector product.

This function calculates the vector product

\[ \vec{c}=\left\{ \begin{array}{c} \vec{a}_y \cdot \vec{b}_z - \vec{a}_z \cdot \vec{b}_y \\ \vec{a}_z \cdot \vec{b}_x - \vec{a}_x \cdot \vec{b}_z \\ \vec{a}_x \cdot \vec{b}_y - \vec{a}_y \cdot \vec{b}_x \end{array} \right\} \]

.Overloaded operator for vector product.

Vector3& Vector3::operator*= ( const float &  b) [inline]

Overloaded operator for scalar product.

const Vector3 Vector3::operator+ ( const Vector3 a) const [inline]

Overloaded operator for vector addition.

Vector3& Vector3::operator+= ( const Vector3 a) [inline]

Overloaded operator for vector addition.

const Vector3 Vector3::operator- ( ) const [inline]

Overloaded operator for vector negation.

const Vector3 Vector3::operator- ( const Vector3 a) const [inline]

Overloaded operator for vector subtraction.

Vector3& Vector3::operator-= ( const Vector3 a) [inline]

Overloaded operator for vector subtraction.

const Vector3 Vector3::operator/ ( const float &  b) const [inline]

Overloaded operator for scalar division.

Vector3& Vector3::operator/= ( const float &  b) [inline]

Overloaded operator for scalar division.

bool Vector3::operator== ( const Vector3 b) const [inline]

Comparison operator.

void Vector3::Set ( float  x,
float  y,
float  z 
) [inline]

Sets the vector to the given coordinates.

void Vector3::Swap ( Vector3 b)

Swap the vector with a given vector.

wxString Vector3::ToString ( void  ) const
void Vector3::Zero ( void  )

Zeros a vector.


Member Data Documentation

float Vector3::x
float Vector3::y
float Vector3::z

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