SbVec3f Class Reference
[Basics]

3D vector class. More...

#include <Inventor/SbVec.h>

Inheritance diagram for SbVec3f:
SbColor

List of all members.

Public Member Functions

 SbVec3f ()
 SbVec3f (const float v[3])
 SbVec3f (float x, float y, float z)
 SbVec3f (SbPlane &p0, SbPlane &p1, SbPlane &p2)
SbVec3f cross (const SbVec3f &v) const
float dot (const SbVec3f &v) const
const float * getValue () const
void getValue (float &x, float &y, float &z) const
float length () const
float lengthSquared () const
float normalize ()
void negate ()
SbVec3fsetValue (const float v[3])
SbVec3fsetValue (float x, float y, float z)
SbVec3fsetValue (const SbVec3f &barycentic, const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2)
SbVec3fsetValue (const SbVec3d &vec3d)
SbVec3foperator*= (float d)
SbVec3foperator/= (float d)
SbVec3foperator+= (const SbVec3f &v)
SbVec3foperator-= (const SbVec3f &v)
SbVec3f operator- () const
SbVec3f operator* (const SbVec3f &v) const
SbVec3foperator*= (const SbVec3f &v)
SbBool equals (const SbVec3f &v, float tolerance) const
SbVec3f getClosestAxis () const
template<typename T >
 SbVec3f (const T &v)

Friends

SbVec3f operator* (const SbVec3f &v, float d)
SbVec3f operator* (float d, const SbVec3f &v)
SbVec3f operator/ (const SbVec3f &v, float d)
SbVec3f operator+ (const SbVec3f &v1, const SbVec3f &v2)
SbVec3f operator- (const SbVec3f &v1, const SbVec3f &v2)
int operator== (const SbVec3f &v1, const SbVec3f &v2)
int operator!= (const SbVec3f &v1, const SbVec3f &v2)
std::ostream & operator<< (std::ostream &os, const SbVec3f &v)



float & operator[] (int i)
const float & operator[] (int i) const

Detailed Description

3D vector class.

3D vector class used to store 3D vectors and points. This class is used throughout Open Inventor for arguments and return values.

Notes:

SEE ALSO

SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3d, SbVec3i32, SbVec3s, SbVec4b, SbVec4d, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us


Constructor & Destructor Documentation

SbVec3f::SbVec3f (  )  [inline]

Default constructor.

The vector is not initialized.

SbVec3f::SbVec3f ( const float  v[3]  )  [inline]

Constructor given vector components.

SbVec3f::SbVec3f ( float  x,
float  y,
float  z 
) [inline]

Constructor given vector components.

SbVec3f::SbVec3f ( SbPlane p0,
SbPlane p1,
SbPlane p2 
)

Constructor given 3 planes.

template<typename T >
SbVec3f::SbVec3f ( const T &  v  )  [inline, explicit]

Constructor that converts an arbitrary SbVec3 to an SbVec3f.


Member Function Documentation

SbVec3f SbVec3f::cross ( const SbVec3f v  )  const [inline]

Returns right-handed cross product of vector and another vector.

float SbVec3f::dot ( const SbVec3f v  )  const [inline]

Returns dot (inner) product of vector and another vector.

SbBool SbVec3f::equals ( const SbVec3f v,
float  tolerance 
) const

Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.

SbVec3f SbVec3f::getClosestAxis (  )  const

Returns principal axis that is closest (based on maximum dot product) to this vector.

void SbVec3f::getValue ( float &  x,
float &  y,
float &  z 
) const

Returns vector components.

const float* SbVec3f::getValue (  )  const [inline]

Returns vector components.

float SbVec3f::length (  )  const

Returns geometric length of vector.

float SbVec3f::lengthSquared (  )  const [inline]

Returns square length of vector.

Faster than length().

void SbVec3f::negate (  ) 

Negates each component of vector in place.

float SbVec3f::normalize (  ) 

Changes vector to be unit length, returning the length before normalization.

SbVec3f SbVec3f::operator* ( const SbVec3f v  )  const [inline]

Component-wise vector multiplication operator.

SbVec3f& SbVec3f::operator*= ( const SbVec3f v  )  [inline]

Component-wise vector multiplication operator.

SbVec3f& SbVec3f::operator*= ( float  d  ) 

Component-wise scalar multiplication operator.

SbVec3f& SbVec3f::operator+= ( const SbVec3f v  )  [inline]

Component-wise vector addition operator.

SbVec3f SbVec3f::operator- (  )  const [inline]

Nondestructive unary negation - returns a new vector.

SbVec3f& SbVec3f::operator-= ( const SbVec3f v  ) 

Component-wise vector subtraction operator.

SbVec3f& SbVec3f::operator/= ( float  d  ) 

Component-wise scalar division operator.

const float& SbVec3f::operator[] ( int  i  )  const [inline]

Accesses indexed component of vector.

float& SbVec3f::operator[] ( int  i  )  [inline]

Accesses indexed component of vector.

SbVec3f & SbVec3f::setValue ( const SbVec3d vec3d  )  [inline]

Sets value of vector from a double precision vector.

SbVec3f& SbVec3f::setValue ( const SbVec3f barycentic,
const SbVec3f v0,
const SbVec3f v1,
const SbVec3f v2 
)

Sets value of vector as the weighted average of 3 other vectors.

SbVec3f& SbVec3f::setValue ( float  x,
float  y,
float  z 
) [inline]

Sets the vector components.

SbVec3f& SbVec3f::setValue ( const float  v[3]  )  [inline]

Sets the vector components.


Friends And Related Function Documentation

int operator!= ( const SbVec3f v1,
const SbVec3f v2 
) [friend]

Inequality comparison operator.

SbVec3f operator* ( float  d,
const SbVec3f v 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec3f operator* ( const SbVec3f v,
float  d 
) [friend]

Component-wise binary scalar multiplication operator.

SbVec3f operator+ ( const SbVec3f v1,
const SbVec3f v2 
) [friend]

Component-wise binary vector addition operator.

SbVec3f operator- ( const SbVec3f v1,
const SbVec3f v2 
) [friend]

Component-wise binary vector subtraction operator.

SbVec3f operator/ ( const SbVec3f v,
float  d 
) [friend]

Component-wise binary scalar division operator.

std::ostream& operator<< ( std::ostream &  os,
const SbVec3f v 
) [friend]

Writes the vector to the specified output stream.

int operator== ( const SbVec3f v1,
const SbVec3f v2 
) [friend]

Equality comparison operator.


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

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/