![]() |
KudanAR - iOS
1.6.0
|
#include <OgreMathLib.h>
Public Member Functions | |
Vector3 (const Real fX, const Real fY, const Real fZ) | |
Vector3 (const Real afCoordinate[3]) | |
Vector3 (const int afCoordinate[3]) | |
Vector3 (Real *const r) | |
Vector3 (const Real scaler) | |
void | swap (Vector3 &other) |
Real | operator[] (const size_t i) const |
Real & | operator[] (const size_t i) |
Real * | ptr () |
Pointer accessor for direct copying. | |
const Real * | ptr () const |
Pointer accessor for direct copying. | |
Vector3 & | operator= (const Vector3 &rkVector) |
Vector3 & | operator= (const Real fScaler) |
bool | operator== (const Vector3 &rkVector) const |
bool | operator!= (const Vector3 &rkVector) const |
Vector3 | operator+ (const Vector3 &rkVector) const |
Vector3 | operator- (const Vector3 &rkVector) const |
Vector3 | operator* (const Real fScalar) const |
Vector3 | operator* (const Vector3 &rhs) const |
Vector3 | operator/ (const Real fScalar) const |
Vector3 | operator/ (const Vector3 &rhs) const |
const Vector3 & | operator+ () const |
Vector3 | operator- () const |
Vector3 & | operator+= (const Vector3 &rkVector) |
Vector3 & | operator+= (const Real fScalar) |
Vector3 & | operator-= (const Vector3 &rkVector) |
Vector3 & | operator-= (const Real fScalar) |
Vector3 & | operator*= (const Real fScalar) |
Vector3 & | operator*= (const Vector3 &rkVector) |
Vector3 & | operator/= (const Real fScalar) |
Vector3 & | operator/= (const Vector3 &rkVector) |
Real | length () const |
Real | squaredLength () const |
Real | distance (const Vector3 &rhs) const |
Real | squaredDistance (const Vector3 &rhs) const |
Real | dotProduct (const Vector3 &vec) const |
Real | absDotProduct (const Vector3 &vec) const |
Real | normalise () |
Vector3 | crossProduct (const Vector3 &rkVector) const |
Vector3 | midPoint (const Vector3 &vec) const |
bool | operator< (const Vector3 &rhs) const |
bool | operator> (const Vector3 &rhs) const |
void | makeFloor (const Vector3 &cmp) |
void | makeCeil (const Vector3 &cmp) |
Vector3 | perpendicular (void) const |
Vector3 | randomDeviant (const Radian &angle, const Vector3 &up=Vector3::ZERO) const |
Radian | angleBetween (const Vector3 &dest) |
Quaternion | getRotationTo (const Vector3 &dest, const Vector3 &fallbackAxis=Vector3::ZERO) const |
bool | isZeroLength (void) const |
Vector3 | normalisedCopy (void) const |
Vector3 | reflect (const Vector3 &normal) const |
bool | positionEquals (const Vector3 &rhs, Real tolerance=1e-03) const |
bool | positionCloses (const Vector3 &rhs, Real tolerance=1e-03f) const |
bool | directionEquals (const Vector3 &rhs, const Radian &tolerance) const |
bool | isNaN () const |
Check whether this vector contains valid values. | |
Vector3 | primaryAxis () const |
Extract the primary (dominant) axis from this direction vector. | |
std::string | to_s () const |
Public Attributes | |
Real | x |
Real | y |
Real | z |
Static Public Attributes | |
static const Vector3 | ZERO |
static const Vector3 | UNIT_X |
static const Vector3 | UNIT_Y |
static const Vector3 | UNIT_Z |
static const Vector3 | NEGATIVE_UNIT_X |
static const Vector3 | NEGATIVE_UNIT_Y |
static const Vector3 | NEGATIVE_UNIT_Z |
static const Vector3 | UNIT_SCALE |
Friends | |
Vector3 | operator* (const Real fScalar, const Vector3 &rkVector) |
Vector3 | operator/ (const Real fScalar, const Vector3 &rkVector) |
Vector3 | operator+ (const Vector3 &lhs, const Real rhs) |
Vector3 | operator+ (const Real lhs, const Vector3 &rhs) |
Vector3 | operator- (const Vector3 &lhs, const Real rhs) |
Vector3 | operator- (const Real lhs, const Vector3 &rhs) |
OGREMATHLIB_EXPORT friend std::ostream & | operator<< (std::ostream &o, const Vector3 &v) |
Standard 3-dimensional vector.
|
inline |
Calculates the absolute dot (scalar) product of this vector with another.
vec | Vector with which to calculate the absolute dot product (together with this one). |
Gets the angle between 2 vectors.
Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both.
vec | Vector which, together with this one, will be used to calculate the cross-product. |
|
inline |
Returns whether this vector is within a directional tolerance of another vector.
rhs | The vector to compare with |
tolerance | The maximum angle by which the vectors may vary and still be considered equal |
|
inline |
Returns the distance to another vector.
|
inline |
Calculates the dot (scalar) product of this vector with another.
vec | Vector with which to calculate the dot product (together with this one). |
Quaternion OgreMathLib::Vector3::getRotationTo | ( | const Vector3 & | dest, |
const Vector3 & | fallbackAxis = Vector3::ZERO |
||
) | const |
Gets the shortest arc quaternion to rotate this vector to the destination vector.
|
inline |
Returns true if this vector is zero length.
|
inline |
Returns the length (magnitude) of the vector.
|
inline |
Sets this vector's components to the maximum of its own and the ones of the passed in vector.
|
inline |
Sets this vector's components to the minimum of its own and the ones of the passed in vector.
Returns a vector at a point half way between this and the passed in vector.
|
inline |
Normalises the vector.
|
inline |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.
|
inline |
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.
Assigns the value of the other vector.
rkVector | The other vector |
|
inline |
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
|
inline |
Generates a vector perpendicular to this vector (eg an 'up' vector).
|
inline |
Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account.
rhs | The vector to compare with |
tolerance | The amount (related to the scale of vectors) that distance of the vector may vary by and still be considered close |
|
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 |
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 |
up | Any vector perpendicular to this one (which could generated by cross-product of this vector and any other non-colinear vector). If you choose not to provide this the function will derive one on it's own, however if you provide one yourself the function will be faster (this allows you to reuse up vectors if you call this method more than once) |
Calculates a reflection vector to the plane with the given normal .
|
inline |
Returns the square of the distance to another vector.
|
inline |
Returns the square of the length(magnitude) of the vector.
|
inline |
Exchange the contents of this vector with another.
|
friend |
Function for writing to a stream.