Vector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-byte alignment when Vector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers. More...
#include <Vector3.h>
Public Member Functions | |
TFSIMD_FORCE_INLINE Vector3 | absolute () const |
Return a vector will the absolute values of each element. | |
TFSIMD_FORCE_INLINE tfScalar | angle (const Vector3 &v) const |
Return the angle between this and another vector. | |
TFSIMD_FORCE_INLINE int | closestAxis () const |
TFSIMD_FORCE_INLINE Vector3 | cross (const Vector3 &v) const |
Return the cross product between this and another vector. | |
TFSIMD_FORCE_INLINE void | deSerialize (const struct Vector3Data &dataIn) |
TFSIMD_FORCE_INLINE void | deSerializeDouble (const struct Vector3DoubleData &dataIn) |
TFSIMD_FORCE_INLINE void | deSerializeFloat (const struct Vector3FloatData &dataIn) |
TFSIMD_FORCE_INLINE tfScalar | distance (const Vector3 &v) const |
Return the distance between the ends of this and another vector This is symantically treating the vector like a point. | |
TFSIMD_FORCE_INLINE tfScalar | distance2 (const Vector3 &v) const |
Return the distance squared between the ends of this and another vector This is symantically treating the vector like a point. | |
TFSIMD_FORCE_INLINE tfScalar | dot (const Vector3 &v) const |
Return the dot product. | |
TFSIMD_FORCE_INLINE int | furthestAxis () const |
TFSIMD_FORCE_INLINE bool | fuzzyZero () const |
void | getSkewSymmetricMatrix (Vector3 *v0, Vector3 *v1, Vector3 *v2) const |
TFSIMD_FORCE_INLINE const tfScalar & | getX () const |
Return the x value. | |
TFSIMD_FORCE_INLINE const tfScalar & | getY () const |
Return the y value. | |
TFSIMD_FORCE_INLINE const tfScalar & | getZ () const |
Return the z value. | |
TFSIMD_FORCE_INLINE bool | isZero () const |
TFSIMD_FORCE_INLINE tfScalar | length () const |
Return the length of the vector. | |
TFSIMD_FORCE_INLINE tfScalar | length2 () const |
Return the length of the vector squared. | |
TFSIMD_FORCE_INLINE Vector3 | lerp (const Vector3 &v, const tfScalar &t) const |
Return the linear interpolation between this and another vector. | |
TFSIMD_FORCE_INLINE int | maxAxis () const |
Return the axis with the largest value Note return values are 0,1,2 for x, y, or z. | |
TFSIMD_FORCE_INLINE int | minAxis () const |
Return the axis with the smallest value Note return values are 0,1,2 for x, y, or z. | |
TFSIMD_FORCE_INLINE Vector3 & | normalize () |
Normalize this vector x^2 + y^2 + z^2 = 1. | |
TFSIMD_FORCE_INLINE Vector3 | normalized () const |
Return a normalized version of this vector. | |
TFSIMD_FORCE_INLINE | operator const tfScalar * () const |
TFSIMD_FORCE_INLINE | operator tfScalar * () |
operator tfScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons. | |
TFSIMD_FORCE_INLINE bool | operator!= (const Vector3 &other) const |
TFSIMD_FORCE_INLINE Vector3 & | operator*= (const tfScalar &s) |
Scale the vector. | |
TFSIMD_FORCE_INLINE Vector3 & | operator*= (const Vector3 &v) |
Elementwise multiply this vector by the other. | |
TFSIMD_FORCE_INLINE Vector3 & | operator+= (const Vector3 &v) |
Add a vector to this one. | |
TFSIMD_FORCE_INLINE Vector3 & | operator-= (const Vector3 &v) |
Sutfract a vector from this one. | |
TFSIMD_FORCE_INLINE Vector3 & | operator/= (const tfScalar &s) |
Inversely scale the vector. | |
TFSIMD_FORCE_INLINE bool | operator== (const Vector3 &other) const |
TFSIMD_FORCE_INLINE Vector3 | rotate (const Vector3 &wAxis, const tfScalar angle) const |
Rotate this vector. | |
TFSIMD_FORCE_INLINE void | serialize (struct Vector3Data &dataOut) const |
TFSIMD_FORCE_INLINE void | serializeDouble (struct Vector3DoubleData &dataOut) const |
TFSIMD_FORCE_INLINE void | serializeFloat (struct Vector3FloatData &dataOut) const |
TFSIMD_FORCE_INLINE void | setInterpolate3 (const Vector3 &v0, const Vector3 &v1, tfScalar rt) |
TFSIMD_FORCE_INLINE void | setMax (const Vector3 &other) |
Set each element to the max of the current values and the values of another Vector3. | |
TFSIMD_FORCE_INLINE void | setMin (const Vector3 &other) |
Set each element to the min of the current values and the values of another Vector3. | |
TFSIMD_FORCE_INLINE void | setValue (const tfScalar &x, const tfScalar &y, const tfScalar &z) |
TFSIMD_FORCE_INLINE void | setW (tfScalar w) |
Set the w value. | |
TFSIMD_FORCE_INLINE void | setX (tfScalar x) |
Set the x value. | |
TFSIMD_FORCE_INLINE void | setY (tfScalar y) |
Set the y value. | |
TFSIMD_FORCE_INLINE void | setZ (tfScalar z) |
Set the z value. | |
void | setZero () |
TFSIMD_FORCE_INLINE tfScalar | triple (const Vector3 &v1, const Vector3 &v2) const |
TFSIMD_FORCE_INLINE | Vector3 () |
No initialization constructor. | |
TFSIMD_FORCE_INLINE | Vector3 (const tfScalar &x, const tfScalar &y, const tfScalar &z) |
Constructor from scalars. | |
TFSIMD_FORCE_INLINE const tfScalar & | w () const |
Return the w value. | |
TFSIMD_FORCE_INLINE const tfScalar & | x () const |
Return the x value. | |
TFSIMD_FORCE_INLINE const tfScalar & | y () const |
Return the y value. | |
TFSIMD_FORCE_INLINE const tfScalar & | z () const |
Return the z value. | |
Public Attributes | |
tfScalar | m_floats [4] |
Vector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-byte alignment when Vector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers.
TFSIMD_FORCE_INLINE tf::Vector3::Vector3 | ( | ) | [inline] |
TFSIMD_FORCE_INLINE tf::Vector3::Vector3 | ( | const tfScalar & | x, |
const tfScalar & | y, | ||
const tfScalar & | z | ||
) | [inline] |
TFSIMD_FORCE_INLINE Vector3 tf::Vector3::absolute | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::angle | ( | const Vector3 & | v | ) | const [inline] |
TFSIMD_FORCE_INLINE int tf::Vector3::closestAxis | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE Vector3 tf::Vector3::cross | ( | const Vector3 & | v | ) | const [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::deSerialize | ( | const struct Vector3Data & | dataIn | ) |
TFSIMD_FORCE_INLINE void tf::Vector3::deSerializeDouble | ( | const struct Vector3DoubleData & | dataIn | ) |
TFSIMD_FORCE_INLINE void tf::Vector3::deSerializeFloat | ( | const struct Vector3FloatData & | dataIn | ) |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::distance | ( | const Vector3 & | v | ) | const |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::distance2 | ( | const Vector3 & | v | ) | const |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::dot | ( | const Vector3 & | v | ) | const [inline] |
TFSIMD_FORCE_INLINE int tf::Vector3::furthestAxis | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE bool tf::Vector3::fuzzyZero | ( | ) | const [inline] |
void tf::Vector3::getSkewSymmetricMatrix | ( | Vector3 * | v0, |
Vector3 * | v1, | ||
Vector3 * | v2 | ||
) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::getX | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::getY | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::getZ | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE bool tf::Vector3::isZero | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::length | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::length2 | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE Vector3 tf::Vector3::lerp | ( | const Vector3 & | v, |
const tfScalar & | t | ||
) | const [inline] |
TFSIMD_FORCE_INLINE int tf::Vector3::maxAxis | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE int tf::Vector3::minAxis | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE Vector3& tf::Vector3::normalize | ( | ) | [inline] |
TFSIMD_FORCE_INLINE tf::Vector3::operator const tfScalar * | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE tf::Vector3::operator tfScalar * | ( | ) | [inline] |
TFSIMD_FORCE_INLINE bool tf::Vector3::operator!= | ( | const Vector3 & | other | ) | const [inline] |
TFSIMD_FORCE_INLINE Vector3& tf::Vector3::operator*= | ( | const tfScalar & | s | ) | [inline] |
TFSIMD_FORCE_INLINE Vector3& tf::Vector3::operator*= | ( | const Vector3 & | v | ) | [inline] |
TFSIMD_FORCE_INLINE Vector3& tf::Vector3::operator+= | ( | const Vector3 & | v | ) | [inline] |
TFSIMD_FORCE_INLINE Vector3& tf::Vector3::operator-= | ( | const Vector3 & | v | ) | [inline] |
TFSIMD_FORCE_INLINE Vector3& tf::Vector3::operator/= | ( | const tfScalar & | s | ) | [inline] |
TFSIMD_FORCE_INLINE bool tf::Vector3::operator== | ( | const Vector3 & | other | ) | const [inline] |
TFSIMD_FORCE_INLINE Vector3 tf::Vector3::rotate | ( | const Vector3 & | wAxis, |
const tfScalar | angle | ||
) | const |
TFSIMD_FORCE_INLINE void tf::Vector3::serialize | ( | struct Vector3Data & | dataOut | ) | const |
TFSIMD_FORCE_INLINE void tf::Vector3::serializeDouble | ( | struct Vector3DoubleData & | dataOut | ) | const |
TFSIMD_FORCE_INLINE void tf::Vector3::serializeFloat | ( | struct Vector3FloatData & | dataOut | ) | const |
TFSIMD_FORCE_INLINE void tf::Vector3::setInterpolate3 | ( | const Vector3 & | v0, |
const Vector3 & | v1, | ||
tfScalar | rt | ||
) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setMax | ( | const Vector3 & | other | ) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setMin | ( | const Vector3 & | other | ) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setValue | ( | const tfScalar & | x, |
const tfScalar & | y, | ||
const tfScalar & | z | ||
) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setW | ( | tfScalar | w | ) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setX | ( | tfScalar | x | ) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setY | ( | tfScalar | y | ) | [inline] |
TFSIMD_FORCE_INLINE void tf::Vector3::setZ | ( | tfScalar | z | ) | [inline] |
void tf::Vector3::setZero | ( | ) | [inline] |
TFSIMD_FORCE_INLINE tfScalar tf::Vector3::triple | ( | const Vector3 & | v1, |
const Vector3 & | v2 | ||
) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::w | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::x | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::y | ( | ) | const [inline] |
TFSIMD_FORCE_INLINE const tfScalar& tf::Vector3::z | ( | ) | const [inline] |