OGRE
1.11.6
Object-Oriented Graphics Rendering Engine
|
Standard N-dimensional vector. More...
#include <OgreVector.h>
Public Member Functions | |
Vector () | |
Default constructor. More... | |
Vector (T _x, T _y) | |
Vector (T _x, T _y, T _z) | |
Vector (T _x, T _y, T _z, T _w) | |
template<int N = dims> | |
Vector (const typename std::enable_if< N==4, Vector3 >::type &rhs, T fW=1.0f) | |
template<typename U > | |
Vector (const U *_ptr) | |
template<typename U > | |
Vector (const Vector< dims, U > &o) | |
Vector (T s) | |
Radian | angleBetween (const Vector &dest) const |
Gets the angle between 2 vectors. More... | |
Real | distance (const Vector &rhs) const |
Returns the distance to another vector. More... | |
T | dotProduct (const VectorBase< dims, T > &vec) const |
Calculates the dot (scalar) product of this vector with another. More... | |
bool | isNaN () const |
Check whether this vector contains valid values. More... | |
bool | isZeroLength () const |
Returns true if this vector is zero length. More... | |
Real | length () const |
Returns the length (magnitude) of the vector. More... | |
void | makeCeil (const Vector &cmp) |
Sets this vector's components to the maximum of its own and the ones of the passed in vector. More... | |
void | makeFloor (const Vector &cmp) |
Sets this vector's components to the minimum of its own and the ones of the passed in vector. More... | |
Real | normalise () |
Normalises the vector. More... | |
Vector | normalisedCopy () const |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy. More... | |
bool | operator!= (const Vector &v) const |
Vector | operator* (Real s) const |
Vector | operator* (const Vector &b) const |
Vector & | operator*= (Real s) |
Vector & | operator*= (const Vector &b) |
const Vector & | operator+ () const |
Vector | operator+ (Real s) const |
Vector | operator+ (const Vector &b) const |
Vector & | operator+= (Real s) |
Vector & | operator+= (const Vector &b) |
Vector | operator- () const |
Vector | operator- (Real s) const |
Vector | operator- (const Vector &b) const |
Vector & | operator-= (Real s) |
Vector & | operator-= (const Vector &b) |
Vector | operator/ (Real s) const |
Vector | operator/ (const Vector &b) const |
Vector & | operator/= (Real s) |
Vector & | operator/= (const Vector &b) |
bool | operator< (const Vector &rhs) const |
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against. More... | |
bool | operator== (const Vector &v) const |
bool | operator> (const Vector &rhs) const |
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against. More... | |
T | operator[] (size_t i) const |
T & | operator[] (size_t i) |
bool | positionEquals (const Vector &rhs, Real tolerance=1e-03f) const |
Returns whether this vector is within a positional tolerance of another vector. More... | |
T * | ptr () |
const T * | ptr () const |
Vector | reflect (const Vector &normal) const |
Calculates a reflection vector to the plane with the given normal . More... | |
T | squaredDistance (const Vector &rhs) const |
Returns the square of the distance to another vector. More... | |
T | squaredLength () const |
Returns the square of the length(magnitude) of the vector. More... | |
Vector< 2, T > | xy () const |
Vector< 3, T > | xyz () const |
Swizzle-like narrowing operations. More... | |
Public Attributes | |
T | data [dims] |
Friends | |
Vector | operator* (Real s, Vector v) |
Vector | operator+ (Real s, Vector v) |
Vector | operator- (Real s, const Vector &v) |
Vector | operator/ (Real s, const Vector &v) |
std::ostream & | operator<< (std::ostream &o, const Vector &v) |
Standard N-dimensional vector.
A direction in N-D space represented as distances along the orthogonal axes. Note that positions, directions and scaling factors can be represented by a vector, depending on how you interpret the values.
|
inline |
Default constructor.
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Swizzle-like narrowing operations.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns whether this vector is within a positional tolerance of another vector.
rhs | The vector to compare with |
tolerance | The amount that each element of the vector may vary by and still be considered equal |
|
inline |
|
inline |
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.
|
inline |
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
|
inline |
Sets this vector's components to the minimum of its own and the ones of the passed in vector.
Referenced by Ogre::AxisAlignedBox::intersection(), and Ogre::AxisAlignedBox::merge().
|
inline |
Sets this vector's components to the maximum of its own and the ones of the passed in vector.
Referenced by Ogre::AxisAlignedBox::intersection(), and Ogre::AxisAlignedBox::merge().
|
inline |
Calculates the dot (scalar) product of this vector with another.
vec | Vector with which to calculate the dot product (together with this one). |
Referenced by Ogre::Math::calculateFaceNormal(), Ogre::Math::calculateFaceNormalWithoutNormalize(), Ogre::VectorBase< 3, Real >::directionEquals(), Ogre::Plane::getDistance(), Ogre::VectorBase< 3, Real >::getRotationTo(), Ogre::Ray::intersects(), and Ogre::Plane::redefine().
|
inline |
Returns the square of the length(magnitude) of the vector.
Referenced by Ogre::VectorBase< 3, Real >::getRotationTo(), Ogre::Ray::intersects(), Ogre::Sphere::merge(), Ogre::VectorBase< 3, Real >::positionCloses(), and Ogre::AxisAlignedBox::squaredDistance().
|
inline |
Returns true if this vector is zero length.
|
inline |
Returns the length (magnitude) of the vector.
Referenced by Ogre::Vector< 3, Real >::angleBetween(), and Ogre::Plane::normalise().
|
inline |
Returns the distance to another vector.
|
inline |
Returns the square of the distance to another vector.
|
inline |
Normalises the vector.
Referenced by Ogre::Math::calculateBasicFaceNormal(), Ogre::Vector< 3, Real >::normalisedCopy(), and Ogre::operator*().
|
inline |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.
Referenced by Ogre::VectorBase< 3, Real >::perpendicular().
|
inline |
Check whether this vector contains valid values.
|
inline |
Gets the angle between 2 vectors.
|
inline |
Calculates a reflection vector to the plane with the given normal .
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineinherited |
Referenced by Ogre::Vector< 3, Real >::dotProduct(), Ogre::Vector< 3, Real >::isNaN(), Ogre::Vector< 3, Real >::makeCeil(), Ogre::Vector< 3, Real >::makeFloor(), Ogre::Vector< 3, Real >::normalise(), Ogre::Vector< 3, Real >::operator*=(), Ogre::Vector< 3, Real >::operator+=(), Ogre::Vector< 3, Real >::operator-=(), Ogre::Vector< 3, Real >::operator/=(), Ogre::Vector< 3, Real >::operator<(), Ogre::Vector< 3, Real >::operator==(), Ogre::Vector< 3, Real >::operator>(), Ogre::Vector< 3, Real >::operator[](), Ogre::Vector< 3, Real >::positionEquals(), Ogre::RTShader::UniformParameter::setGpuParameter(), Ogre::Vector< 3, Real >::Vector(), Ogre::Vector< 3, Real >::xy(), and Ogre::Vector< 3, Real >::xyz().
|
inlineinherited |
|
friend |
|
inherited |
Referenced by Ogre::VectorBase< dims, int >::ptr(), and Ogre::VectorBase< dims, int >::VectorBase().