sgVector3 Class Reference

#include <sgVector3.h>

List of all members.

Public Member Functions

 sgVector3 (float x_=0.0f, float y_=0.0f, float z_=0.0f)
 sgVector3 (const sgVector3 &other)
 sgVector3 (const sgQuaternion &other)
bool operator== (const sgVector3 &other)
bool operator!= (const sgVector3 &other)
sgVector3operator= (const sgVector3 &other)
sgVector3operator= (const float &other)
sgVector3operator= (const sgQuaternion &other)
sgVector3operator+= (const sgVector3 &other)
sgVector3operator-= (const sgVector3 &other)
sgVector3operator*= (const sgVector3 &other)
sgVector3operator/= (const sgVector3 &other)
sgVector3 operator+ (const sgVector3 &other)
sgVector3 operator- (const sgVector3 &other)
sgVector3 operator* (const sgVector3 &other)
sgVector3 operator/ (const sgVector3 &other)
sgVector3operator+= (const float &other)
sgVector3operator-= (const float &other)
sgVector3operator*= (const float &other)
sgVector3operator/= (const float &other)
sgVector3 operator+ (const float &other)
sgVector3 operator- (const float &other)
sgVector3 operator* (const float &other)
sgVector3 operator/ (const float &other)
sgVector3operator*= (const sgMatrix4x4 &other)
sgVector3 operator* (const sgMatrix4x4 &other)
float length ()
void makeIdentity ()
void normalize ()
float dot (sgVector3 &other)
sgVector3 cross (sgVector3 &other)
float dist (sgVector3 &other)

Public Attributes

float x
float y
float z

Detailed Description

3D vector class. Stores a vector with three elements and provides functionality for it.


Constructor & Destructor Documentation

sgVector3::sgVector3 ( float  x_ = 0.0f,
float  y_ = 0.0f,
float  z_ = 0.0f 
)

Constructor. Initializes a new instance.

Parameters:
x_ the x value
y_ the y value
z_ the z value
sgVector3::sgVector3 ( const sgVector3 other  ) 

Constructor. Initializes a new instance.

Parameters:
other vector to copy the values from
sgVector3::sgVector3 ( const sgQuaternion other  ) 

Constructor. Initializes a new instance from a quaternion.

Parameters:
other quaternion to to get the euler angles from

Member Function Documentation

sgVector3 sgVector3::cross ( sgVector3 other  ) 

Cross product. The cross product of the vector with the other one (ignoring the fourth parameter).

Parameters:
other another vector
Returns:
the resulting vector
float sgVector3::dist ( sgVector3 other  ) 

Distance. The distance of the vector with the other one.

Parameters:
other another vector
Returns:
the distance of both vectors
float sgVector3::dot ( sgVector3 other  ) 

Dot product. The dot product of the vector with the other one.

Parameters:
other another vector
Returns:
the resulting scalar
float sgVector3::length (  ) 

Length. Get the length of the vector.

Returns:
the vectors length
void sgVector3::makeIdentity (  ) 

Make identity. Sets the vectors components to 0.

void sgVector3::normalize (  ) 

Normalize. Keeps the vectors direction, but sets its length to 1.

bool sgVector3::operator!= ( const sgVector3 other  ) 

Not equal. Checks if two instances do not equal each other.

sgVector3 sgVector3::operator* ( const sgMatrix4x4 other  ) 

Multiply. Transforms the vector with the matrix, with the matrix on the right.

sgVector3 sgVector3::operator* ( const float &  other  ) 

Multiply. Multiply the scalar to each component of the vector.

sgVector3 sgVector3::operator* ( const sgVector3 other  ) 

Multiply. Multiply the two vectors component wise.

sgVector3 & sgVector3::operator*= ( const sgMatrix4x4 other  ) 

Multiply. Transforms the vector with the matrix, with the matrix on the right.

sgVector3 & sgVector3::operator*= ( const float &  other  ) 

Multiply. Multiply the scalar to each component of the vector.

sgVector3 & sgVector3::operator*= ( const sgVector3 other  ) 

Multiply. Multiply the two vectors component wise.

sgVector3 sgVector3::operator+ ( const float &  other  ) 

Add. Add the scalar to each component of the vector.

sgVector3 sgVector3::operator+ ( const sgVector3 other  ) 

Add. Add the two vectors component wise.

sgVector3 & sgVector3::operator+= ( const float &  other  ) 

Add. Add the scalar to each component of the vector.

sgVector3 & sgVector3::operator+= ( const sgVector3 other  ) 

Add. Add the two vectors component wise.

sgVector3 sgVector3::operator- ( const float &  other  ) 

Substract. Substract the scalar from each component of the vector.

sgVector3 sgVector3::operator- ( const sgVector3 other  ) 

Substract. Substract the two vectors component wise.

sgVector3 & sgVector3::operator-= ( const float &  other  ) 

Substract. Substract the scalar from each component of the vector.

sgVector3 & sgVector3::operator-= ( const sgVector3 other  ) 

Substract. Substract the two vectors component wise.

sgVector3 sgVector3::operator/ ( const float &  other  ) 

Divide. Divide each component of the vector by the scalar.

sgVector3 sgVector3::operator/ ( const sgVector3 other  ) 

Divide. Divide the two vectors component wise.

sgVector3 & sgVector3::operator/= ( const float &  other  ) 

Divide. Divide each component of the vector by the scalar.

sgVector3 & sgVector3::operator/= ( const sgVector3 other  ) 

Divide. Divide the two vectors component wise.

sgVector3 & sgVector3::operator= ( const sgQuaternion other  ) 

Copy. Copy the quaternions euler angle representation to the vector.

sgVector3 & sgVector3::operator= ( const float &  other  ) 

Copy. Sets all components to the value of the scalar.

sgVector3 & sgVector3::operator= ( const sgVector3 other  ) 

Copy. Copy the values of one instance to the other.

bool sgVector3::operator== ( const sgVector3 other  ) 

Equal. Checks if two instances equal each other.


Member Data Documentation

float sgVector3::x

X. The vectors x component.

float sgVector3::y

Y. The vectors y component.

float sgVector3::z

Z. The vectors z component.


The documentation for this class was generated from the following files:
Generated on Thu Jun 3 13:31:04 2010 for iSDGE by  doxygen 1.6.3