Gel2D - The free/open source game creation suite

Public Member Functions | Public Attributes
gel::Gel3dVec Class Reference

3D vector class with lots of operators and a few useful functions. More...

#include <gelVector.h>

List of all members.

Public Member Functions

 Gel3dVec ()
 Default constructor.
 Gel3dVec (const Gel3dVec &vec)
 Copy constructor.
 Gel3dVec (float n)
 Single value constructor.
 Gel3dVec (float _x, float _y, float _z)
 Gel3dVec constructor.
float getLength () const
 Gets the length of the vector.
float getSqrLength () const
 Gets the square length of the vector.
float getDistanceTo (const Gel3dVec &vec) const
 Gets the distance from this vector to another Gel3dVec.
float getDot (const Gel3dVec &vec) const
 Gets the dot product of this vector with another Gel3dVec.
Gel3dVec getCross (const Gel3dVec &vec) const
 Gets the cross product of this vector with another Gel3dVec.
void normalize ()
 Normalizes the vector.
Gel3dVec operator+ (const Gel3dVec &v)
Gel3dVec operator- (const Gel3dVec &v)
Gel3dVec operator* (const Gel3dVec &v)
Gel3dVec operator/ (const Gel3dVec &v)
Gel3dVec operator= (const Gel3dVec &v)
Gel3dVec operator+= (const Gel3dVec &v)
Gel3dVec operator-= (const Gel3dVec &v)
Gel3dVec operator*= (const Gel3dVec &v)
Gel3dVec operator/= (const Gel3dVec &v)
bool operator== (const Gel3dVec &v) const
bool operator!= (const Gel3dVec &v) const

Public Attributes

float x
 x coordinate.
float y
 y coordinate.
float z
 z coordinate.

Detailed Description

3D vector class with lots of operators and a few useful functions.

This class exists solely for possible future needs. It currently has no applicable purposes in a 2D environment, at least as far as I can tell.


Constructor & Destructor Documentation

gel::Gel3dVec::Gel3dVec ( ) [inline]

Default constructor.

gel::Gel3dVec::Gel3dVec ( const Gel3dVec vec) [inline]

Copy constructor.

Parameters:
vec: The Gel3dVec to copy.
gel::Gel3dVec::Gel3dVec ( float  n) [inline]

Single value constructor.

Parameters:
n: Value to use for the vector's x, y and z coordinates.
gel::Gel3dVec::Gel3dVec ( float  _x,
float  _y,
float  _z 
) [inline]

Gel3dVec constructor.

Parameters:
_x: The vector's x coordinate.
_y: The vector's y coordinate.
_z: The vector's z coordinate.

Member Function Documentation

float gel::Gel3dVec::getLength ( ) const [inline]

Gets the length of the vector.

Returns:
The length of the vector.
float gel::Gel3dVec::getSqrLength ( ) const [inline]

Gets the square length of the vector.

Returns:
The length of the vector squared.
float gel::Gel3dVec::getDistanceTo ( const Gel3dVec vec) const [inline]

Gets the distance from this vector to another Gel3dVec.

Parameters:
vec: The Gel3dVec to get the distance to.
Returns:
The distance to vec.
float gel::Gel3dVec::getDot ( const Gel3dVec vec) const [inline]

Gets the dot product of this vector with another Gel3dVec.

Parameters:
vec: A Gel3dVec.
Returns:
The dot product.
Gel3dVec gel::Gel3dVec::getCross ( const Gel3dVec vec) const [inline]

Gets the cross product of this vector with another Gel3dVec.

Parameters:
vec: A Gel3dVec.
Returns:
The cross product.
void gel::Gel3dVec::normalize ( ) [inline]

Normalizes the vector.

Gel3dVec gel::Gel3dVec::operator+ ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator- ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator* ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator/ ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator= ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator+= ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator-= ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator*= ( const Gel3dVec v) [inline]
Gel3dVec gel::Gel3dVec::operator/= ( const Gel3dVec v) [inline]
bool gel::Gel3dVec::operator== ( const Gel3dVec v) const [inline]
bool gel::Gel3dVec::operator!= ( const Gel3dVec v) const [inline]

Member Data Documentation

x coordinate.

y coordinate.

z coordinate.


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