![]() |
http://www.sim.no http://www.coin3d.org |
The SbVec4f class is a 4 dimensional vector with floating point coordinates. More...
#include <Inventor/SbLinear.h>
Public Member Functions | |
SbVec4f (void) | |
SbVec4f (const float v[4]) | |
SbVec4f (const float x, const float y, const float z, const float w) | |
SbVec4f (const SbVec4d &v) | |
float | dot (const SbVec4f &v) const |
SbBool | equals (const SbVec4f &v, const float tolerance) const |
void | getReal (SbVec3f &v) const |
const float * | getValue (void) const |
void | getValue (float &x, float &y, float &z, float &w) const |
float | length (void) const |
float | sqrLength (void) const |
void | negate (void) |
float | normalize (void) |
SbVec4f & | setValue (const float v[4]) |
SbVec4f & | setValue (const float x, const float y, const float z, const float w) |
SbVec4f & | setValue (const SbVec4d &v) |
float & | operator[] (const int i) |
const float & | operator[] (const int i) const |
SbVec4f & | operator*= (const float d) |
SbVec4f & | operator/= (const float d) |
SbVec4f & | operator+= (const SbVec4f &u) |
SbVec4f & | operator-= (const SbVec4f &u) |
SbVec4f | operator- (void) const |
void | print (FILE *fp) const |
Friends | |
SbVec4f | operator* (const SbVec4f &v, const float d) |
SbVec4f | operator* (const float d, const SbVec4f &v) |
SbVec4f | operator/ (const SbVec4f &v, const float d) |
SbVec4f | operator+ (const SbVec4f &v1, const SbVec4f &v2) |
SbVec4f | operator- (const SbVec4f &v1, const SbVec4f &v2) |
int | operator== (const SbVec4f &v1, const SbVec4f &v2) |
int | operator!= (const SbVec4f &v1, const SbVec4f &v2) |
Related Symbols | |
(Note that these are not member symbols.) | |
SbVec4f | operator* (const SbVec4f &v, const float d) |
SbVec4f | operator* (const float d, const SbVec4f &v) |
SbVec4f | operator/ (const SbVec4f &v, const float d) |
SbVec4f | operator+ (const SbVec4f &v1, const SbVec4f &v2) |
SbVec4f | operator- (const SbVec4f &v1, const SbVec4f &v2) |
int | operator== (const SbVec4f &v1, const SbVec4f &v2) |
int | operator!= (const SbVec4f &v1, const SbVec4f &v2) |
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
This vector class is used by many other classes in Coin. It provides storage for a 3 dimensional homogeneoues vector (with the 4 components usually referred to as <x, y, z, w>) aswell as simple floating point arithmetic operations.
SbVec4f::SbVec4f | ( | void | ) |
The default constructor does nothing. The vector coordinates will be uninitialized until a call the setValue().
Referenced by operator-().
Constructs an SbVec4f instance with the initial homogeneous vector set to <x,y,z,w>.
Calculates and returns the result of taking the dot product of this vector and v.
Referenced by SbRotation::slerp().
Compares the vector with v and returns TRUE
if the distance between the vectors is smaller or equal to the square root of tolerance.
The comparison is done in 4D-space, i.e. the w component of the vector is not used to make x, y and z into Cartesian coordinates first.
References SoDebugError::postWarning().
Referenced by SbRotation::equals().
Returns the vector as a Cartesian 3D vector in v. This means that the 3 first components x, y and z will be divided by the fourth, w.
References SoDebugError::postWarning().
Referenced by SoIndexedNurbsSurface::computeBBox(), SoIndexedShape::computeBBox(), and SoNonIndexedShape::computeCoordBBox().
Returns a pointer to an array of four floats containing the x, y, z and w coordinates of the vector.
void SbVec4f::getValue | ( | float & | x, |
float & | y, | ||
float & | z, | ||
float & | w ) const |
Returns the x, y, z and w coordinates of the vector.
float SbVec4f::length | ( | void | ) | const |
Return the length of the vector in 4D space.
Referenced by SbRotation::inverse(), SbRotation::invert(), and normalize().
float SbVec4f::sqrLength | ( | void | ) | const |
Return the square of the length of the vector in 4D space.
Negate the vector.
Referenced by SbRotation::slerp().
float SbVec4f::normalize | ( | void | ) |
Normalize the vector to unit length. Return value is the original length of the vector before normalization.
References length(), operator/=(), and SoDebugError::postWarning().
Referenced by SbRotation::setValue(), and SbRotation::setValue().
Set new coordinates for the vector from v. Returns reference to self.
Referenced by SoShape::generateVertex().
Set new coordinates for the vector. Returns reference to self.
float & SbVec4f::operator[] | ( | const int | i | ) |
Index operator. Returns modifiable x, y, z or w component of vector.
References SoDebugError::postWarning().
Index operator. Returns x, y, z or w component of vector.
References SoDebugError::postWarning().
Multiply components of vector with value d. Returns reference to self.
Divides components of vector with value d. Returns reference to self.
References SoDebugError::postWarning().
Referenced by normalize().
Adds this vector and vector u. Returns reference to self.
Subtracts vector u from this vector. Returns reference to self.
Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile.
Referenced by SbRotation::print().
Returns an SbVec4f instance which is the components of vector v multiplied with d.
Returns an SbVec4f instance which is the components of vector v multiplied with d.
Returns an SbVec4f instance which is the components of vector v divided on the scalar factor d.
Returns an SbVec4f instance which is the sum of vectors v1 and v2.
Returns an SbVec4f instance which is vector v2 subtracted from vector v1.
Returns 1 if v1 and v2 are equal, 0 otherwise.
Returns 1 if v1 and v2 are not equal, 0 if they are equal.
Returns an SbVec4f instance which is the components of vector v multiplied with d.
Returns an SbVec4f instance which is the components of vector v multiplied with d.
Returns an SbVec4f instance which is the components of vector v divided on the scalar factor d.
Returns an SbVec4f instance which is the sum of vectors v1 and v2.
Returns an SbVec4f instance which is vector v2 subtracted from vector v1.
Returns 1 if v1 and v2 are equal, 0 otherwise.
Returns 1 if v1 and v2 are not equal, 0 if they are equal.
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Jan 22 2024 for Coin by Doxygen. 1.10.0