logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

SbVec3f — 3D vector class

Description

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

Inherits From

       SbVec3f

Methods

SbVec3f()
          Default constructor.

                         SbVec3f(constfloatv[3])SbVec3f(floatx,floaty,floatz)
          Constructor given vector components.

                         SbVec3f(SbPlane&p0,SbPlane&p1,SbPlane&p2)
          Constructor given 3 planes.

     SbVec3fcross(constSbVec3f&v)const
          Returns right-handed cross product of vector and another vector.

     floatdot(constSbVec3f&v)const
          Returns dot (inner) product of vector and another vector.

     SbBoolequals(constSbVec3fv,floattolerance)const
          Equality  comparison within given tolerance — the square of the length of the maximum distance between
          the two vectors.

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

     constfloat*getValue()constvoidgetValue(float&x,float&y,float&z)const
          Returns vector components.

     floatlength()const
          Returns geometric length of vector.

     voidnegate()
          Negates each component of vector in place.

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

     SbVec3f&setValue(constfloatv[3])SbVec3f&setValue(floatx,floaty,floatz)
          Sets the vector components.

     SbVec3f&setValue(constSbVec3f&barycentic,constSbVec3f&v0,constSbVec3f&v1,constSbVec3f&v2)
          Sets value of vector as the weighted average of 3 other vectors.

     float&operator[](inti)constfloat&operator[](inti)
          Accesses indexed component of vector.

     SbVec3f&operator*=(floatd)SbVec3f&operator/=(floatd)
          Component-wise scalar multiplication and division operators.

     SbVec3f&operator+=(constSbVec3f&u)SbVec3f&operator-=(constSbVec3f&u)
          Component-wise vector addition and subtraction operators.

     SbVec3foperator-()const
          Nondestructive unary negation — returns a new vector.

     SbVec3foperator*(constSbVec3f&v,floatd)SbVec3foperator*(floatd,constSbVec3f&v)SbVec3foperator/(constSbVec3f&v,floatd)
          Component-wise binary scalar multiplication and division operators.

     SbVec3foperator+(constSbVec3f&v1,constSbVec3f&v2)SbVec3foperator-(constSbVec3f&v1,constSbVec3f&v2)
          Component-wise binary vector addition and subtraction operators.

     intoperator==(constSbVec3f&v1,constSbVec3f&v2)intoperator!=(constSbVec3f&v1,constSbVec3f&v2)
          Equality comparison operators.

Name

       SbVec3f — 3D vector class

See Also

SbVec2f,SbVec4f,SbVec2s,SbRotationSbVec3f(3IV)()

Synopsis

#include<Inventor/SbLinear.h>

          Methods from class SbVec3f:

                         SbVec3f()SbVec3f(constfloatv[3])SbVec3f(floatx,floaty,floatz)SbVec3f(SbPlane&p0,SbPlane&p1,SbPlane&p2)SbVec3fcross(constSbVec3f&v)constfloatdot(constSbVec3f&v)constSbBoolequals(constSbVec3fv,floattolerance)constSbVec3fgetClosestAxis()constconstfloat*getValue()constvoidgetValue(float&x,float&y,float&z)constfloatlength()constvoidnegate()floatnormalize()SbVec3f&setValue(constfloatv[3])SbVec3f&setValue(floatx,floaty,floatz)SbVec3f&setValue(constSbVec3f&barycentic,constSbVec3f&v0,constSbVec3f&v1,constSbVec3f&v2)float&operator[](inti)constfloat&operator[](inti)SbVec3f&operator*=(floatd)SbVec3f&operator/=(floatd)SbVec3f&operator+=(constSbVec3f&u)SbVec3f&operator-=(constSbVec3f&u)SbVec3foperator-()constSbVec3foperator*(constSbVec3f&v,floatd)SbVec3foperator*(floatd,constSbVec3f&v)SbVec3foperator/(constSbVec3f&v,floatd)SbVec3foperator+(constSbVec3f&v1,constSbVec3f&v2)SbVec3foperator-(constSbVec3f&v1,constSbVec3f&v2)intoperator==(constSbVec3f&v1,constSbVec3f&v2)intoperator!=(constSbVec3f&v1,constSbVec3f&v2)

See Also