![]() |
OGRE 1.12.10
Object-Oriented Graphics Rendering Engine
|
Standard N-dimensional vector. More...
#include <OgreVector.h>
Public Member Functions | |
Vector () | |
Default constructor. | |
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 _x, T _y) | |
Vector (T _x, T _y, T _z) | |
Vector (T _x, T _y, T _z, T _w) | |
Vector (T s) | |
Radian | angleBetween (const Vector &dest) const |
Gets the angle between 2 vectors. | |
Real | distance (const Vector &rhs) const |
Returns the distance to another vector. | |
T | dotProduct (const VectorBase< dims, T > &vec) const |
Calculates the dot (scalar) product of this vector with another. | |
bool | isNaN () const |
Check whether this vector contains valid values. | |
bool | isZeroLength () const |
Returns true if this vector is zero length. | |
Real | length () const |
Returns the length (magnitude) of the vector. | |
void | makeCeil (const Vector &cmp) |
Sets this vector's components to the maximum of its own and the ones of the passed in vector. | |
void | makeFloor (const Vector &cmp) |
Sets this vector's components to the minimum of its own and the ones of the passed in vector. | |
Real | normalise () |
Normalises the vector. | |
Vector | normalisedCopy () const |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy. | |
bool | operator!= (const Vector &v) const |
Vector | operator* (const Vector &b) const |
Vector | operator* (Real s) const |
Vector & | operator*= (const Vector &b) |
Vector & | operator*= (Real s) |
const Vector & | operator+ () const |
Vector | operator+ (const Vector &b) const |
Vector | operator+ (Real s) const |
Vector & | operator+= (const Vector &b) |
Vector & | operator+= (Real s) |
Vector | operator- () const |
Vector | operator- (const Vector &b) const |
Vector | operator- (Real s) const |
Vector & | operator-= (const Vector &b) |
Vector & | operator-= (Real s) |
Vector | operator/ (const Vector &b) const |
Vector | operator/ (Real s) const |
Vector & | operator/= (const Vector &b) |
Vector & | operator/= (Real s) |
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. | |
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. | |
T & | operator[] (size_t i) |
T | operator[] (size_t i) const |
bool | positionEquals (const Vector &rhs, Real tolerance=1e-03f) const |
Returns whether this vector is within a positional tolerance of another vector. | |
Vector | reflect (const Vector &normal) const |
Calculates a reflection vector to the plane with the given normal . | |
T | squaredDistance (const Vector &rhs) const |
Returns the square of the distance to another vector. | |
T | squaredLength () const |
Returns the square of the length(magnitude) of the vector. | |
Vector< 2, T > | xy () const |
Vector< 3, T > | xyz () const |
Swizzle-like narrowing operations. | |
![]() | |
VectorBase () | |
VectorBase (T _x, T _y) | |
VectorBase (T _x, T _y, T _z) | |
VectorBase (T _x, T _y, T _z, T _w) | |
T * | ptr () |
const T * | ptr () const |
Additional Inherited Members | |
![]() | |
T | data [dims] |
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 |
References Ogre::VectorBase< dims, T >::ptr().
|
inlineexplicit |
References Ogre::VectorBase< dims, T >::ptr().
|
inline |
Swizzle-like narrowing operations.
References Ogre::VectorBase< dims, T >::ptr().
|
inline |
References Ogre::VectorBase< dims, T >::ptr().
|
inline |
References Ogre::VectorBase< dims, T >::ptr().
|
inline |
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
|
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 |
References Ogre::VectorBase< dims, T >::ptr(), and Ogre::Math::RealEqual().
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.
References Ogre::VectorBase< dims, T >::ptr().
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
References Ogre::VectorBase< dims, T >::ptr().
Sets this vector's components to the minimum of its own and the ones of the passed in vector.
References Ogre::VectorBase< dims, T >::ptr().
Referenced by Ogre::AxisAlignedBox::merge().
Sets this vector's components to the maximum of its own and the ones of the passed in vector.
References Ogre::VectorBase< dims, T >::ptr().
Referenced by 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). |
References Ogre::VectorBase< dims, T >::ptr().
Referenced by Ogre::Vector< dims, T >::angleBetween(), Ogre::Math::calculateFaceNormal(), Ogre::Math::calculateFaceNormalWithoutNormalize(), Ogre::Plane::getDistance(), Ogre::Ray::intersects(), Ogre::Plane::redefine(), Ogre::Vector< dims, T >::reflect(), and Ogre::Vector< dims, T >::squaredLength().
|
inline |
Returns the square of the length(magnitude) of the vector.
References Ogre::Vector< dims, T >::dotProduct().
Referenced by Ogre::Vector< dims, T >::isZeroLength(), and Ogre::Vector< dims, T >::length().
|
inline |
Returns true if this vector is zero length.
References Ogre::Vector< dims, T >::squaredLength().
|
inline |
Returns the length (magnitude) of the vector.
References Ogre::Math::Sqrt(), and Ogre::Vector< dims, T >::squaredLength().
Referenced by Ogre::Vector< dims, T >::angleBetween(), Ogre::Vector< dims, T >::normalise(), and Ogre::Plane::normalise().
Returns the distance to another vector.
|
inline |
Returns the square of the distance to another vector.
|
inline |
Normalises the vector.
References Ogre::Vector< dims, T >::length(), and Ogre::VectorBase< dims, T >::ptr().
Referenced by Ogre::Math::calculateBasicFaceNormal().
|
inline |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.
Referenced by Ogre::Math::lookRotation().
|
inline |
Check whether this vector contains valid values.
References Ogre::Math::isNaN(), and Ogre::VectorBase< dims, T >::ptr().
Gets the angle between 2 vectors.
References Ogre::Math::ACos(), Ogre::Math::Clamp(), Ogre::Vector< dims, T >::dotProduct(), and Ogre::Vector< dims, T >::length().
Calculates a reflection vector to the plane with the given normal .
References Ogre::Vector< dims, T >::dotProduct().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
References Ogre::VectorBase< dims, T >::ptr().
|
inline |