|
| Vector () |
| Default constructor. More...
|
|
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. 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* (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. 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) |
|
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. More...
|
|
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...
|
|
| 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 |
|
template<int dims, typename T>
class Ogre::Vector< dims, T >
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.
template<int dims, typename T >
Sets this vector's components to the minimum of its own and the ones of the passed in vector.
'Minimum' in this case means the combination of the lowest
value of x, y and z from both vectors. Lowest is taken just
numerically, not magnitude, so -1 < 0.
Referenced by Ogre::AxisAlignedBox::intersection(), and Ogre::AxisAlignedBox::merge().
template<int dims, typename T >
Sets this vector's components to the maximum of its own and the ones of the passed in vector.
'Maximum' in this case means the combination of the highest
value of x, y and z from both vectors. Highest is taken just
numerically, not magnitude, so 1 > -3.
Referenced by Ogre::AxisAlignedBox::intersection(), and Ogre::AxisAlignedBox::merge().
template<int dims, typename T >
Calculates the dot (scalar) product of this vector with another.
The dot product can be used to calculate the angle between 2
vectors. If both are unit vectors, the dot product is the
cosine of the angle; otherwise the dot product must be
divided by the product of the lengths of both vectors to get
the cosine of the angle. This result can further be used to
calculate the distance of a point from a plane.
- Parameters
-
vec | Vector with which to calculate the dot product (together with this one). |
- Returns
- A float representing the dot product value.
References Ogre::VectorBase< dims, T >::ptr().
Referenced by Ogre::Math::calculateFaceNormal(), Ogre::Math::calculateFaceNormalWithoutNormalize(), Ogre::VectorBase< 3, Real >::directionEquals(), Ogre::Plane::getDistance(), Ogre::VectorBase< 3, Real >::getRotationTo(), Ogre::Ray::intersects(), Ogre::Matrix3::orthonormalised(), and Ogre::Plane::redefine().
template<int dims, typename T >
template<int dims, typename T >
Returns the square of the distance to another vector.
This method is for efficiency - calculating the actual
distance to another vector requires a square root, which is
expensive in terms of the operations required. This method
returns the square of the distance to another vector, i.e.
the same as the distance but before the square root is taken.
Use this if you want to find the longest / shortest distance
without incurring the square root.