Classes | Namespaces | Macros | Functions | Variables
Vector3.h File Reference
#include "Scalar.h"
#include "MinMax.h"
Include dependency graph for Vector3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tf::tfVector4
 
class  tf::Vector3
 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...
 
struct  tf::Vector3DoubleData
 
struct  tf::Vector3FloatData
 

Namespaces

 tf
 

Macros

#define Vector3Data   Vector3DoubleData
 
#define Vector3DataName   "Vector3DoubleData"
 

Functions

class tf::Vector3 tf::__attribute__ ((aligned(16)))
 
TFSIMD_FORCE_INLINE Vector3 absolute () const
 Return a vector will the absolute values of each element. More...
 
TFSIMD_FORCE_INLINE tfScalar angle (const Vector3 &v) const
 Return the angle between this and another vector. More...
 
TFSIMD_FORCE_INLINE int closestAxis () const
 
TFSIMD_FORCE_INLINE Vector3 cross (const Vector3 &v) const
 Return the cross product between this and another vector. More...
 
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. More...
 
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. More...
 
TFSIMD_FORCE_INLINE tfScalar dot (const Vector3 &v) const
 Return the dot product. More...
 
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 tfScalargetX () const
 Return the x value. More...
 
TFSIMD_FORCE_INLINE const tfScalargetY () const
 Return the y value. More...
 
TFSIMD_FORCE_INLINE const tfScalargetZ () const
 Return the z value. More...
 
TFSIMD_FORCE_INLINE bool isZero () const
 
TFSIMD_FORCE_INLINE tfScalar length () const
 Return the length of the vector. More...
 
TFSIMD_FORCE_INLINE tfScalar length2 () const
 Return the length of the vector squared. More...
 
TFSIMD_FORCE_INLINE Vector3 lerp (const Vector3 &v, const tfScalar &t) const
 Return the linear interpolation between this and another vector. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::lerp (const Vector3 &v1, const Vector3 &v2, const tfScalar &t)
 Return the linear interpolation between two vectors. More...
 
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. More...
 
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. More...
 
TFSIMD_FORCE_INLINE Vector3normalize ()
 Normalize this vector x^2 + y^2 + z^2 = 1. More...
 
TFSIMD_FORCE_INLINE Vector3 normalized () const
 Return a normalized version of this vector. More...
 
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. More...
 
TFSIMD_FORCE_INLINE bool operator!= (const Vector3 &other) const
 
TFSIMD_FORCE_INLINE Vector3 tf::operator* (const Vector3 &v1, const Vector3 &v2)
 Return the elementwise product of two vectors. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator* (const Vector3 &v, const tfScalar &s)
 Return the vector scaled by s. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator* (const tfScalar &s, const Vector3 &v)
 Return the vector scaled by s. More...
 
TFSIMD_FORCE_INLINE Vector3operator*= (const tfScalar &s)
 Scale the vector. More...
 
TFSIMD_FORCE_INLINE Vector3operator*= (const Vector3 &v)
 Elementwise multiply this vector by the other. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator+ (const Vector3 &v1, const Vector3 &v2)
 Return the sum of two vectors (Point symantics) More...
 
TFSIMD_FORCE_INLINE Vector3operator+= (const Vector3 &v)
 Add a vector to this one. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator- (const Vector3 &v1, const Vector3 &v2)
 Return the difference between two vectors. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator- (const Vector3 &v)
 Return the negative of the vector. More...
 
TFSIMD_FORCE_INLINE Vector3operator-= (const Vector3 &v)
 Sutfract a vector from this one. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator/ (const Vector3 &v, const tfScalar &s)
 Return the vector inversely scaled by s. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::operator/ (const Vector3 &v1, const Vector3 &v2)
 Return the vector inversely scaled by s. More...
 
TFSIMD_FORCE_INLINE Vector3operator/= (const tfScalar &s)
 Inversely scale the vector. More...
 
TFSIMD_FORCE_INLINE bool operator== (const Vector3 &other) const
 
TFSIMD_FORCE_INLINE Vector3 rotate (const Vector3 &wAxis, const tfScalar angle) const
 Rotate this vector. More...
 
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. More...
 
TFSIMD_FORCE_INLINE void setMin (const Vector3 &other)
 Set each element to the min of the current values and the values of another Vector3. More...
 
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. More...
 
TFSIMD_FORCE_INLINE void setX (tfScalar x)
 Set the x value. More...
 
TFSIMD_FORCE_INLINE void setY (tfScalar y)
 Set the y value. More...
 
TFSIMD_FORCE_INLINE void setZ (tfScalar z)
 Set the z value. More...
 
void setZero ()
 
TFSIMD_FORCE_INLINE tfScalar tf::tfAngle (const Vector3 &v1, const Vector3 &v2)
 Return the angle between two vectors. More...
 
