sgVector4 Class Reference

#include <sgVector4.h>

List of all members.

Public Member Functions

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

Public Attributes

float x
float y
float z
float w

Detailed Description

4D vector class. Stores a vector with four elements and provides functionality for it.


Constructor & Destructor Documentation

sgVector4::sgVector4 ( float  x_ = 0.0f,
float  y_ = 0.0f,
float  z_ = 0.0f,
float  w_ = 0.0f 
)

Constructor. Initializes a new instance.

Parameters:
x_ the x value
y_ the y value
z_ the z value
w_ the w value
sgVector4::sgVector4 ( const sgVector4 other  ) 

Constructor. Initializes a new instance.

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

Constructor. Initializes a new instance from a quaternion.

Parameters:
other quaternion to to get the axis-angle components from

Member Function Documentation

sgVector4 sgVector4::cross ( sgVector4 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 sgVector4::dist ( sgVector4 other  ) 

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

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

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

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

Length. Get the length of the vector.

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

Make identity. Sets the vectors components to 0.

void sgVector4::normalize (  ) 

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

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

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

sgVector4 sgVector4::operator* ( const sgMatrix4x4 other  ) 

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

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

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

sgVector4 sgVector4::operator* ( const sgVector4 other  ) 

Multiply. Multiply the two vectors component wise.

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

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

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

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

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

Multiply. Multiply the two vectors component wise.

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

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

sgVector4 sgVector4::operator+ ( const sgVector4 other  ) 

Add. Add the two vectors component wise.

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

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

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

Add. Add the two vectors component wise.

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

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

sgVector4 sgVector4::operator- ( const sgVector4 other  ) 

Substract. Substract the two vectors component wise.

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

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

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

Substract. Substract the two vectors component wise.

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

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

sgVector4 sgVector4::operator/ ( const sgVector4 other  ) 

Divide. Divide the two vectors component wise.

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

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

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

Divide. Divide the two vectors component wise.

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

Copy. Copy the quaternions rotations axis-angle representation to the vector.

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

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

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

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

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

Equal. Checks if two instances equal each other.


Member Data Documentation

float sgVector4::w

W. The vectors w component.

float sgVector4::x

X. The vectors x component.

float sgVector4::y

Y. The vectors y component.

float sgVector4::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