libHSPlasma
Public Member Functions | Public Attributes | List of all members
hsVector3 Struct Reference

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

#include <hsGeometry3.h>

Public Member Functions

 hsVector3 ()
 hsVector3 (float _x, float _y, float _z)
void Zero ()
float magnitude () const
bool operator== (const hsVector3 &other) const
bool operator!= (const hsVector3 &other) const
void read (hsStream *S)
void write (hsStream *S)
void prcWrite (pfPrcHelper *prc)
void prcParse (const pfPrcTag *tag)
hsVector3 operator+ (const hsVector3 &other) const
hsVector3 operator- (const hsVector3 &other) const
hsVector3 operator* (const float mult) const
float dotP (const hsVector3 &other) const
hsVector3 crossP (const hsVector3 &other) const

Public Attributes

float X
float Y
float Z

Detailed Description

Stores a vector in 3D space.

Constructor & Destructor Documentation

hsVector3::hsVector3 ( )

Construct a vector at the origin [0,0,0]

hsVector3::hsVector3 ( float  _x,
float  _y,
float  _z 
)

Construct a vector at [x,y,z]

Member Function Documentation

hsVector3 hsVector3::crossP ( const hsVector3 other) const

Multiplies two vectors using the Cross Product: $[x,y,z] = [(y_1*z_2) - (z_1*y_2),(z_1*x_2) - (x_1*z_2),(x_1*y_2) - (y_1*x_2)]$

float hsVector3::dotP ( const hsVector3 other) const

Multiplies two vectors using the Dot Product: $dot = x_1*x_2 + y_1*y_2 + z_1*z_2$

float hsVector3::magnitude ( ) const

Returns the magnitude of the vector: $\sqrt{x^2+y^2+z^2}$

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

Returns true if the values of the vectors are non-identical

hsVector3 hsVector3::operator* ( const float  mult) const

Multiplies the vector by the scalar factor mult: $[x,y,z] * mult = [x*mult,y*mult,z*mult]$

hsVector3 hsVector3::operator+ ( const hsVector3 other) const

Adds the vectors using vector addition: $[x_1,y_1,z_1] + [x_2,y_2,z_2] = [x_1+x_2,y_1+y_2,z_1+z_2]$

hsVector3 hsVector3::operator- ( const hsVector3 other) const

Subtracts the vectors using vector addition: $[x_1,y_1,z_1] - [x_2,y_2,z_2] = [x_1-x_2,y_1-y_2,z_1-z_2]$

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

Returns true if the values of the vectors are identical

void hsVector3::prcParse ( const pfPrcTag tag)

Parse a vector from PRC source

void hsVector3::prcWrite ( pfPrcHelper prc)

Write the vector to PRC source

void hsVector3::read ( hsStream S)

Reads the vector from a stream

void hsVector3::write ( hsStream S)

Writes the vector to a stream

void hsVector3::Zero ( )

Zeros the vector; that is, put it at the origin [0,0,0]

Member Data Documentation

float hsVector3::X
float hsVector3::Y
float hsVector3::Z

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