TFSIMD_FORCE_INLINE Vector3 tf::tfCross (const Vector3 &v1, const Vector3 &v2)
 Return the cross product of two vectors. More...
 
TFSIMD_FORCE_INLINE tfScalar tf::tfDistance (const Vector3 &v1, const Vector3 &v2)
 Return the distance between two vectors. More...
 
TFSIMD_FORCE_INLINE tfScalar tf::tfDistance2 (const Vector3 &v1, const Vector3 &v2)
 Return the distance squared between two vectors. More...
 
TFSIMD_FORCE_INLINE tfScalar tf::tfDot (const Vector3 &v1, const Vector3 &v2)
 Return the dot product between two vectors. More...
 
TFSIMD_FORCE_INLINE void tf::tfPlaneSpace1 (const Vector3 &n, Vector3 &p, Vector3 &q)
 
TFSIMD_FORCE_INLINE void tf::tfSwapScalarEndian (const tfScalar &sourceVal, tfScalar &destVal)
 tfSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization More...
 
TFSIMD_FORCE_INLINE void tf::tfSwapVector3Endian (const Vector3 &sourceVec, Vector3 &destVec)
 tfSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization More...
 
TFSIMD_FORCE_INLINE tfScalar tf::tfTriple (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 
TFSIMD_FORCE_INLINE void tf::tfUnSwapVector3Endian (Vector3 &vector)
 tfUnSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization More...
 
TFSIMD_FORCE_INLINE tfScalar triple (const Vector3 &v1, const Vector3 &v2) const
 
TFSIMD_FORCE_INLINE Vector3 ()
 No initialization constructor. More...
 
TFSIMD_FORCE_INLINE Vector3 (const tfScalar &x, const tfScalar &y, const tfScalar &z)
 Constructor from scalars. More...
 
TFSIMD_FORCE_INLINE const tfScalarw () const
 Return the w value. More...
 
TFSIMD_FORCE_INLINE const tfScalarx () const
 Return the x value. More...
 
TFSIMD_FORCE_INLINE const tfScalary () const
 Return the y value. More...
 
TFSIMD_FORCE_INLINE const tfScalarz () const
 Return the z value. More...
 

Variables

tf::tfVector4 tf::__attribute__
 
tfScalar m_floats [4]
 

Macro Definition Documentation

#define Vector3Data   Vector3DoubleData

Definition at line 26 of file Vector3.h.

#define Vector3DataName   "Vector3DoubleData"

Definition at line 27 of file Vector3.h.

Function Documentation

TFSIMD_FORCE_INLINE Vector3 __attribute__::absolute ( ) const

Return a vector will the absolute values of each element.

Definition at line 393 of file Vector3.h.

TFSIMD_FORCE_INLINE tfScalar __attribute__::angle ( const Vector3 v) const

Return the angle between this and another vector.

Parameters
vThe other vector

Definition at line 386 of file Vector3.h.

TFSIMD_FORCE_INLINE int __attribute__::closestAxis ( ) const

Definition at line 436 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3 __attribute__::cross ( const Vector3 v) const

Return the cross product between this and another vector.

Parameters
vThe other vector

Definition at line 402 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::deSerialize ( const struct Vector3Data dataIn)
TFSIMD_FORCE_INLINE void __attribute__::deSerializeDouble ( const struct Vector3DoubleData &  dataIn)
TFSIMD_FORCE_INLINE void __attribute__::deSerializeFloat ( const struct Vector3FloatData &  dataIn)
TFSIMD_FORCE_INLINE tfScalar __attribute__::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 __attribute__::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 __attribute__::dot ( const Vector3 v) const

Return the dot product.

Parameters
vThe other vector in the dot product

Definition at line 344 of file Vector3.h.

TFSIMD_FORCE_INLINE int __attribute__::furthestAxis ( ) const

Definition at line 431 of file Vector3.h.

TFSIMD_FORCE_INLINE bool __attribute__::fuzzyZero ( ) const

Definition at line 554 of file Vector3.h.

void __attribute__::getSkewSymmetricMatrix ( Vector3 v0,
Vector3 v1,
Vector3 v2 
) const

Definition at line 537 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::getX ( ) const

Return the x value.

Definition at line 470 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::getY ( ) const

Return the y value.

Definition at line 472 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::getZ ( ) const

Return the z value.

Definition at line 474 of file Vector3.h.

TFSIMD_FORCE_INLINE bool __attribute__::isZero ( ) const

Definition at line 549 of file Vector3.h.

TFSIMD_FORCE_INLINE tfScalar __attribute__::length ( ) const

Return the length of the vector.

Definition at line 356 of file Vector3.h.

TFSIMD_FORCE_INLINE tfScalar __attribute__::length2 ( ) const

Return the length of the vector squared.

Definition at line 350 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3 __attribute__::lerp ( const Vector3 v,
const tfScalar t 
) const

Return the linear interpolation between this and another vector.

Parameters
vThe other vector
tThe ration of this to v (t = 0 => return this, t=1 => return other)

Definition at line 454 of file Vector3.h.

TFSIMD_FORCE_INLINE int __attribute__::maxAxis ( ) const

Return the axis with the largest value Note return values are 0,1,2 for x, y, or z.

Definition at line 426 of file Vector3.h.

TFSIMD_FORCE_INLINE int __attribute__::minAxis ( ) const

Return the axis with the smallest value Note return values are 0,1,2 for x, y, or z.

Definition at line 419 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3& __attribute__::normalize ( )

Normalize this vector x^2 + y^2 + z^2 = 1.

Definition at line 371 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3 __attribute__::normalized ( ) const

Return a normalized version of this vector.

TFSIMD_FORCE_INLINE __attribute__::operator const tfScalar * ( ) const

Definition at line 496 of file Vector3.h.

TFSIMD_FORCE_INLINE __attribute__::operator tfScalar * ( )

operator tfScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.

Definition at line 495 of file Vector3.h.

TFSIMD_FORCE_INLINE bool __attribute__::operator!= ( const Vector3 other) const

Definition at line 503 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3& __attribute__::operator*= ( const tfScalar s)

Scale the vector.

Parameters
sScale factor

Definition at line 328 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3& __attribute__::operator*= ( const Vector3 v)

Elementwise multiply this vector by the other.

Parameters
vThe other vector

Definition at line 463 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3& __attribute__::operator+= ( const Vector3 v)

Add a vector to this one.

Parameters
Thevector to add to this one

Definition at line 311 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3& __attribute__::operator-= ( const Vector3 v)

Sutfract a vector from this one.

Parameters
Thevector to sutfract

Definition at line 321 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3& __attribute__::operator/= ( const tfScalar s)

Inversely scale the vector.

Parameters
sScale factor to divide by

Definition at line 336 of file Vector3.h.

TFSIMD_FORCE_INLINE bool __attribute__::operator== ( const Vector3 other) const

Definition at line 498 of file Vector3.h.

TFSIMD_FORCE_INLINE Vector3 __attribute__::rotate ( const Vector3 wAxis,
const tfScalar  angle 
) const

Rotate this vector.

Parameters
wAxisThe axis to rotate about
angleThe angle to rotate by
TFSIMD_FORCE_INLINE void __attribute__::serialize ( struct Vector3Data dataOut) const
TFSIMD_FORCE_INLINE void __attribute__::serializeDouble ( struct Vector3DoubleData &  dataOut) const
TFSIMD_FORCE_INLINE void __attribute__::serializeFloat ( struct Vector3FloatData &  dataOut) const
TFSIMD_FORCE_INLINE void __attribute__::setInterpolate3 ( const Vector3 v0,
const Vector3 v1,
tfScalar  rt 
)

Definition at line 441 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setMax ( const Vector3 other)

Set each element to the max of the current values and the values of another Vector3.

Parameters
otherThe other Vector3 to compare with

Definition at line 511 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setMin ( const Vector3 other)

Set each element to the min of the current values and the values of another Vector3.

Parameters
otherThe other Vector3 to compare with

Definition at line 521 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setValue ( const tfScalar x,
const tfScalar y,
const tfScalar z 
)

Definition at line 529 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setW ( tfScalar  w)

Set the w value.

Definition at line 482 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setX ( tfScalar  x)

Set the x value.

Definition at line 476 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setY ( tfScalar  y)

Set the y value.

Definition at line 478 of file Vector3.h.

TFSIMD_FORCE_INLINE void __attribute__::setZ ( tfScalar  z)

Set the z value.

Definition at line 480 of file Vector3.h.

void __attribute__::setZero ( )

Definition at line 544 of file Vector3.h.

TFSIMD_FORCE_INLINE tfScalar __attribute__::triple ( const Vector3 v1,
const Vector3 v2 
) const

Definition at line 410 of file Vector3.h.

TFSIMD_FORCE_INLINE __attribute__::Vector3 ( )

No initialization constructor.

Definition at line 293 of file Vector3.h.

TFSIMD_FORCE_INLINE __attribute__::Vector3 ( const tfScalar x,
const tfScalar y,
const tfScalar z 
)

Constructor from scalars.

Parameters
xX value
yY value
zZ value

Definition at line 301 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::w ( ) const

Return the w value.

Definition at line 490 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::x ( ) const

Return the x value.

Definition at line 484 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::y ( ) const

Return the y value.

Definition at line 486 of file Vector3.h.

TFSIMD_FORCE_INLINE const tfScalar& __attribute__::z ( ) const

Return the z value.

Definition at line 488 of file Vector3.h.

Variable Documentation

tfScalar m_floats[4]

Definition at line 286 of file Vector3.h.



tf
Author(s): Tully Foote, Eitan Marder-Eppstein, Wim Meeussen
autogenerated on Fri Jun 7 2019 22:00:28