class MbVec3f

Public Methods

MbVec3f cross(const MbVec3f &v)
Returns right-handed cross product of vector and another vector
float dot(const MbVec3f &v)
Returns dot (inner) product of vector and another vector
MbBool equals(const MbVec3f v, float tolerance)
length of the maximum distance between the two vectors
MbVec3f getClosestAxis()
product) to this vector
void getValue(float &x, float &y, float &z)
Returns 3 individual components
const float* getValue()
Returns pointer to array of 3 components
float length()
Returns geometric length of vector
MbVec3f(const float v[3])
Constructor given an array of 3 components
MbVec3f(float x, float y, float z)
Constructor given 3 individual components
void negate()
Negates each component of vector in place
float normalize()
Changes vector to be unit length
friend int operator !=(const MbVec3f &v1, const MbVec3f &v2)
friend MbVec3f operator *(const MbVec3f &v, float d)
Component-wise binary scalar multiplication and division operators
friend MbVec3f operator *(float d, const MbVec3f &v)
MbVec3f& operator *=(float d)
Component-wise scalar multiplication and division operators
friend MbVec3f operator +(const MbVec3f &v1, const MbVec3f &v2)
Component-wise binary vector addition and subtraction operators
MbVec3f& operator +=(MbVec3f v)
Component-wise vector addition and subtraction operators
friend MbVec3f operator -(const MbVec3f &v1, const MbVec3f &v2)
MbVec3f operator -()
Nondestructive unary negation - returns a new vector
MbVec3f& operator -=(MbVec3f v)
friend MbVec3f operator /(const MbVec3f &v, float d)
MbVec3f& operator /=(float d)
friend int operator ==(const MbVec3f &v1, const MbVec3f &v2)
Equality comparison operator
const float& operator [](int i)
float& operator [](int i)
Accesses indexed component of vector
MbVec3f& setValue(const MbVec3f &barycentic, const MbVec3f &v0, const MbVec3f &v1, const MbVec3f &v2)
vectors, using barycentic coordinates
MbVec3f& setValue(const float v[3])
Sets value of vector from array of 3 components
MbVec3f& setValue(float x, float y, float z)
Sets value of vector from 3 individual components

float vec[3]

Documentation

MbVec3f(const float v[3])
Constructor given an array of 3 components

MbVec3f(float x, float y, float z)
Constructor given 3 individual components

MbVec3f cross(const MbVec3f &v)
Returns right-handed cross product of vector and another vector

float dot(const MbVec3f &v)
Returns dot (inner) product of vector and another vector

const float* getValue()
Returns pointer to array of 3 components

void getValue(float &x, float &y, float &z)
Returns 3 individual components

float length()
Returns geometric length of vector

float normalize()
Changes vector to be unit length

void negate()
Negates each component of vector in place

MbVec3f& setValue(const float v[3])
Sets value of vector from array of 3 components

MbVec3f& setValue(float x, float y, float z)
Sets value of vector from 3 individual components

MbVec3f& setValue(const MbVec3f &barycentic, const MbVec3f &v0, const MbVec3f &v1, const MbVec3f &v2)
vectors, using barycentic coordinates

float& operator [](int i)
Accesses indexed component of vector

const float& operator [](int i)

MbVec3f& operator *=(float d)
Component-wise scalar multiplication and division operators

MbVec3f& operator /=(float d)

MbVec3f& operator +=(MbVec3f v)
Component-wise vector addition and subtraction operators

MbVec3f& operator -=(MbVec3f v)

MbVec3f operator -()
Nondestructive unary negation - returns a new vector

friend MbVec3f operator *(const MbVec3f &v, float d)
Component-wise binary scalar multiplication and division operators

friend MbVec3f operator *(float d, const MbVec3f &v)

friend MbVec3f operator /(const MbVec3f &v, float d)

friend MbVec3f operator +(const MbVec3f &v1, const MbVec3f &v2)
Component-wise binary vector addition and subtraction operators

friend MbVec3f operator -(const MbVec3f &v1, const MbVec3f &v2)

friend int operator ==(const MbVec3f &v1, const MbVec3f &v2)
Equality comparison operator

friend int operator !=(const MbVec3f &v1, const MbVec3f &v2)

MbBool equals(const MbVec3f v, float tolerance)
length of the maximum distance between the two vectors

MbVec3f getClosestAxis()
product) to this vector

float vec[3]

This class has no child classes.