Rechercher une page de manuel
SbVec4f.3coin2
Langue: en
Version: 380378 (fedora - 01/12/10)
Section: 3 (Bibliothèques de fonctions)
Sommaire
- NAME
- SYNOPSIS
- Detailed Description
- Constructor & Destructor Documentation
- SbVec4f::SbVec4f (void)The default constructor does nothing. The vector coordinates will be uninitialized until a call the setValue().
- SbVec4f::SbVec4f (const float v[4])Constructs an SbVec4f instance with initial values from v.
- SbVec4f::SbVec4f (const float x, const float y, const float z, const float w)Constructs an SbVec4f instance with the initial homogeneous vector set to <x,y,z,w>.
- SbVec4f::SbVec4f (const SbVec4d & v) [inline, explicit]Constructs an SbVec4f instance with initial values from the vector v.
- Member Function Documentation
- float SbVec4f::dot (const SbVec4f & v) constCalculates and returns the result of taking the dot product of this vector and v.
- SbBool SbVec4f::equals (const SbVec4f & v, const float tolerance) constCompares the vector with v and returns TRUE if the distance between the vectors is smaller or equal to the square root of tolerance.
- void SbVec4f::getReal (SbVec3f & v) constReturns 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.
- const float * SbVec4f::getValue (void) constReturns 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) constReturns the x, y, z and w coordinates of the vector.
- float SbVec4f::length (void) constReturn the length of the vector in 4D space.
- float SbVec4f::sqrLength (void) constReturn the square of the length of the vector in 4D space.
- void SbVec4f::negate (void)Negate the vector.
- float SbVec4f::normalize (void)Normalize the vector to unit length. Return value is the original length of the vector before normalization.
- SbVec4f & SbVec4f::setValue (const float v[4])Set new coordinates for the vector from v. Returns reference to self.
- SbVec4f & SbVec4f::setValue (const float x, const float y, const float z, const float w)Set new coordinates for the vector. Returns reference to self.
- SbVec4f & SbVec4f::setValue (const SbVec4d & v)Sets the value from an SbVec4d instance. Returns reference to self.
- float & SbVec4f::operator[] (const int i)Index operator. Returns modifiable x, y, z or w component of vector.
- const float & SbVec4f::operator[] (const int i) constIndex operator. Returns x, y, z or w component of vector.
- SbVec4f & SbVec4f::operator*= (const float d)Multiply components of vector with value d. Returns reference to self.
- SbVec4f & SbVec4f::operator/= (const float d)Divides components of vector with value d. Returns reference to self.
- SbVec4f & SbVec4f::operator+= (const SbVec4f & u)Adds this vector and vector u. Returns reference to self.
- SbVec4f & SbVec4f::operator-= (const SbVec4f & u)Subtracts vector u from this vector. Returns reference to self.
- SbVec4f SbVec4f::operator- (void) constNon-destructive negation operator. Returns a new SbVec4f instance which has all components negated.
- void SbVec4f::print (FILE * fp) constDump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile.
- Author
NAME
SbVec4f -The SbVec4f class is a 4 dimensional vector with floating point coordinates.
SYNOPSIS
#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)
Detailed Description
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.
See also:
- SbVec2f, SbVec2d, SbVec3f, SbVec3d, SbVec4d
Constructor & Destructor Documentation
SbVec4f::SbVec4f (void)The default constructor does nothing. The vector coordinates will be uninitialized until a call the setValue().
Referenced by operator-().
SbVec4f::SbVec4f (const float v[4])Constructs an SbVec4f instance with initial values from v.
SbVec4f::SbVec4f (const float x, const float y, const float z, const float w)Constructs an SbVec4f instance with the initial homogeneous vector set to <x,y,z,w>.
SbVec4f::SbVec4f (const SbVec4d & v) [inline, explicit]Constructs an SbVec4f instance with initial values from the vector v.
Since:
- Coin-2.5
Member Function Documentation
float SbVec4f::dot (const SbVec4f & v) constCalculates and returns the result of taking the dot product of this vector and v.
Referenced by SbRotation::slerp().
SbBool SbVec4f::equals (const SbVec4f & v, const float tolerance) constCompares 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().
void SbVec4f::getReal (SbVec3f & v) constReturns 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 SoIndexedShape::computeBBox(), SoIndexedNurbsSurface::computeBBox(), and SoNonIndexedShape::computeCoordBBox().
const float * SbVec4f::getValue (void) constReturns a pointer to an array of four floats containing the x, y, z and w coordinates of the vector.
See also:
- setValue().
Referenced by SoSpotLight::GLRender(), SoPointLight::GLRender(), SoDirectionalLight::GLRender(), SoShape::invokeLineSegmentCallbacks(), SoShape::invokePointCallbacks(), and SoShape::invokeTriangleCallbacks().
void SbVec4f::getValue (float & x, float & y, float & z, float & w) constReturns the x, y, z and w coordinates of the vector.
See also:
- setValue().
float SbVec4f::length (void) constReturn the length of the vector in 4D space.
Referenced by SbRotation::inverse(), SbRotation::invert(), and normalize().
float SbVec4f::sqrLength (void) constReturn the square of the length of the vector in 4D space.
Since:
- Coin-2.5
void SbVec4f::negate (void)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().
SbVec4f & SbVec4f::setValue (const float v[4])Set new coordinates for the vector from v. Returns reference to self.
See also:
- getValue().
Referenced by SoShape::generateVertex().
SbVec4f & SbVec4f::setValue (const float x, const float y, const float z, const float w)Set new coordinates for the vector. Returns reference to self.
See also:
- getValue().
SbVec4f & SbVec4f::setValue (const SbVec4d & v)Sets the value from an SbVec4d instance. Returns reference to self.
Since:
- Coin-2.5
float & SbVec4f::operator[] (const int i)Index operator. Returns modifiable x, y, z or w component of vector.
See also:
- getValue() and setValue().
References SoDebugError::postWarning().
const float & SbVec4f::operator[] (const int i) constIndex operator. Returns x, y, z or w component of vector.
See also:
- getValue() and setValue().
References SoDebugError::postWarning().
SbVec4f & SbVec4f::operator*= (const float d)Multiply components of vector with value d. Returns reference to self.
SbVec4f & SbVec4f::operator/= (const float d)Divides components of vector with value d. Returns reference to self.
References SoDebugError::postWarning().
Referenced by normalize().
SbVec4f & SbVec4f::operator+= (const SbVec4f & u)Adds this vector and vector u. Returns reference to self.
SbVec4f & SbVec4f::operator-= (const SbVec4f & u)Subtracts vector u from this vector. Returns reference to self.
SbVec4f SbVec4f::operator- (void) constNon-destructive negation operator. Returns a new SbVec4f instance which has all components negated.
See also:
- negate().
References SbVec4f().
void SbVec4f::print (FILE * fp) constDump 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().
Author
Generated automatically by Doxygen for Coin from the source code.
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre