Vector< 3, real_t > Struct Template Reference
Specialized template implementation for Vector3, accelerated to support efficient SIMD vectorization via SSE intrinsics. More...
#include <Vector3SSE.h>

Public Member Functions | |
Constructors | |
| Vector (const real_t *srcData) | |
| Expects N arguments of type float. | |
| Vector () | |
| Constructs a zero Vector. | |
| Vector (const Vector< 3, real_t > &v) | |
| Copy Constructor. | |
| Vector (const m128f_t &v) | |
| SSE copy constructor. | |
Accessor Operators | |
| const real_t & | operator[] (const unsigned index) const |
| real_t & | operator[] (const unsigned index) |
| const real_t * | operator* () const |
| real_t * | operator* () |
Implicit casting Operators | |
| operator m128f_t () const | |
Equality Operators | |
| bool | operator== (const Vector< 3, real_t > &v) const |
| bool | operator!= (const Vector< 3, real_t > &v) const |
Mutator Operators | |
| Vector< 3, real_t > & | operator= (const Vector< 3, real_t > &v) |
| Vector< 3, real_t > & | operator+= (const Vector< 3, real_t > &rhs) |
| Vector< 3, real_t > & | operator-= (const Vector< 3, real_t > &rhs) |
Scalar Mutator Operators | |
| Vector< 3, real_t > & | operator*= (const real_t &scale) |
| Vector< 3, real_t > & | operator/= (const real_t &scale) |
Arithmetic Operators | |
| Vector< 3, real_t > | operator+ (const Vector< 3, real_t > &rhs) const |
| Vector< 3, real_t > | operator- (const Vector< 3, real_t > &rhs) const |
| Vector< 3, real_t > | operator* (const Vector< 3, real_t > &rhs) const |
Scalar Arithmetic Operators | |
| Vector< 3, real_t > | operator* (const real_t &scale) const |
| Vector< 3, real_t > | operator/ (const real_t &scale) const |
More Complex Functionality | |
| bool | isUnit () const |
| bool | isZero () const |
| Vector< 3, real_t > | getNormalized () const |
| Vector< 3, real_t > | getReciprocal () const |
| real_t | normalize () |
| Normalizes this Vector and returns the old magnitude. | |
| real_t | getMagnitude () const |
| real_t | getMagnitude2 () const |
| real_t | getDistance (const Vector< 3, real_t > &v) const |
| real_t | getDistance2 (const Vector< 3, real_t > &v) const |
| real_t | getSum () const |
| real_t | getAverage () const |
| real_t | dot (const Vector< 3, real_t > &rhs) const |
| unsigned | getMaxDimension () const |
| unsigned | getMinDimension () const |
| void | cleanup () |
| Cleans up vector (0's out entries that are less than epsilon). | |
Specialized Vector Functionality | |
| Vector (const real_t &v0, const real_t &v1=0, const real_t &v2=0) | |
| Convenience Constructor. | |
| Vector< 3, real_t > | cross (const Vector< 3, real_t > &rhs) const |
| Vector< 3, real_t > | reflectVector (const Vector< 3, real_t > &normal) const |
| Vector< 3, real_t > | refractVector (const Vector< 3, real_t > &normal, real_t in, real_t out=1.0f) const |
| void | getOrthonormalBasis (Vector< 3, real_t > &U, Vector< 3, real_t > &V) |
Static Public Member Functions | |
Static convenience constructors to generate common matrices | |
| static Vector< 3, real_t > | zero () |
| Generates a vector full of zeroes. | |
| static Vector< 3, real_t > | ones () |
| Generates a vector full of ones. | |
| static Vector< 3, real_t > | fill (const real_t &val) |
| Generates a vector filled with the specified value. | |
| static Vector< 3, real_t > | min (const Vector< 3, real_t > &v1, const Vector< 3, real_t > &v2) |
| static Vector< 3, real_t > | max (const Vector< 3, real_t > &v1, const Vector< 3, real_t > &v2) |
| static Vector< 3, real_t > | infinity () |
| Generates a vector filled with the maximum real_t (infinity). | |
| static Vector< 3, real_t > | negativeInfinity () |
| Generates a vector filled with the minimum real_t (negative infinity). | |
| static Vector< 3, real_t > | fromSpherical (real_t theta, real_t phi) |
| theta is latitude angle; phi is longitude angle | |
Public Attributes | |
| SSE_ALIGN16_PRE union Vector < 3, real_t >:: { ... } | SSE_ALIGN16_POST |
| float | data [4] |
| Underlying data stored as an N-length array of type T. | |
| m128f_t | vec |
| Also accessible via a native SSE 128-bit register. | |
| real_t | x |
| real_t | y |
| real_t | z |
| real_t | w |
Detailed Description
template<>
struct Vector< 3, real_t >
Specialized template implementation for Vector3, accelerated to support efficient SIMD vectorization via SSE intrinsics.
- Note:
- implementation uses single-precision floating point arithmetic
- See also:
- for more information on SSE and SIMD: ftp://download.intel.com/support/performancetools/c/linux/v9/intref_cls.pdf
Definition at line 32 of file Vector3SSE.h.
Constructor & Destructor Documentation
Member Function Documentation
| static Vector<3, real_t> Vector< 3, real_t >::min | ( | const Vector< 3, real_t > & | v1, | |
| const Vector< 3, real_t > & | v2 | |||
| ) | [inline, static] |
- Returns:
- the element-wise minimum vector from the two given vectors
Definition at line 89 of file Vector3SSE.h.
| static Vector<3, real_t> Vector< 3, real_t >::max | ( | const Vector< 3, real_t > & | v1, | |
| const Vector< 3, real_t > & | v2 | |||
| ) | [inline, static] |
- Returns:
- the element-wise maximum vector from the two given vectors
Definition at line 96 of file Vector3SSE.h.
Generates a vector filled with the maximum real_t (infinity).
Definition at line 103 of file Vector3SSE.h.
Generates a vector filled with the minimum real_t (negative infinity).
Definition at line 108 of file Vector3SSE.h.
- Returns:
- a const reference to the element at the given index
Definition at line 47 of file Vector3SSE.inl.
- Returns:
- a reference to the element at the given index
- Note:
- changes to the returned element will affect this vector
Definition at line 55 of file Vector3SSE.inl.
- Returns:
- a pointer to the underlying data (N-length array of type real_t)
Definition at line 62 of file Vector3SSE.inl.
- Returns:
- a pointer to the underlying data (N-length array of type real_t)
Definition at line 67 of file Vector3SSE.inl.
Definition at line 143 of file Vector3SSE.h.
Definition at line 75 of file Vector3SSE.inl.
Definition at line 82 of file Vector3SSE.inl.
Definition at line 91 of file Vector3SSE.inl.
Definition at line 99 of file Vector3SSE.inl.
Definition at line 107 of file Vector3SSE.inl.
Definition at line 119 of file Vector3SSE.inl.
Definition at line 127 of file Vector3SSE.inl.
| Vector< 3, real_t > Vector< 3, real_t >::operator+ | ( | const Vector< 3, real_t > & | rhs | ) | const [inline] |
Definition at line 144 of file Vector3SSE.inl.
| Vector< 3, real_t > Vector< 3, real_t >::operator- | ( | const Vector< 3, real_t > & | rhs | ) | const [inline] |
Definition at line 150 of file Vector3SSE.inl.
Definition at line 163 of file Vector3SSE.inl.
Definition at line 169 of file Vector3SSE.inl.
- Returns:
- whether or not this Vector is the zero vector
Definition at line 192 of file Vector3SSE.inl.
- Returns:
- the reciprocal version of this vector (1.0f / this)
Definition at line 215 of file Vector3SSE.inl.
Normalizes this Vector and returns the old magnitude.
Definition at line 220 of file Vector3SSE.inl.
- Returns:
- the magnitude of the vector connecting this vector to the one passed in
Definition at line 275 of file Vector3SSE.inl.
- Returns:
- the squared magnitude of the vector connecting this vector to the one passed in
Definition at line 282 of file Vector3SSE.inl.
Cleans up vector (0's out entries that are less than epsilon).
Assumes normal is normalized, incident vector is incoming and resultant vector is exiting
- Note:
- only defined for Vector3
| Vector<3, real_t> Vector< 3, real_t >::refractVector | ( | const Vector< 3, real_t > & | normal, | |
| real_t | in, | |||
| real_t | out = 1.0f | |||
| ) | const |
- Returns:
- an orthonormal basis constructed from this vector in out parameters U and V
- Note:
- only defined for Vector3
Member Data Documentation
| SSE_ALIGN16_PRE { ... } Vector< 3, real_t >::SSE_ALIGN16_POST |
The documentation for this struct was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6