![]() |
OGRE-Next 3.0.0
Object-Oriented Graphics Rendering Engine
|
Standard 2-dimensional vector. More...
#include <OgreVector2.h>
Public Member Functions | |
| Vector2 () | |
| Default constructor. | |
| Vector2 (const int afCoordinate[2]) | |
| Vector2 (const Real afCoordinate[2]) | |
| Vector2 (const Real fX, const Real fY) | |
| Vector2 (const Real scaler) | |
| Vector2 (Real *const r) | |
| Ogre::Radian | angleBetween (const Ogre::Vector2 &other) const |
| Gets the angle between 2 vectors. | |
| Ogre::Radian | angleTo (const Ogre::Vector2 &other) const |
| Gets the oriented angle between 2 vectors. | |
| Real | crossProduct (const Vector2 &rkVector) const |
| Calculates the 2 dimensional cross-product of 2 vectors, which results in a single floating point value which is 2 times the area of the triangle. | |
| Real | distance (const Vector2 &rhs) const |
| Returns the distance to another vector. | |
| Real | dotProduct (const Vector2 &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 Vector2 &cmp) |
| Sets this vector's components to the maximum of its own and the ones of the passed in vector. | |
| void | makeFloor (const Vector2 &cmp) |
| Sets this vector's components to the minimum of its own and the ones of the passed in vector. | |
| Vector2 | midPoint (const Vector2 &vec) const |
| Returns a vector at a point half way between this and the passed in vector. | |
| Real | normalise () |
| Normalises the vector. | |
| Vector2 | normalisedCopy () const |
| As normalise, except that this vector is unaffected and the normalised vector is returned as a copy. | |
| bool | operator!= (const Vector2 &rkVector) const |
| Vector2 | operator* (const Real fScalar) const |
| Vector2 | operator* (const Vector2 &rhs) const |
| Vector2 & | operator*= (const Real fScalar) |
| Vector2 & | operator*= (const Vector2 &rkVector) |
| const Vector2 & | operator+ () const |
| Vector2 | operator+ (const Vector2 &rkVector) const |
| Vector2 & | operator+= (const Real fScaler) |
| Vector2 & | operator+= (const Vector2 &rkVector) |
| Vector2 | operator- () const |
| Vector2 | operator- (const Vector2 &rkVector) const |
| Vector2 & | operator-= (const Real fScaler) |
| Vector2 & | operator-= (const Vector2 &rkVector) |
| Vector2 | operator/ (const Real fScalar) const |
| Vector2 | operator/ (const Vector2 &rhs) const |
| Vector2 & | operator/= (const Real fScalar) |
| Vector2 & | operator/= (const Vector2 &rkVector) |
| bool | operator< (const Vector2 &rhs) const |
| Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against. | |
| Vector2 & | operator= (const Real fScalar) |
| bool | operator== (const Vector2 &rkVector) const |
| bool | operator> (const Vector2 &rhs) const |
| Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against. | |
| Real & | operator[] (const size_t i) |
| Real | operator[] (const size_t i) const |
| Vector2 | perpendicular () const |
| Generates a vector perpendicular to this vector (eg an 'up' vector). | |
| Real * | ptr () |
| Pointer accessor for direct copying. | |
| const Real * | ptr () const |
| Pointer accessor for direct copying. | |
| Vector2 | randomDeviant (Radian angle) const |
| Generates a new random vector which deviates from this vector by a given angle in a random direction. | |
| Vector2 | reflect (const Vector2 &normal) const |
| Calculates a reflection vector to the plane with the given normal . | |
| Real | squaredDistance (const Vector2 &rhs) const |
| Returns the square of the distance to another vector. | |
| Real | squaredLength () const |
| Returns the square of the length(magnitude) of the vector. | |
| void | swap (Vector2 &other) |
| Exchange the contents of this vector with another. | |
Public Attributes | |
| Real | x |
| Real | y |
Static Public Attributes | |
| static const Vector2 | NEGATIVE_UNIT_X |
| static const Vector2 | NEGATIVE_UNIT_Y |
| static const Vector2 | UNIT_SCALE |
| static const Vector2 | UNIT_X |
| static const Vector2 | UNIT_Y |
| static const Vector2 | ZERO |
Standard 2-dimensional vector.
|
inline |
Default constructor.
Referenced by crossProduct(), distance(), dotProduct(), makeCeil(), makeFloor(), midPoint(), normalisedCopy(), operator!=(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator<(), operator<<, operator=(), operator==(), operator>(), perpendicular(), randomDeviant(), reflect(), squaredDistance(), and swap().
|
inline |
Gets the angle between 2 vectors.
References Ogre::Math::ACos(), Ogre::Math::Clamp(), dotProduct(), and length().
Referenced by angleTo().
|
inline |
Gets the oriented angle between 2 vectors.
References angleBetween(), crossProduct(), and Ogre::Math::TWO_PI.
Returns the distance to another vector.
References Vector2().
Calculates the dot (scalar) product of this vector with another.
| vec | Vector with which to calculate the dot product (together with this one). |
References Vector2(), x, and y.
Referenced by angleBetween(), and reflect().
|
inline |
Check whether this vector contains valid values.
References Ogre::Math::isNaN(), x, and y.
|
inline |
|
inline |
Returns the length (magnitude) of the vector.
References Ogre::Math::Sqrt(), x, and y.
Referenced by angleBetween().
|
inline |
|
inline |
|
inline |
Normalises the vector.
References Ogre::Math::Sqrt(), x, and y.
Referenced by normalisedCopy().
|
inline |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.
References Vector2(), and normalise().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Generates a vector perpendicular to this vector (eg an 'up' vector).
Generates a new random vector which deviates from this vector by a given angle in a random direction.
| angle | The angle at which to deviate in radians |
References Vector2(), Ogre::Math::Cos(), Ogre::Math::RangeRandom(), Ogre::Math::Sin(), x, and y.
Calculates a reflection vector to the plane with the given normal .
References Vector2(), and dotProduct().
Returns the square of the distance to another vector.
References Vector2().
|
inline |
Returns the square of the length(magnitude) of the vector.
|
inline |
Exchange the contents of this vector with another.
References Vector2(), std::swap(), x, and y.
|
static |
|
static |
|
static |
|
static |
|
static |
| Real Ogre::Vector2::x |
Referenced by Vector2(), Vector2(), Vector2(), Vector2(), Vector2(), crossProduct(), dotProduct(), isNaN(), isZeroLength(), length(), makeCeil(), makeFloor(), midPoint(), normalise(), operator!=(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator<(), operator=(), operator==(), operator>(), operator[](), operator[](), perpendicular(), ptr(), ptr(), randomDeviant(), squaredLength(), and swap().
| Real Ogre::Vector2::y |
Referenced by Vector2(), Vector2(), Vector2(), Vector2(), Vector2(), crossProduct(), dotProduct(), isNaN(), isZeroLength(), length(), makeCeil(), makeFloor(), midPoint(), normalise(), operator!=(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator<(), operator=(), operator==(), operator>(), perpendicular(), randomDeviant(), squaredLength(), and swap().
|
static |
Referenced by Ogre::StringConverter::parseVector2().