T Generic x, y, z, w vector. More...
#include <ignition/math/Vector4.hh>
Public Member Functions | |
Vector4 () | |
Constructor. | |
Vector4 (const T &_x, const T &_y, const T &_z, const T &_w) | |
Constructor with component values. | |
Vector4 (const Vector4< T > &_v) | |
Copy constructor. | |
virtual | ~Vector4 () |
Destructor. | |
T | Distance (const Vector4< T > &_pt) const |
Calc distance to the given point. | |
bool | Equal (const Vector4 &_v, const T &_tol) const |
Equality test with tolerance. | |
bool | IsFinite () const |
See if a point is finite (e.g., not nan) | |
T | Length () const |
Returns the length (magnitude) of the vector. | |
void | Normalize () |
Normalize the vector length. | |
bool | operator!= (const Vector4< T > &_pt) const |
Not equal to operator. | |
const Vector4< T > | operator* (const Matrix4< T > &_m) const |
Matrix multiplication operator. | |
const Vector4< T > | operator* (const Vector4< T > &_pt) const |
Multiplication operator. | |
const Vector4< T > | operator* (T _v) const |
Multiplication operators. | |
const Vector4< T > & | operator*= (const Vector4< T > &_pt) |
Multiplication assignment operator. | |
const Vector4< T > & | operator*= (T _v) |
Multiplication assignment operator. | |
Vector4< T > | operator+ (const T _s) const |
Addition operators. | |
Vector4< T > | operator+ (const Vector4< T > &_v) const |
Addition operator. | |
const Vector4< T > & | operator+= (const T _s) |
Addition assignment operator. | |
const Vector4< T > & | operator+= (const Vector4< T > &_v) |
Addition operator. | |
Vector4 | operator- () const |
Negation operator. | |
Vector4< T > | operator- (const T _s) const |
Subtraction operators. | |
Vector4< T > | operator- (const Vector4< T > &_v) const |
Subtraction operator. | |
const Vector4< T > & | operator-= (const T _s) |
Subtraction assignment operator. | |
const Vector4< T > & | operator-= (const Vector4< T > &_v) |
Subtraction assigment operators. | |
const Vector4< T > | operator/ (const Vector4< T > &_v) const |
Division assignment operator. | |
const Vector4< T > | operator/ (T _v) const |
Division assignment operator. | |
const Vector4< T > & | operator/= (const Vector4< T > &_v) |
Division assignment operator. | |
const Vector4< T > & | operator/= (T _v) |
Division operator. | |
Vector4< T > & | operator= (const Vector4< T > &_v) |
Assignment operator. | |
Vector4< T > & | operator= (T _value) |
Assignment operator. | |
bool | operator== (const Vector4< T > &_v) const |
Equal to operator. | |
T & | operator[] (const std::size_t _index) |
Array subscript operator. | |
T | operator[] (const std::size_t _index) const |
Const-qualified array subscript operator. | |
void | Set (T _x=0, T _y=0, T _z=0, T _w=0) |
Set the contents of the vector. | |
T | SquaredLength () const |
Return the square of the length (magnitude) of the vector. | |
T & | W () |
Return a mutable w value. | |
T | W () const |
Get the w value. | |
void | W (const T &_v) |
Set the w value. | |
T & | X () |
Return a mutable x value. | |
T | X () const |
Get the x value. | |
void | X (const T &_v) |
Set the x value. | |
T & | Y () |
Return a mutable y value. | |
T | Y () const |
Get the y value. | |
void | Y (const T &_v) |
Set the y value. | |
T & | Z () |
Return a mutable z value. | |
T | Z () const |
Get the z value. | |
void | Z (const T &_v) |
Set the z value. | |
Static Public Attributes | |
static const Vector4< T > | One |
math::Vector4(1, 1, 1, 1) | |
static const Vector4< T > | Zero |
math::Vector4(0, 0, 0, 0) | |
T Generic x, y, z, w vector.
|
inline |
Constructor.
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator*(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator*(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator*(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator+(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator+(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator-(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator-(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator-(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator/(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator/().
|
inline |
Constructor with component values.
[in] | _x | value along x axis |
[in] | _y | value along y axis |
[in] | _z | value along z axis |
[in] | _w | value along w axis |
|
inline |
Copy constructor.
[in] | _v | vector |
|
inlinevirtual |
Destructor.
|
inline |
Calc distance to the given point.
[in] | _pt | the point |
|
inline |
Equality test with tolerance.
[in] | _v | the vector to compare to |
[in] | _tol | equality tolerance. |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::equal().
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::operator==().
|
inline |
See if a point is finite (e.g., not nan)
|
inline |
Returns the length (magnitude) of the vector.
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::SquaredLength().
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Normalize().
|
inline |
Normalize the vector length.
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::equal(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Length().
|
inline |
Not equal to operator.
[in] | _pt | the other vector |
|
inline |
Matrix multiplication operator.
[in] | _m | matrix |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Multiplication operator.
[in] | _pt | another vector |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Multiplication operators.
[in] | _v | scaling factor |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Multiplication assignment operator.
[in] | _pt | a vector |
|
inline |
Multiplication assignment operator.
[in] | _v | scaling factor |
|
inline |
Addition operators.
[in] | _s | the scalar addend |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Addition operator.
[in] | _v | the vector to add |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Addition assignment operator.
[in] | _s | scalar addend |
|
inline |
Addition operator.
[in] | _v | the vector to add |
|
inline |
Negation operator.
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Subtraction operators.
[in] | _s | the scalar subtrahend |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Subtraction operator.
[in] | _v | the vector to substract |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Subtraction assignment operator.
[in] | _s | scalar subtrahend |
|
inline |
Subtraction assigment operators.
[in] | _v | the vector to substract |
|
inline |
Division assignment operator.
[in] | _v | the vector to perform element wise division with |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Division assignment operator.
[in] | _pt | another vector |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Vector4().
|
inline |
Division assignment operator.
[in] | _v | the vector to perform element wise division with |
|
inline |
Division operator.
[in] | _v | scaling factor |
|
inline |
Assignment operator.
[in] | _v | the vector |
|
inline |
Assignment operator.
[in] | _value |
|
inline |
Equal to operator.
[in] | _v | the other vector |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Equal().
|
inline |
Array subscript operator.
[in] | _index | The index, where 0 == x, 1 == y, 2 == z, 3 == w. The index is clamped to the range (0,3). |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::clamp(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::IGN_THREE_SIZE_T, and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::IGN_ZERO_SIZE_T.
|
inline |
Const-qualified array subscript operator.
[in] | _index | The index, where 0 == x, 1 == y, 2 == z, 3 == w. The index is clamped to the range (0,3). |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::clamp(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::IGN_THREE_SIZE_T, and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::IGN_ZERO_SIZE_T.
|
inline |
Set the contents of the vector.
[in] | _x | value along x axis |
[in] | _y | value along y axis |
[in] | _z | value along z axis |
[in] | _w | value along w axis |
|
inline |
Return the square of the length (magnitude) of the vector.
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector4< T >::Length().
|
inline |
Return a mutable w value.
|
inline |
Get the w value.
|
inline |
Set the w value.
[in] | _v | Value for the w component. |
|
inline |
Return a mutable x value.
|
inline |
Get the x value.
|
inline |
Set the x value.
[in] | _v | Value for the x component. |
|
inline |
Return a mutable y value.
|
inline |
Get the y value.
|
inline |
Set the y value.
[in] | _v | Value for the y component. |
|
inline |
Return a mutable z value.
|
inline |
Get the z value.
|
inline |
Set the z value.
[in] | _v | Value for the z component. |
|
static |
math::Vector4(1, 1, 1, 1)
|
static |
math::Vector4(0, 0, 0, 0)