#include <vuVector.h>
Collaboration diagram for vuVector:
Public Member Functions | |
vuVector () | |
Default constructor making a zero vector. | |
vuVector (const vuVector &v) | |
Copy constructor. | |
vuVector (float v1, float v2, float v3) | |
Constructor initializing to a 3d vector in homogenous space. | |
vuVector (float v1, float v2, float v3, float v4) | |
Constructor initializing to a homogenous 3d vector. | |
vuVector (float v) | |
Constructor initializing the x,y,z coordinates to v. | |
vuVector (const float *v) | |
Constructor initializing the vector from an array of floats. | |
~vuVector () | |
The destructor. | |
vuVector & | operator= (const vuVector &v) |
The assignment operator. | |
vuVector & | operator= (float v) |
Assigns the value v to the x,y,z elements of the vector. | |
vuVector & | operator= (const float *v) |
Assigns a 3d float array to the vector. | |
float | norm (void) const |
Computes the 2-norm on the vector (lenght operator). | |
float | norm2 (void) const |
Computes squared 2-norm (scalar product with itself). | |
vuVector & | makeUnit (void) |
Normalizes the vector to a length of 1. | |
vuVector & | normalize (void) |
Normalizes the vector in homogenous space. | |
vuVector | inv (void) const |
Returns the entry-wise inverse of the vector. | |
vuVector & | invEq (void) |
Inverts the vector entry-wise. | |
vuVector | mul (const vuVector &rhs) const |
Returns the entry-wise product of the vector with another vector. | |
vuVector & | mulEq (const vuVector &rhs) |
Multiplies the vector, entry-wise, by another vector. | |
vuVector | div (const vuVector &rhs) const |
Returns the entry-wise division of the vector by another vector. | |
vuVector & | divEq (const vuVector &rhs) |
Divides the vector, entry-wise, by another vector. | |
float & | operator[] (dword index) |
The access operator. | |
const float & | operator[] (dword index) const |
The const access operator. | |
float * | getData (void) |
Returns the data pointer. | |
float const * | getData (void) const |
const version of getData() | |
float | dot (const vuVector &v) const |
Returns the dot product of the vector with another vector. | |
vuVector | cross (const vuVector &v) const |
Returns the cross product of the vector with another vector. | |
vuVector | operator+ (const vuVector &v) const |
Returns the sum of the vector with another vector. | |
vuVector | operator- (const vuVector &v) const |
Returns the difference of the vector from another vector. | |
vuVector | operator * (const vuMatrix &m) const |
Returns the product of the vector and a matrix. | |
vuMatrix | operator * (const vuVector &v) const |
Returns the product of the vector with another vector. | |
vuVector | operator * (float s) const |
Returns the product of the vector with a scalar. | |
vuVector | operator/ (float s) const |
Returns the fraction of the vector with a scalar. | |
vuVector & | operator+= (const vuVector &v) |
Adds a vector to this vector. | |
vuVector & | operator-= (const vuVector &v) |
Subtracts a vector from this vector. | |
vuVector & | operator *= (const vuMatrix &m) |
Multiplies the vector by a matrix. | |
vuVector & | operator *= (float s) |
Multiplies the vector by a scalar. | |
bool | operator== (const vuVector &v) const |
An equality operator, comparing only the x,y,z coordinates. | |
bool | operator!= (const vuVector &v) const |
An inequality operator, comparing only the x,y,z coordinates. | |
int | getDominantAxis () const |
Returns index of component with highest absolute. | |
void | print () |
prints values to the stdout | |
int | load (char *load_from) |
this will load the values referenced by load_from | |
void | save (char *save_to) |
this will set read_to to be the four ascii values in x, y, z, w | |
vuString | getString () |
returns a c-string representation without ' ' | |
Private Attributes | |
float | val [4] |
The coordinates of the vector stored as a floating point array. | |
Friends | |
class | vuMatrix |
float | dot (const vuVector &v1, const vuVector &v2) |
Returns the dot product of two vectors. | |
vuVector | cross (const vuVector &v1, const vuVector &v2) |
Returns the cross product of two vectors. | |
const vuVector | operator * (float s, const vuVector &v) |
Returns the product of a scalar with a vector. | |
ostream & | operator<< (ostream &out, const vuVector &v) |
writes the foure elements to a stream; separated by whitespaces | |
istream & | operator>> (istream &in, vuVector &v) |
reads a vector from a stream |
The vuVector class is a 3D homogeneous vector that works in conjunction with the vuMatrix class (a 4x4 matrix). The elements of the vuVector are all single precision floating- point numbers.
Definition at line 28 of file vuVector.h.
|
Default constructor making a zero vector.
Definition at line 7 of file vuVector.cpp. References val. |
|
Copy constructor.
Definition at line 14 of file vuVector.cpp. References val. |
|
Constructor initializing to a 3d vector in homogenous space.
Definition at line 23 of file vuVector.cpp. References val. |
|
Constructor initializing to a homogenous 3d vector.
Definition at line 32 of file vuVector.cpp. References val. |
|
Constructor initializing the x,y,z coordinates to v.
Definition at line 41 of file vuVector.cpp. References val. |
|
Constructor initializing the vector from an array of floats.
Definition at line 48 of file vuVector.cpp. References val. |
|
The destructor.
Definition at line 57 of file vuVector.cpp. |
|
Returns the cross product of the vector with another vector.
Definition at line 241 of file vuVector.cpp. References val. |
|
Returns the entry-wise division of the vector by another vector.
Definition at line 198 of file vuVector.cpp. References val. |
|
Divides the vector, entry-wise, by another vector.
Definition at line 209 of file vuVector.cpp. References val. |
|
Returns the dot product of the vector with another vector.
Definition at line 235 of file vuVector.cpp. References val. |
|
const version of getData()
Definition at line 114 of file vuVector.cpp. |
|
Returns the data pointer. The data is stored as a four dimensional float array. The getData() function can both retrieve and modify; it is similar to the [] operator. To warrant the return of a const pointer (for use in other const member functions) explicitly cast the pointer returned to (const). Definition at line 111 of file vuVector.cpp. Referenced by MCMesh::_compileData(), vuGrid::drawLine(), vu1112111::drawSplatOrtho(), vu1512111::drawSplatOrtho(), vu111211a::drawTetNormals(), vuCamera::getViewMat(), vuParallelCamera::project(), MCMesh::render(), vu111211a::render(), vu1512112::sortByDistance(), and vu1112117::updateShLight(). |
|
Returns index of component with highest absolute.
Definition at line 418 of file vuVector.cpp. References val. Referenced by main(). |
|
returns a c-string representation without '
Definition at line 556 of file vuVector.cpp. References val. |
|
Returns the entry-wise inverse of the vector. Entry wise meaning that each of the x, y, z coordinates is treated separately, leaving the fourth w coordinate untouched. Definition at line 158 of file vuVector.cpp. References val. |
|
Inverts the vector entry-wise.
Definition at line 169 of file vuVector.cpp. References val. |
|
this will load the values referenced by load_from the values will come in as ascii values and will have to be converted to floats. they will be received in the format; x, y, z, w the last position will be returned. Definition at line 492 of file vuVector.cpp. References get_next_blank(), get_next_comma(), strip_white_space(), and val. Referenced by vuCamera::RestoreShotBasic(), vuParallelCamera::RestoreShotOrtho(), and vuPerspectiveCamera::RestoreShotPersp(). |
Here is the call graph for this function:
|
|
Returns the entry-wise product of the vector with another vector.
Definition at line 178 of file vuVector.cpp. References val. Referenced by vuMatrix::makeRotate(). |
|
Multiplies the vector, entry-wise, by another vector.
Definition at line 189 of file vuVector.cpp. References val. |
|
Computes the 2-norm on the vector (lenght operator).
Definition at line 118 of file vuVector.cpp. References val. Referenced by MarchingCubesBase::calcVertex(), vuSplat::glOnMouse(), vuSpecSplat::glOnMouse(), vuSpecFVR::glOnMouse(), vuShearWarp::glOnMouse(), vuPreviewWin::glOnMouse(), vuFVR::glOnMouse(), vuCellProjector::glOnMouse(), vuBccSplat::glOnMouse(), vuBCCSheetSplatter::glOnMouse(), vuBCCShearWarp::glOnMouse(), vuBCCMarchingTetrahedra::glOnMouse(), vuPerspectiveCamera::init(), main(), vuBasicUtility::onKeyboardRotate(), vuBasicUtility::onMouseLeftMoving(), realTrans(), ns_vu1112112::vuSampleRay::SamplingDistance(), ns_vu1112113::vuSampleRay::SamplingDistance(), and vuSpherical::vuSpherical(). |
|
Computes squared 2-norm (scalar product with itself).
Definition at line 124 of file vuVector.cpp. References val. Referenced by vu1512113::renderImage(), and vuArcBall::turn(). |
|
Normalizes the vector in homogenous space. Divides the whole vector by the 4th coordinate to make it 1. Definition at line 146 of file vuVector.cpp. References val. Referenced by vuConvexHull::angleThreshold(), ns_vu1112112::Parser::ReadGeneral(), vuSphericView< SIZE, TYPE >::writeIntoBuffer(), and vuSphericView< SIZE, TYPE >::writeToFileStream(). |
|
Returns the product of the vector with a scalar.
Definition at line 298 of file vuVector.cpp. References val. |
|
Returns the product of the vector with another vector.
Definition at line 287 of file vuVector.cpp. References dword, val, and vuMatrix::val. |
|
Returns the product of the vector and a matrix.
Definition at line 275 of file vuVector.cpp. References dword, vuMatrix::val, and val. |
|
Multiplies the vector by a scalar.
Definition at line 397 of file vuVector.cpp. References val. |
|
Multiplies the vector by a matrix.
Definition at line 379 of file vuVector.cpp. References dword, vuMatrix::val, and val. |
|
An inequality operator, comparing only the x,y,z coordinates.
Definition at line 413 of file vuVector.cpp. References operator==(). |
Here is the call graph for this function:
|
Returns the sum of the vector with another vector.
Definition at line 253 of file vuVector.cpp. References val. |
|
Adds a vector to this vector.
Definition at line 331 of file vuVector.cpp. References val. |
|
Returns the difference of the vector from another vector.
Definition at line 264 of file vuVector.cpp. References val. |
|
Subtracts a vector from this vector.
Definition at line 341 of file vuVector.cpp. References val. |
|
Returns the fraction of the vector with a scalar.
Definition at line 309 of file vuVector.cpp. References val. |
|
Assigns a 3d float array to the vector.
Definition at line 83 of file vuVector.cpp. References val. |
|
Assigns the value v to the x,y,z elements of the vector.
Definition at line 75 of file vuVector.cpp. References val. |
|
The assignment operator.
Definition at line 62 of file vuVector.cpp. References val. |
|
An equality operator, comparing only the x,y,z coordinates.
Definition at line 407 of file vuVector.cpp. References val. Referenced by operator!=(). |
|
The const access operator.
Definition at line 99 of file vuVector.cpp. |
|
The access operator.
Definition at line 93 of file vuVector.cpp. |
|
prints values to the stdout
Definition at line 431 of file vuVector.cpp. References val. Referenced by vu1512112::read(), vu1512112::readRaw(), and realTrans(). |
|
this will set read_to to be the four ascii values in x, y, z, w this will use the same format as load Definition at line 516 of file vuVector.cpp. References val. Referenced by vuCamera::TakeSnapShotBasic(), vuParallelCamera::TakeSnapShotOrtho(), and vuPerspectiveCamera::TakeSnapShotPersp(). |
|
Returns the cross product of two vectors.
Definition at line 224 of file vuVector.cpp. Referenced by Scanner::_calcViewVectors(), vuFourierVolume< S >::calcViewVectors(), vu111211A::computeViewMatrix(), vu1512119::computeViewMatrix(), MCMesh::MCTriangle::GetNormal(), vu111211a::getNormal(), vuPerspectiveCamera::init(), vuParallelCamera::init(), vuShearWarp::OnButtonApplyViewing(), vuBCCShearWarp::OnButtonApplyViewing(), vuParallelCamera::project(), vuCamera::setLookAtVector(), vuCamera::setUpVector(), and vuArcBall::turn(). |
|
|
Returns the product of a scalar with a vector.
Definition at line 320 of file vuVector.cpp. |
|
writes the foure elements to a stream; separated by whitespaces
Definition at line 538 of file vuVector.cpp. |
|
reads a vector from a stream
Definition at line 547 of file vuVector.cpp. |
|
Definition at line 30 of file vuVector.h. |
|
The coordinates of the vector stored as a floating point array.
Definition at line 166 of file vuVector.h. Referenced by cross(), cross(), div(), divEq(), dot(), dot(), getDominantAxis(), getString(), inv(), invEq(), load(), makeUnit(), mul(), mulEq(), norm(), norm2(), normalize(), operator *(), operator *(), vuMatrix::operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator<<(), operator=(), operator==(), operator>>(), operator[](), print(), save(), and vuVector(). |