Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a 3-dimensional point or vector. More...
#include <omVector3D.h>
Public Member Functions | |
VectorND () | |
Create a new 3D vector with all elements equal to zero. More... | |
VectorND (T value) | |
Create a new 3D vector with all elements equal to a single value. More... | |
VectorND (const T array[3]) | |
Create a new 3D vector from a pointer to a 3 element array. More... | |
VectorND (T newX, T newY, T newZ) | |
Create a new 3D vector by specifying its x, y, and z values. More... | |
VectorND (const VectorND< T, 2 > &vector, T newZ) | |
Create a new 3D vector from a 2D vector and a value for the Z coordinate. More... | |
VectorND (T newX, const VectorND< T, 2 > &vector) | |
Create a new 3D vector from a value for the X coordinate and a 2D vector. More... | |
template<typename U > | |
VectorND (const VectorND< U, 3 > &vector) | |
Create a new 3D vector from an existing vector with a different template type. More... | |
VectorND (const VectorND &vector) | |
Create a new 3D vector from an existing vector with the same template type. More... | |
VectorND & | operator= (const VectorND &vector) |
Create a new 3D vector from an existing vector with a different template type. More... | |
T | getMagnitude () const |
Return the magnitude of this vector (the length). More... | |
T | getMagnitudeSquared () const |
Return the square of the magnitude of this vector. More... | |
VectorND | normalize () const |
Return a normalized version of this vector. More... | |
VectorND | normalize (T &magnitude) const |
Return a normalized version of this vector, placing the vector's magnitude in the output parameter. More... | |
VectorND | projectOn (const VectorND &vector) const |
Project this vector on another vector and return the projected vector. More... | |
VectorND | projectOnNormalized (const VectorND &vector) const |
Project this vector on a normalized vector and return the projected vector. More... | |
T | getDistanceTo (const VectorND &vector) const |
Return the distance from this vector to another in 3D Euclidean space. More... | |
T | getDistanceToSquared (const VectorND &vector) const |
Return the square of the distance from this vector to another in 3D Euclidean space. More... | |
T * | toArray () |
Return a pointer to the internal storage of this vector. More... | |
const T * | toArray () const |
Return a const pointer to the internal storage of this vector. More... | |
T | getMin () const |
Return the minimum component of this vector. More... | |
T | getMax () const |
Return the maximum component of this vector. More... | |
T & | get (Index index) |
Return a reference to the vector coordinate at the specified index. More... | |
const T & | get (Index index) const |
Return a const reference to the vector coordinate at the specified index. More... | |
T & | operator[] (Index index) |
Return a reference to the vector coordinate at the specified index. More... | |
const T & | operator[] (Index index) const |
Return a const reference to the vector coordinate at the specified index. More... | |
void | setAll (T newX, T newY, T newZ) |
Set the X, Y, and Z coordinates of the vector to the specified values. More... | |
void | set (Index index, T newValue) |
Set the coordinate of this vector at the specified index to a new value. More... | |
Bool | operator== (const VectorND &v) const |
Return whether or not this vector is equal to another for all components. More... | |
Bool | operator!= (const VectorND &v) const |
Return whether or not this vector is not equal to another for any component. More... | |
VectorND | operator- () const |
Negate each component of this vector and return the result. More... | |
VectorND | operator+ () const |
Return copy of the original vector. More... | |
VectorND | operator+ (T value) const |
Add a scalar to every component of this vector and return the result. More... | |
VectorND | operator- (T value) const |
Subtract a scalar from every component of this vector and return the result. More... | |
VectorND | operator* (T value) const |
Multiply every component of this vector by a scalar and return the result. More... | |
VectorND | operator/ (T value) const |
Divide every component of this vector by a scalar and return the result. More... | |
VectorND | operator+ (const VectorND &vector) const |
Add this vector to another and return the result and return the result. More... | |
VectorND | operator- (const VectorND &vector) const |
Subtract a vector from this vector and return the result. More... | |
VectorND | operator* (const VectorND &vector) const |
Multiply this vector by another vector and return the result. More... | |
VectorND | operator/ (const VectorND &vector) const |
Divide this vector by another vector and return the result. More... | |
VectorND & | operator+= (const T &value) |
Add a scalar to each component of this vector and modify the original vector. More... | |
VectorND & | operator-= (const T &value) |
Subtract a scalar from each component of this vector and modify the original vector. More... | |
VectorND & | operator*= (const T &value) |
Multiply each component of this vector by a scalar and modify the original vector. More... | |
VectorND & | operator/= (const T &value) |
Divide each component of this vector by a scalar and modify the original vector. More... | |
VectorND & | operator+= (const VectorND &vector) |
Add a vector to this vector, modifying this original vector. More... | |
VectorND & | operator-= (const VectorND &vector) |
Subtract a vector from this vector, modifying this original vector. More... | |
VectorND & | operator*= (const VectorND &vector) |
Multiply this vector by another vector and modify this vector. More... | |
VectorND & | operator/= (const VectorND &vector) |
Divide this vector by another vector and modify this vector. More... | |
data::String | toString () const |
Convert this 3D vector into a human-readable string representation. More... | |
operator data::String () const | |
Convert this 3D vector into a human-readable string representation. More... | |
Static Public Member Functions | |
static VectorND | spherical (T theta, T phi) |
Return a 3D cartesian unit-length vector for the specified spherical coordinates. More... | |
static VectorND | spherical (T theta, T phi, T r) |
Return a 3D cartesian vector for the specified spherical coordinates. More... | |
static VectorND | cylindrical (T theta, T r, T z) |
Return a 3D cartesian vector for the specified cylindrical coordinates. More... | |
static VectorND | polarXY (T angle) |
Convert the specified polar angle in radians to a unit-length 3D vector in the XY plane. More... | |
static VectorND | polarXY (T angle, T r) |
Convert the specified polar coordinates in radians to an r-length 3D vector in the XY plane. More... | |
static VectorND | polarXZ (T angle) |
Convert the specified polar angle in radians to a unit-length 3D vector in the XZ plane. More... | |
static VectorND | polarXZ (T angle, T r) |
Convert the specified polar coordinates in radians to an r-length 3D vector in the XZ plane. More... | |
static VectorND | polarYZ (T angle) |
Convert the specified polar angle in radians to a unit-length 3D vector in the YZ plane. More... | |
static VectorND | polarYZ (T angle, T r) |
Convert the specified polar coordinates in radians to an r-length 3D vector in the YZ plane. More... | |
Public Attributes | |
union om::math::VectorND< T, 3 >:: { ... } | |
T | v [3] |
An array that contains the vector components. More... | |
T | r |
The red component of a 3-component color. More... | |
T | g |
The green component of a 3-component color. More... | |
T | b |
The blue component of a 3-component color. More... | |
T | x |
The X coordinate of a 3D vector. More... | |
T | y |
The Y coordinate of a 3D vector. More... | |
T | z |
The Z coordinate of a 3D vector. More... | |
Swizzle2D< T, 3, 0, 0 > | xx |
Swizzle2D< T, 3, 0, 0 > | rr |
Swizzle2D< T, 3, 1, 1 > | yy |
Swizzle2D< T, 3, 1, 1 > | gg |
Swizzle2D< T, 3, 2, 2 > | zz |
Swizzle2D< T, 3, 2, 2 > | bb |
Swizzle2D< T, 3, 0, 1 > | xy |
Swizzle2D< T, 3, 0, 1 > | rg |
Swizzle2D< T, 3, 0, 2 > | xz |
Swizzle2D< T, 3, 0, 2 > | rb |
Swizzle2D< T, 3, 1, 0 > | yx |
Swizzle2D< T, 3, 1, 0 > | gr |
Swizzle2D< T, 3, 1, 2 > | yz |
Swizzle2D< T, 3, 1, 2 > | gb |
Swizzle2D< T, 3, 2, 0 > | zx |
Swizzle2D< T, 3, 2, 0 > | br |
Swizzle2D< T, 3, 2, 1 > | zy |
Swizzle2D< T, 3, 2, 1 > | bg |
Swizzle3D< T, 3, 0, 0, 0 > | xxx |
Swizzle3D< T, 3, 0, 0, 0 > | rrr |
Swizzle3D< T, 3, 1, 1, 1 > | yyy |
Swizzle3D< T, 3, 1, 1, 1 > | ggg |
Swizzle3D< T, 3, 2, 2, 2 > | zzz |
Swizzle3D< T, 3, 2, 2, 2 > | bbb |
Swizzle3D< T, 3, 0, 1, 1 > | xyy |
Swizzle3D< T, 3, 0, 1, 1 > | rgg |
Swizzle3D< T, 3, 1, 0, 1 > | yxy |
Swizzle3D< T, 3, 1, 0, 1 > | grg |
Swizzle3D< T, 3, 1, 1, 0 > | yyx |
Swizzle3D< T, 3, 1, 1, 0 > | ggr |
Swizzle3D< T, 3, 0, 2, 2 > | xzz |
Swizzle3D< T, 3, 0, 2, 2 > | rbb |
Swizzle3D< T, 3, 2, 0, 2 > | zxz |
Swizzle3D< T, 3, 2, 0, 2 > | brb |
Swizzle3D< T, 3, 2, 2, 0 > | zzx |
Swizzle3D< T, 3, 2, 2, 0 > | bbr |
Swizzle3D< T, 3, 1, 0, 0 > | yxx |
Swizzle3D< T, 3, 1, 0, 0 > | grr |
Swizzle3D< T, 3, 0, 1, 0 > | xyx |
Swizzle3D< T, 3, 0, 1, 0 > | rgr |
Swizzle3D< T, 3, 0, 0, 1 > | xxy |
Swizzle3D< T, 3, 0, 0, 1 > | rrg |
Swizzle3D< T, 3, 1, 2, 2 > | yzz |
Swizzle3D< T, 3, 1, 2, 2 > | gbb |
Swizzle3D< T, 3, 2, 1, 2 > | zyz |
Swizzle3D< T, 3, 2, 1, 2 > | bgb |
Swizzle3D< T, 3, 2, 2, 1 > | zzy |
Swizzle3D< T, 3, 2, 2, 1 > | bbg |
Swizzle3D< T, 3, 2, 0, 0 > | zxx |
Swizzle3D< T, 3, 2, 0, 0 > | brr |
Swizzle3D< T, 3, 0, 2, 0 > | xzx |
Swizzle3D< T, 3, 0, 2, 0 > | rbr |
Swizzle3D< T, 3, 0, 0, 2 > | xxz |
Swizzle3D< T, 3, 0, 0, 2 > | rrb |
Swizzle3D< T, 3, 2, 1, 1 > | zyy |
Swizzle3D< T, 3, 2, 1, 1 > | bgg |
Swizzle3D< T, 3, 1, 2, 1 > | yzy |
Swizzle3D< T, 3, 1, 2, 1 > | gbg |
Swizzle3D< T, 3, 1, 1, 2 > | yyz |
Swizzle3D< T, 3, 1, 1, 2 > | ggb |
Swizzle3D< T, 3, 0, 1, 2 > | xyz |
Swizzle3D< T, 3, 0, 1, 2 > | rgb |
Swizzle3D< T, 3, 0, 2, 1 > | xzy |
Swizzle3D< T, 3, 0, 2, 1 > | rbg |
Swizzle3D< T, 3, 1, 0, 2 > | yxz |
Swizzle3D< T, 3, 1, 0, 2 > | grb |
Swizzle3D< T, 3, 1, 2, 0 > | yzx |
Swizzle3D< T, 3, 1, 2, 0 > | gbr |
Swizzle3D< T, 3, 2, 1, 0 > | zyx |
Swizzle3D< T, 3, 2, 1, 0 > | bgr |
Swizzle3D< T, 3, 2, 0, 1 > | zxy |
Swizzle3D< T, 3, 2, 0, 1 > | brg |
Static Public Attributes | |
static const VectorND | ZERO |
A constant vector with all elements equal to zero. More... | |
A class that represents a 3-dimensional point or vector.
|
inline |
Create a new 3D vector with all elements equal to zero.
|
inlineexplicit |
Create a new 3D vector with all elements equal to a single value.
|
inlineexplicit |
Create a new 3D vector from a pointer to a 3 element array.
|
inline |
Create a new 3D vector by specifying its x, y, and z values.
|
inline |
Create a new 3D vector from a 2D vector and a value for the Z coordinate.
|
inline |
Create a new 3D vector from a value for the X coordinate and a 2D vector.
|
inline |
Create a new 3D vector from an existing vector with a different template type.
|
inline |
Create a new 3D vector from an existing vector with the same template type.
This is declared because the auto-generated one was not working with the crazy uniform mess.
|
inline |
Create a new 3D vector from an existing vector with a different template type.
This is declared because the auto-generated one was not working with the crazy uniform mess.
|
inlinestatic |
Return a 3D cartesian unit-length vector for the specified spherical coordinates.
|
inlinestatic |
Return a 3D cartesian vector for the specified spherical coordinates.
|
inlinestatic |
Return a 3D cartesian vector for the specified cylindrical coordinates.
|
inlinestatic |
Convert the specified polar angle in radians to a unit-length 3D vector in the XY plane.
|
inlinestatic |
Convert the specified polar coordinates in radians to an r-length 3D vector in the XY plane.
|
inlinestatic |
Convert the specified polar angle in radians to a unit-length 3D vector in the XZ plane.
|
inlinestatic |
Convert the specified polar coordinates in radians to an r-length 3D vector in the XZ plane.
|
inlinestatic |
Convert the specified polar angle in radians to a unit-length 3D vector in the YZ plane.
|
inlinestatic |
Convert the specified polar coordinates in radians to an r-length 3D vector in the YZ plane.
|
inline |
Return the magnitude of this vector (the length).
|
inline |
Return the square of the magnitude of this vector.
|
inline |
Return a normalized version of this vector.
|
inline |
Return a normalized version of this vector, placing the vector's magnitude in the output parameter.
|
inline |
Project this vector on another vector and return the projected vector.
|
inline |
Project this vector on a normalized vector and return the projected vector.
|
inline |
Return the distance from this vector to another in 3D Euclidean space.
|
inline |
Return the square of the distance from this vector to another in 3D Euclidean space.
|
inline |
Return a pointer to the internal storage of this vector.
|
inline |
Return a const pointer to the internal storage of this vector.
|
inline |
Return the minimum component of this vector.
|
inline |
Return the maximum component of this vector.
|
inline |
Return a reference to the vector coordinate at the specified index.
|
inline |
Return a const reference to the vector coordinate at the specified index.
|
inline |
Return a reference to the vector coordinate at the specified index.
|
inline |
Return a const reference to the vector coordinate at the specified index.
|
inline |
Set the X, Y, and Z coordinates of the vector to the specified values.
|
inline |
Set the coordinate of this vector at the specified index to a new value.
|
inline |
Return whether or not this vector is equal to another for all components.
|
inline |
Return whether or not this vector is not equal to another for any component.
|
inline |
Negate each component of this vector and return the result.
|
inline |
Return copy of the original vector.
|
inline |
Add a scalar to every component of this vector and return the result.
|
inline |
Subtract a scalar from every component of this vector and return the result.
|
inline |
Multiply every component of this vector by a scalar and return the result.
|
inline |
Divide every component of this vector by a scalar and return the result.
|
inline |
Add this vector to another and return the result and return the result.
|
inline |
Subtract a vector from this vector and return the result.
|
inline |
Multiply this vector by another vector and return the result.
|
inline |
Divide this vector by another vector and return the result.
|
inline |
Add a scalar to each component of this vector and modify the original vector.
|
inline |
Subtract a scalar from each component of this vector and modify the original vector.
|
inline |
Multiply each component of this vector by a scalar and modify the original vector.
|
inline |
Divide each component of this vector by a scalar and modify the original vector.
|
inline |
Add a vector to this vector, modifying this original vector.
|
inline |
Subtract a vector from this vector, modifying this original vector.
|
inline |
Multiply this vector by another vector and modify this vector.
|
inline |
Divide this vector by another vector and modify this vector.
|
inline |
Convert this 3D vector into a human-readable string representation.
|
inline |
Convert this 3D vector into a human-readable string representation.
T om::math::VectorND< T, 3 >::v[3] |
An array that contains the vector components.
T om::math::VectorND< T, 3 >::r |
The red component of a 3-component color.
T om::math::VectorND< T, 3 >::g |
The green component of a 3-component color.
T om::math::VectorND< T, 3 >::b |
The blue component of a 3-component color.
T om::math::VectorND< T, 3 >::x |
The X coordinate of a 3D vector.
T om::math::VectorND< T, 3 >::y |
The Y coordinate of a 3D vector.
T om::math::VectorND< T, 3 >::z |
The Z coordinate of a 3D vector.
Swizzle2D<T,3,0,0> om::math::VectorND< T, 3 >::xx |
Swizzle2D<T,3,0,0> om::math::VectorND< T, 3 >::rr |
Swizzle2D<T,3,1,1> om::math::VectorND< T, 3 >::yy |
Swizzle2D<T,3,1,1> om::math::VectorND< T, 3 >::gg |
Swizzle2D<T,3,2,2> om::math::VectorND< T, 3 >::zz |
Swizzle2D<T,3,2,2> om::math::VectorND< T, 3 >::bb |
Swizzle2D<T,3,0,1> om::math::VectorND< T, 3 >::xy |
Swizzle2D<T,3,0,1> om::math::VectorND< T, 3 >::rg |
Swizzle2D<T,3,0,2> om::math::VectorND< T, 3 >::xz |
Swizzle2D<T,3,0,2> om::math::VectorND< T, 3 >::rb |
Swizzle2D<T,3,1,0> om::math::VectorND< T, 3 >::yx |
Swizzle2D<T,3,1,0> om::math::VectorND< T, 3 >::gr |
Swizzle2D<T,3,1,2> om::math::VectorND< T, 3 >::yz |
Swizzle2D<T,3,1,2> om::math::VectorND< T, 3 >::gb |
Swizzle2D<T,3,2,0> om::math::VectorND< T, 3 >::zx |
Swizzle2D<T,3,2,0> om::math::VectorND< T, 3 >::br |
Swizzle2D<T,3,2,1> om::math::VectorND< T, 3 >::zy |
Swizzle2D<T,3,2,1> om::math::VectorND< T, 3 >::bg |
Swizzle3D<T,3,0,0,0> om::math::VectorND< T, 3 >::xxx |
Swizzle3D<T,3,0,0,0> om::math::VectorND< T, 3 >::rrr |
Swizzle3D<T,3,1,1,1> om::math::VectorND< T, 3 >::yyy |
Swizzle3D<T,3,1,1,1> om::math::VectorND< T, 3 >::ggg |
Swizzle3D<T,3,2,2,2> om::math::VectorND< T, 3 >::zzz |
Swizzle3D<T,3,2,2,2> om::math::VectorND< T, 3 >::bbb |
Swizzle3D<T,3,0,1,1> om::math::VectorND< T, 3 >::xyy |
Swizzle3D<T,3,0,1,1> om::math::VectorND< T, 3 >::rgg |
Swizzle3D<T,3,1,0,1> om::math::VectorND< T, 3 >::yxy |
Swizzle3D<T,3,1,0,1> om::math::VectorND< T, 3 >::grg |
Swizzle3D<T,3,1,1,0> om::math::VectorND< T, 3 >::yyx |
Swizzle3D<T,3,1,1,0> om::math::VectorND< T, 3 >::ggr |
Swizzle3D<T,3,0,2,2> om::math::VectorND< T, 3 >::xzz |
Swizzle3D<T,3,0,2,2> om::math::VectorND< T, 3 >::rbb |
Swizzle3D<T,3,2,0,2> om::math::VectorND< T, 3 >::zxz |
Swizzle3D<T,3,2,0,2> om::math::VectorND< T, 3 >::brb |
Swizzle3D<T,3,2,2,0> om::math::VectorND< T, 3 >::zzx |
Swizzle3D<T,3,2,2,0> om::math::VectorND< T, 3 >::bbr |
Swizzle3D<T,3,1,0,0> om::math::VectorND< T, 3 >::yxx |
Swizzle3D<T,3,1,0,0> om::math::VectorND< T, 3 >::grr |
Swizzle3D<T,3,0,1,0> om::math::VectorND< T, 3 >::xyx |
Swizzle3D<T,3,0,1,0> om::math::VectorND< T, 3 >::rgr |
Swizzle3D<T,3,0,0,1> om::math::VectorND< T, 3 >::xxy |
Swizzle3D<T,3,0,0,1> om::math::VectorND< T, 3 >::rrg |
Swizzle3D<T,3,1,2,2> om::math::VectorND< T, 3 >::yzz |
Swizzle3D<T,3,1,2,2> om::math::VectorND< T, 3 >::gbb |
Swizzle3D<T,3,2,1,2> om::math::VectorND< T, 3 >::zyz |
Swizzle3D<T,3,2,1,2> om::math::VectorND< T, 3 >::bgb |
Swizzle3D<T,3,2,2,1> om::math::VectorND< T, 3 >::zzy |
Swizzle3D<T,3,2,2,1> om::math::VectorND< T, 3 >::bbg |
Swizzle3D<T,3,2,0,0> om::math::VectorND< T, 3 >::zxx |
Swizzle3D<T,3,2,0,0> om::math::VectorND< T, 3 >::brr |
Swizzle3D<T,3,0,2,0> om::math::VectorND< T, 3 >::xzx |
Swizzle3D<T,3,0,2,0> om::math::VectorND< T, 3 >::rbr |
Swizzle3D<T,3,0,0,2> om::math::VectorND< T, 3 >::xxz |
Swizzle3D<T,3,0,0,2> om::math::VectorND< T, 3 >::rrb |
Swizzle3D<T,3,2,1,1> om::math::VectorND< T, 3 >::zyy |
Swizzle3D<T,3,2,1,1> om::math::VectorND< T, 3 >::bgg |
Swizzle3D<T,3,1,2,1> om::math::VectorND< T, 3 >::yzy |
Swizzle3D<T,3,1,2,1> om::math::VectorND< T, 3 >::gbg |
Swizzle3D<T,3,1,1,2> om::math::VectorND< T, 3 >::yyz |
Swizzle3D<T,3,1,1,2> om::math::VectorND< T, 3 >::ggb |
Swizzle3D<T,3,0,1,2> om::math::VectorND< T, 3 >::xyz |
Swizzle3D<T,3,0,1,2> om::math::VectorND< T, 3 >::rgb |
Swizzle3D<T,3,0,2,1> om::math::VectorND< T, 3 >::xzy |
Swizzle3D<T,3,0,2,1> om::math::VectorND< T, 3 >::rbg |
Swizzle3D<T,3,1,0,2> om::math::VectorND< T, 3 >::yxz |
Swizzle3D<T,3,1,0,2> om::math::VectorND< T, 3 >::grb |
Swizzle3D<T,3,1,2,0> om::math::VectorND< T, 3 >::yzx |
Swizzle3D<T,3,1,2,0> om::math::VectorND< T, 3 >::gbr |
Swizzle3D<T,3,2,1,0> om::math::VectorND< T, 3 >::zyx |
Swizzle3D<T,3,2,1,0> om::math::VectorND< T, 3 >::bgr |
Swizzle3D<T,3,2,0,1> om::math::VectorND< T, 3 >::zxy |
Swizzle3D<T,3,2,0,1> om::math::VectorND< T, 3 >::brg |
union { ... } |
|
static |
A constant vector with all elements equal to zero.