sonus::Vector3D Class Reference

#include <Vector3D.h>

List of all members.

Public Member Functions

 Vector3D ()
 Vector3D (const Vector3D *v)
 Vector3D (double x, double y, double z)
 Vector3D (double arr[])
Vector3DsetTo (double x, double y, double z)
Vector3DsetTo (double a[])
Vector3DsetTo (Vector3D *v)
Vector3DsetTo (Vector3D v)
Vector3Dunify ()
double magnitude ()
double dot (Vector3D v)
Vector3D cross (Vector3D v)
Vector3Dtransform (double transmatrix[16])
void toArray (double *arr)
char * toString ()
Vector3Doperator= (Vector3D v2)
Vector3Doperator+= (Vector3D v2)
Vector3Doperator+= (short s)
Vector3Doperator+= (int i)
Vector3Doperator+= (long l)
Vector3Doperator+= (float f)
Vector3Doperator+= (double d)
Vector3Doperator-= (Vector3D v2)
Vector3Doperator-= (short s)
Vector3Doperator-= (int i)
Vector3Doperator-= (long l)
Vector3Doperator-= (float f)
Vector3Doperator-= (double d)
Vector3Doperator *= (Vector3D v2)
Vector3Doperator *= (short s)
Vector3Doperator *= (int i)
Vector3Doperator *= (long l)
Vector3Doperator *= (float f)
Vector3Doperator *= (double d)
Vector3Doperator/= (Vector3D v2)
Vector3Doperator/= (short s)
Vector3Doperator/= (int i)
Vector3Doperator/= (long l)
Vector3Doperator/= (float f)
Vector3Doperator/= (double d)
Vector3D operator+ (Vector3D v2)
Vector3D operator+ (short s)
Vector3D operator+ (int i)
Vector3D operator+ (long l)
Vector3D operator+ (float f)
Vector3D operator+ (double d)
Vector3D operator- (Vector3D v2)
Vector3D operator- (short s)
Vector3D operator- (int i)
Vector3D operator- (long l)
Vector3D operator- (float f)
Vector3D operator- (double d)
Vector3D operator * (Vector3D v2)
Vector3D operator * (short s)
Vector3D operator * (int i)
Vector3D operator * (long l)
Vector3D operator * (double d)
Vector3D operator * (float f)
Vector3D operator/ (Vector3D v2)
Vector3D operator/ (short s)
Vector3D operator/ (int i)
Vector3D operator/ (long l)
Vector3D operator/ (double d)
Vector3D operator/ (float f)

Public Attributes

double x
double y
double z

Friends

Vector3D operator+ (short s, Vector3D v)
Vector3D operator+ (int i, Vector3D v)
Vector3D operator+ (long l, Vector3D v)
Vector3D operator+ (float f, Vector3D v)
Vector3D operator+ (double d, Vector3D v)
Vector3D operator- (short s, Vector3D v)
Vector3D operator- (int i, Vector3D v)
Vector3D operator- (long l, Vector3D v)
Vector3D operator- (float f, Vector3D v)
Vector3D operator- (double d, Vector3D v)
Vector3D operator * (short s, Vector3D v)
Vector3D operator * (int i, Vector3D v)
Vector3D operator * (long l, Vector3D v)
Vector3D operator * (float f, Vector3D v)
Vector3D operator * (double d, Vector3D v)
Vector3D operator/ (short s, Vector3D v)
Vector3D operator/ (int i, Vector3D v)
Vector3D operator/ (long l, Vector3D v)
Vector3D operator/ (float f, Vector3D v)
Vector3D operator/ (double d, Vector3D v)


Detailed Description

sonus::Vector3D

A mathematical three dimensional vector with all important functions.

filename: Vector3D.h

Date:
2008/04/27 18:09
Author:
Alexander Lawrence
Version:
1.0

Constructor & Destructor Documentation

sonus::Vector3D::Vector3D (  ) 

Constructor

sonus::Vector3D::Vector3D ( const Vector3D v  ) 

Copy constructor

Parameters:
v the vector to be copied

sonus::Vector3D::Vector3D ( double  x,
double  y,
double  z 
)

Constructor with doubles

Parameters:
x x value
y y value
z z value

sonus::Vector3D::Vector3D ( double  arr[]  ) 

Constructor with array

Parameters:
arr double array with length of 3


Member Function Documentation

Vector3D* sonus::Vector3D::setTo ( double  x,
double  y,
double  z 
)

Sets vector to given double values

Parameters:
x x value
y y value
z z value
Returns:
pointer to vector itself

Vector3D* sonus::Vector3D::setTo ( double  a[]  ) 

Sets vector to given array values

Parameters:
a double array with length of 3
Returns:
pointer to vector itself

Vector3D* sonus::Vector3D::setTo ( Vector3D v  ) 

Sets vector to given vector pointer values

Parameters:
v the vector pointer to be copied
Returns:
pointer to vector itself

Vector3D* sonus::Vector3D::setTo ( Vector3D  v  ) 

Sets vector to given vector values

Parameters:
v the vector to be copied
Returns:
pointer to vector itself

Vector3D* sonus::Vector3D::unify (  ) 

Unifies the vector. This means the vector is divided by his length, which leaves him with a total length of 1.

Returns:
pointer to vector itself

double sonus::Vector3D::magnitude (  ) 

Calculates the magnitude of the vector. Used in unify().

Returns:
the magnitude of the vector

double sonus::Vector3D::dot ( Vector3D  v  ) 

Calculates the dot product of self and given vector.

Parameters:
v the 2nd vector
Returns:
the dot product of the vector itself and the 2nd vector

Vector3D sonus::Vector3D::cross ( Vector3D  v  ) 

Calculates the vector product of self and given vector.

Parameters:
v the 2nd vector
Warning:
not implemented
Returns:
the cross product of the vector itself and the 2nd vector

Vector3D* sonus::Vector3D::transform ( double  transmatrix[16]  ) 

Transforms a vector by given transformation matrix. Used by the Haptics module to transform the device workspace to the application workspace.

Parameters:
transmatrix double array with a length of 16
See also:
sonus::Haptics

void sonus::Vector3D::toArray ( double *  arr  ) 

Converts the vector to an array.

Parameters:
arr out parameter: the array the values to be saved in

char* sonus::Vector3D::toString (  ) 

Returns a string. Only for testing and debug.

Returns:
meta string


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 12:26:54 2008 for sonus by  doxygen 1.5.4