Ogre::Vector3 Class Reference
Core » Math

Standard 3-dimensional vector. More...

`#include <OgreVector3.h>`

## Public Member Functions

| Vector3 ()
| Default constructor. More...
| 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)
Real | absDotProduct (const Vector3 &vec) const
| Calculates the absolute dot (scalar) product of this vector with another. More...
Radian | angleBetween (const Vector3 &dest) const
| Gets the angle between 2 vectors. More...
Vector3 | crossProduct (const Vector3 &rkVector) const
| Calculates the cross-product of 2 vectors, i.e. More...
bool | directionEquals (const Vector3 &rhs, const Radian &tolerance) const
| Returns whether this vector is within a directional tolerance of another vector. More...
Real | distance (const Vector3 &rhs) const
| Returns the distance to another vector. More...
Real | dotProduct (const Vector3 &vec) const
| Calculates the dot (scalar) product of this vector with another. More...
Quaternion | getRotationTo (const Vector3 &dest, const Vector3 &fallbackAxis=Vector3::ZERO) const
| Gets the shortest arc quaternion to rotate this vector to the destination vector. More...
bool | isNaN () const
| Check whether this vector contains valid values. More...
bool | isZeroLength (void) const
| Returns true if this vector is zero length. More...
Real | length () const
| Returns the length (magnitude) of the vector. More...
void | makeCeil (const Vector3 &cmp)
| Sets this vector's components to the maximum of its own and the ones of the passed in vector. More...
void | makeFloor (const Vector3 &cmp)
| Sets this vector's components to the minimum of its own and the ones of the passed in vector. More...
Vector3 | midPoint (const Vector3 &vec) const
| Returns a vector at a point half way between this and the passed in vector. More...
Real | normalise ()
| Normalises the vector. More...
Vector3 | normalisedCopy (void) const
| As normalise, except that this vector is unaffected and the normalised vector is returned as a copy. More...
bool | operator!= (const Vector3 &rkVector) const
Vector3 | operator* (const Real fScalar) const
Vector3 | operator* (const Vector3 &rhs) const
Vector3 & | operator*= (const Real fScalar)
Vector3 & | operator*= (const Vector3 &rkVector)
Vector3 | operator+ (const Vector3 &rkVector) const
const Vector3 & | operator+ () const
Vector3 & | operator+= (const Vector3 &rkVector)
Vector3 & | operator+= (const Real fScalar)
Vector3 | operator- (const Vector3 &rkVector) const
Vector3 | operator- () const
Vector3 & | operator-= (const Vector3 &rkVector)
Vector3 & | operator-= (const Real fScalar)
Vector3 | operator/ (const Real fScalar) const
Vector3 | operator/ (const Vector3 &rhs) const
Vector3 & | operator/= (const Real fScalar)
Vector3 & | operator/= (const Vector3 &rkVector)
bool | operator< (const Vector3 &rhs) const
| Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against. More...
Vector3 & | operator= (const Vector3 &rkVector)
| Assigns the value of the other vector. More...
Vector3 & | operator= (const Real fScaler)
bool | operator== (const Vector3 &rkVector) const
bool | operator> (const Vector3 &rhs) const
| Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against. More...
Real | operator[] (const size_t i) const
Real & | operator[] (const size_t i)
Vector3 | perpendicular (void) const
| Generates a vector perpendicular to this vector (eg an 'up' vector). More...
bool | positionCloses (const Vector3 &rhs, Real tolerance=1e-03f) const
| Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account. More...
bool | positionEquals (const Vector3 &rhs, Real tolerance=1e-03) const
| Returns whether this vector is within a positional tolerance of another vector. More...
Vector3 | primaryAxis () const
| Extract the primary (dominant) axis from this direction vector. More...
Real * | ptr ()
| Pointer accessor for direct copying. More...
const Real * | ptr () const
| Pointer accessor for direct copying. More...
Vector3 | randomDeviant (const Radian &angle, const Vector3 &up=Vector3::ZERO) const
| Generates a new random vector which deviates from this vector by a given angle in a random direction. More...
Vector3 | reflect (const Vector3 &normal) const
| Calculates a reflection vector to the plane with the given normal . More...
Real | squaredDistance (const Vector3 &rhs) const
| Returns the square of the distance to another vector. More...
Real | squaredLength () const
| Returns the square of the length(magnitude) of the vector. More...
void | swap (Vector3 &other)
| Exchange the contents of this vector with another. More...

## Public Attributes

Real | x
Real | y
Real | z

## Static Public Attributes

static const Vector3 | NEGATIVE_UNIT_X
static const Vector3 | NEGATIVE_UNIT_Y
static const Vector3 | NEGATIVE_UNIT_Z
static const Vector3 | UNIT_SCALE
static const Vector3 | UNIT_X
static const Vector3 | UNIT_Y
static const Vector3 | UNIT_Z
static const Vector3 | ZERO

## Friends

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)
Vector3 | operator/ (const Real fScalar, const Vector3 &rkVector)
_OgreExport friend std::ostream & | operator<< (std::ostream &o, const Vector3 &v)
| Function for writing to a stream. More...

## Detailed Description

Standard 3-dimensional vector.

Remarks
  A direction in 3D space represented as distances along the 3 orthogonal axes (x, y, z). Note that positions, directions and scaling factors can be represented by a vector, depending on how you interpret the values.

Definition at line 51 of file OgreVector3.h.

## Constructor & Destructor Documentation

## Vector3() [1/6]

Ogre::Vector3::Vector3 | ( |  | ) |

Default constructor.

Note
  It does NOT initialize the vector for efficiency.

Definition at line 61 of file OgreVector3.h.

## Vector3() [2/6]

Ogre::Vector3::Vector3 | ( | const Real | fX,
|  | const Real | fY,
|  | const Real | fZ
| ) |  |

Definition at line 65 of file OgreVector3.h.

## Vector3() [3/6]

Ogre::Vector3::Vector3 | ( | const Real | afCoordinate[3] | ) |

explicit

Definition at line 70 of file OgreVector3.h.

## Vector3() [4/6]

Ogre::Vector3::Vector3 | ( | const int | afCoordinate[3] | ) |

explicit

Definition at line 77 of file OgreVector3.h.

## Vector3() [5/6]

Ogre::Vector3::Vector3 | ( | Real *const | r | ) |

explicit

Definition at line 84 of file OgreVector3.h.

## Vector3() [6/6]

Ogre::Vector3::Vector3 | ( | const Real | scaler | ) |

explicit

Definition at line 89 of file OgreVector3.h.

## Member Function Documentation

## absDotProduct()

Real Ogre::Vector3::absDotProduct | ( | const Vector3 & | vec | ) | const

Calculates the absolute dot (scalar) product of this vector with another.

Remarks
  This function work similar dotProduct, except it use absolute value of each component of the vector to computing.

Parameters

  vec | Vector with which to calculate the absolute dot product (together with this one).

Returns
  A Real representing the absolute dot product value.

Definition at line 432 of file OgreVector3.h.

References Ogre::Math::Abs(), x, y, and z.

## angleBetween()

Radian Ogre::Vector3::angleBetween | ( | const Vector3 & | dest | ) | const

Gets the angle between 2 vectors.

Remarks
  Vectors do not have to be unit-length but must represent directions.

Definition at line 633 of file OgreVector3.h.

References Ogre::Math::ACos(), Ogre::Math::Clamp(), and length().

## crossProduct()

Vector3 Ogre::Vector3::crossProduct | ( | const Vector3 & | rkVector | ) | const

Calculates the cross-product of 2 vectors, i.e.

the vector that lies perpendicular to them both.

Remarks
  The cross-product is normally used to calculate the normal vector of a plane, by calculating the cross-product of 2 non-equivalent vectors which lie on the plane (e.g. 2 edges of a triangle).

Parameters

  rkVector | Vector which, together with this one, will be used to calculate the cross-product.

Returns
  A vector which is the result of the cross-product. This vector will NOT be normalised, to maximise efficiency
  - call Vector3::normalise on the result if you wish this to be done. As for which side the resultant vector will be on, the returned vector will be on the side from which the arc from 'this' to rkVector is anticlockwise, e.g. UNIT_Y.crossProduct(UNIT_Z) = UNIT_X, whilst UNIT_Z.crossProduct(UNIT_Y) = -UNIT_X. This is because OGRE uses a right-handed coordinate system.

  For a clearer explanation, look a the left and the bottom edges of your monitor's screen. Assume that the first vector is the left edge and the second vector is the bottom edge, both of them starting from the lower-left corner of the screen. The resulting vector is going to be perpendicular to both of them and will go inside the screen, towards the cathode tube (assuming you're using a CRT monitor, of course).

Definition at line 492 of file OgreVector3.h.

References x, y, and z.

Referenced by getRotationTo().

## directionEquals()

bool Ogre::Vector3::directionEquals | ( | const Vector3 & | rhs,
|  | const Radian & | tolerance
| ) |  | const

Returns whether this vector is within a directional tolerance of another vector.

Parameters

  rhs | The vector to compare with
  tolerance | The maximum angle by which the vectors may vary and still be considered equal

Note
  Both vectors should be normalised.

Definition at line 763 of file OgreVector3.h.

References Ogre::Math::Abs(), Ogre::Math::ACos(), and Ogre::Radian::valueRadians().

## distance()

Real Ogre::Vector3::distance | ( | const Vector3 & | rhs | ) | const

Returns the distance to another vector.

Warning
  This operation requires a square root and is expensive in terms of CPU operations. If you don't need to know the exact distance (e.g. for just comparing distances) use squaredDistance() instead.

Definition at line 383 of file OgreVector3.h.

## dotProduct()

Real Ogre::Vector3::dotProduct | ( | const Vector3 & | vec | ) | const

Calculates the dot (scalar) product of this vector with another.

Remarks
  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.

Definition at line 417 of file OgreVector3.h.

References x, y, and z.

Referenced by getRotationTo().

## getRotationTo()

Quaternion Ogre::Vector3::getRotationTo | ( | const Vector3 & | dest,
|  | const Vector3 & | fallbackAxis = `Vector3::ZERO`
| ) |  | const

Gets the shortest arc quaternion to rotate this vector to the destination vector.

Remarks
  If you call this with a dest vector that is close to the inverse of this vector, we will rotate 180 degrees around the 'fallbackAxis' (if specified, or a generated axis if not) since in this case ANY axis of rotation is valid.

Definition at line 655 of file OgreVector3.h.

References crossProduct(), dotProduct(), Ogre::Quaternion::FromAngleAxis(), Ogre::Quaternion::IDENTITY, isZeroLength(), Ogre::Quaternion::normalise(), normalise(), Ogre::Math::PI, Ogre::Math::Sqrt(), UNIT_X, UNIT_Y, Ogre::Quaternion::w, x, Ogre::Quaternion::x, y, Ogre::Quaternion::y, z, Ogre::Quaternion::z, and ZERO.

## isNaN()

bool Ogre::Vector3::isNaN | ( |  | ) | const

Check whether this vector contains valid values.

Definition at line 774 of file OgreVector3.h.

References Ogre::Math::isNaN().

## isZeroLength()

bool Ogre::Vector3::isZeroLength | ( | void |  | ) | const

Returns true if this vector is zero length.

Definition at line 706 of file OgreVector3.h.

Referenced by getRotationTo().

## length()

Real Ogre::Vector3::length | ( |  | ) | const

Returns the length (magnitude) of the vector.

Warning
  This operation requires a square root and is expensive in terms of CPU operations. If you don't need to know the exact length (e.g. for just comparing lengths) use squaredLength() instead.

Definition at line 356 of file OgreVector3.h.

References Ogre::Math::Sqrt().

Referenced by angleBetween().

## makeCeil()

void Ogre::Vector3::makeCeil | ( | const Vector3 & | cmp | ) |

Sets this vector's components to the maximum of its own and the ones of the passed in vector.

Remarks
  '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.

Definition at line 552 of file OgreVector3.h.

References x, y, and z.

Referenced by Ogre::AxisAlignedBox::intersection(), and Ogre::AxisAlignedBox::merge().

## makeFloor()

void Ogre::Vector3::makeFloor | ( | const Vector3 & | cmp | ) |

Sets this vector's components to the minimum of its own and the ones of the passed in vector.

Remarks
  '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.

Definition at line 538 of file OgreVector3.h.

References x, y, and z.

Referenced by Ogre::AxisAlignedBox::intersection(), and Ogre::AxisAlignedBox::merge().

## midPoint()

Vector3 Ogre::Vector3::midPoint | ( | const Vector3 & | vec | ) | const

Returns a vector at a point half way between this and the passed in vector.

Definition at line 503 of file OgreVector3.h.

References x, y, and z.

## normalise()

Real Ogre::Vector3::normalise | ( |  | ) |

Normalises the vector.

Remarks
  This method normalises the vector such that it's length / magnitude is 1. The result is called a unit vector.

Note
  This function will not crash for zero-sized vectors, but there will be no changes made to their components.

Returns
  The previous length of the vector.

Definition at line 446 of file OgreVector3.h.

References Ogre::Math::Sqrt().

Referenced by getRotationTo(), Ogre::Volume::IsoSurfaceMC::interpolate(), normalisedCopy(), Ogre::Matrix4::operator*(), and perpendicular().

## normalisedCopy()

Vector3 Ogre::Vector3::normalisedCopy | ( | void |  | ) | const

As normalise, except that this vector is unaffected and the normalised vector is returned as a copy.

Definition at line 715 of file OgreVector3.h.

References normalise().

## operator!=()

bool Ogre::Vector3::operator!= | ( | const Vector3 & | rkVector | ) | const

Definition at line 157 of file OgreVector3.h.

References x, y, and z.

## operator*() [1/2]

Vector3 Ogre::Vector3::operator* | ( | const Real | fScalar | ) | const

Definition at line 179 of file OgreVector3.h.

## operator*() [2/2]

Vector3 Ogre::Vector3::operator* | ( | const Vector3 & | rhs | ) | const

Definition at line 187 of file OgreVector3.h.

References x, y, and z.

## operator*=() [1/2]

Vector3& Ogre::Vector3::operator*= | ( | const Real | fScalar | ) |

Definition at line 309 of file OgreVector3.h.

## operator*=() [2/2]

Vector3& Ogre::Vector3::operator*= | ( | const Vector3 & | rkVector | ) |

Definition at line 317 of file OgreVector3.h.

References x, y, and z.

## operator+() [1/2]

Vector3 Ogre::Vector3::operator+ | ( | const Vector3 & | rkVector | ) | const

Definition at line 163 of file OgreVector3.h.

References x, y, and z.

## operator+() [2/2]

const Vector3& Ogre::Vector3::operator+ | ( |  | ) | const

Definition at line 215 of file OgreVector3.h.

## operator+=() [1/2]

Vector3& Ogre::Vector3::operator+= | ( | const Vector3 & | rkVector | ) |

Definition at line 275 of file OgreVector3.h.

References x, y, and z.

## operator+=() [2/2]

Vector3& Ogre::Vector3::operator+= | ( | const Real | fScalar | ) |

Definition at line 284 of file OgreVector3.h.

## operator-() [1/2]

Vector3 Ogre::Vector3::operator- | ( | const Vector3 & | rkVector | ) | const

Definition at line 171 of file OgreVector3.h.

References x, y, and z.

## operator-() [2/2]

Vector3 Ogre::Vector3::operator- | ( |  | ) | const

Definition at line 220 of file OgreVector3.h.

## operator-=() [1/2]

Vector3& Ogre::Vector3::operator-= | ( | const Vector3 & | rkVector | ) |

Definition at line 292 of file OgreVector3.h.

References x, y, and z.

## operator-=() [2/2]

Vector3& Ogre::Vector3::operator-= | ( | const Real | fScalar | ) |

Definition at line 301 of file OgreVector3.h.

## operator/() [1/2]

Vector3 Ogre::Vector3::operator/ | ( | const Real | fScalar | ) | const

Definition at line 195 of file OgreVector3.h.

## operator/() [2/2]

Vector3 Ogre::Vector3::operator/ | ( | const Vector3 & | rhs | ) | const

Definition at line 207 of file OgreVector3.h.

References x, y, and z.

## operator/=() [1/2]

Vector3& Ogre::Vector3::operator/= | ( | const Real | fScalar | ) |

Definition at line 326 of file OgreVector3.h.

## operator/=() [2/2]

Vector3& Ogre::Vector3::operator/= | ( | const Vector3 & | rkVector | ) |

Definition at line 339 of file OgreVector3.h.

References x, y, and z.

## operator<()

bool Ogre::Vector3::operator< | ( | const Vector3 & | rhs | ) | const

Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.

Definition at line 514 of file OgreVector3.h.

References x, y, and z.

## operator=() [1/2]

Vector3& Ogre::Vector3::operator= | ( | const Vector3 & | rkVector | ) |

Assigns the value of the other vector.

Parameters

  rkVector | The other vector

Definition at line 134 of file OgreVector3.h.

References x, y, and z.

## operator=() [2/2]

Vector3& Ogre::Vector3::operator= | ( | const Real | fScaler | ) |

Definition at line 143 of file OgreVector3.h.

## operator==()

bool Ogre::Vector3::operator== | ( | const Vector3 & | rkVector | ) | const

Definition at line 152 of file OgreVector3.h.

References x, y, and z.

## operator>()

bool Ogre::Vector3::operator> | ( | const Vector3 & | rhs | ) | const

Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.

Definition at line 524 of file OgreVector3.h.

References x, y, and z.

## operator[]() [1/2]

Real Ogre::Vector3::operator[] | ( | const size_t | i | ) | const

Definition at line 106 of file OgreVector3.h.

## operator[]() [2/2]

Real& Ogre::Vector3::operator[] | ( | const size_t | i | ) |

Definition at line 113 of file OgreVector3.h.

## perpendicular()

Vector3 Ogre::Vector3::perpendicular | ( | void |  | ) | const

Generates a vector perpendicular to this vector (eg an 'up' vector).

Remarks
  This method will return a vector which is perpendicular to this vector. There are an infinite number of possibilities but this method will guarantee to generate one of them. If you need more control you should use the Quaternion class.

Definition at line 566 of file OgreVector3.h.

References normalise(), squaredLength(), UNIT_X, and UNIT_Y.

## positionCloses()

bool Ogre::Vector3::positionCloses | ( | const Vector3 & | rhs,
|  | Real | tolerance = `1e-03f`
| ) |  | const

Returns whether this vector is within a positional tolerance of another vector, also take scale of the vectors into account.

Parameters

  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

Definition at line 750 of file OgreVector3.h.

References squaredLength().

## positionEquals()

bool Ogre::Vector3::positionEquals | ( | const Vector3 & | rhs,
|  | Real | tolerance = `1e-03`
| ) |  | const

Returns whether this vector is within a positional tolerance of another vector.

Parameters

  rhs | The vector to compare with
  tolerance | The amount that each element of the vector may vary by and still be considered equal

Definition at line 736 of file OgreVector3.h.

References Ogre::Math::RealEqual(), x, y, and z.

## primaryAxis()

Vector3 Ogre::Vector3::primaryAxis | ( |  | ) | const

Extract the primary (dominant) axis from this direction vector.

Definition at line 780 of file OgreVector3.h.

References Ogre::Math::Abs(), NEGATIVE_UNIT_X, NEGATIVE_UNIT_Y, NEGATIVE_UNIT_Z, UNIT_X, UNIT_Y, and UNIT_Z.

## ptr() [1/2]

Real* Ogre::Vector3::ptr | ( |  | ) |

Pointer accessor for direct copying.

Definition at line 120 of file OgreVector3.h.

Referenced by Ogre::AnimableValue::setAsBaseValue().

## ptr() [2/2]

const Real* Ogre::Vector3::ptr | ( |  | ) | const

Pointer accessor for direct copying.

Definition at line 125 of file OgreVector3.h.

## randomDeviant()

Vector3 Ogre::Vector3::randomDeviant | ( | const Radian & | angle,
|  | const Vector3 & | up = `Vector3::ZERO`
| ) |  | const

Generates a new random vector which deviates from this vector by a given angle in a random direction.

Remarks
  This method assumes that the random number generator has already been seeded appropriately.

Parameters

  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)

Returns
  A random vector which deviates from this vector by angle. This vector will not be normalised, normalise it if you wish afterwards.

Definition at line 603 of file OgreVector3.h.

References Ogre::Quaternion::FromAngleAxis(), Ogre::Math::TWO_PI, Ogre::Math::UnitRandom(), and ZERO.

## reflect()

Vector3 Ogre::Vector3::reflect | ( | const Vector3 & | normal | ) | const

Calculates a reflection vector to the plane with the given normal .

Remarks
  NB assumes 'this' is pointing AWAY FROM the plane, invert if it is not.

Definition at line 725 of file OgreVector3.h.

## squaredDistance()

Real Ogre::Vector3::squaredDistance | ( | const Vector3 & | rhs | ) | const

Returns the square of the distance to another vector.

Remarks
  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.

Definition at line 398 of file OgreVector3.h.

## squaredLength()

Real Ogre::Vector3::squaredLength | ( |  | ) | const

Returns the square of the length(magnitude) of the vector.

Remarks
  This method is for efficiency - calculating the actual length of a vector requires a square root, which is expensive in terms of the operations required. This method returns the square of the length of the vector, i.e. the same as the length but before the square root is taken. Use this if you want to find the longest / shortest vector without incurring the square root.

Definition at line 371 of file OgreVector3.h.

Referenced by Ogre::Sphere::merge(), perpendicular(), positionCloses(), and Ogre::AxisAlignedBox::squaredDistance().

## swap()

void Ogre::Vector3::swap | ( | Vector3 & | other | ) |

Exchange the contents of this vector with another.

Definition at line 99 of file OgreVector3.h.

References std::swap(), x, y, and z.

## Friends And Related Function Documentation

## operator*

Vector3 operator* | ( | const Real | fScalar,
|  | const Vector3 & | rkVector
| ) |  |

friend

Definition at line 226 of file OgreVector3.h.

## operator+ [1/2]

Vector3 operator+ | ( | const Vector3 & | lhs,
|  | const Real | rhs
| ) |  |

friend

Definition at line 242 of file OgreVector3.h.

## operator+ [2/2]

Vector3 operator+ | ( | const Real | lhs,
|  | const Vector3 & | rhs
| ) |  |

friend

Definition at line 250 of file OgreVector3.h.

## operator- [1/2]

Vector3 operator- | ( | const Vector3 & | lhs,
|  | const Real | rhs
| ) |  |

friend

Definition at line 258 of file OgreVector3.h.

## operator- [2/2]

Vector3 operator- | ( | const Real | lhs,
|  | const Vector3 & | rhs
| ) |  |

friend

Definition at line 266 of file OgreVector3.h.

## operator/

Vector3 operator/ | ( | const Real | fScalar,
|  | const Vector3 & | rkVector
| ) |  |

friend

Definition at line 234 of file OgreVector3.h.

## operator<<

_OgreExport friend std::ostream& operator<< | ( | std::ostream & | o,
|  | const Vector3 & | v
| ) |  |

friend

Function for writing to a stream.

Definition at line 812 of file OgreVector3.h.

## Member Data Documentation

## NEGATIVE_UNIT_X

const Vector3 Ogre::Vector3::NEGATIVE_UNIT_X

static

Definition at line 804 of file OgreVector3.h.

Referenced by primaryAxis().

## NEGATIVE_UNIT_Y

const Vector3 Ogre::Vector3::NEGATIVE_UNIT_Y

static

Definition at line 805 of file OgreVector3.h.

Referenced by primaryAxis().

## NEGATIVE_UNIT_Z

const Vector3 Ogre::Vector3::NEGATIVE_UNIT_Z

static

Definition at line 806 of file OgreVector3.h.

Referenced by Ogre::SceneNode::getCreator(), and primaryAxis().

## UNIT_SCALE

const Vector3 Ogre::Vector3::UNIT_SCALE

static

Definition at line 807 of file OgreVector3.h.

Referenced by Ogre::StaticGeometry::getName(), and Ogre::InstancedGeometry::getName().

## UNIT_X

const Vector3 Ogre::Vector3::UNIT_X

static

Definition at line 801 of file OgreVector3.h.

Referenced by Ogre::BillboardChain::getDynamic(), getRotationTo(), perpendicular(), and primaryAxis().

## UNIT_Y

const Vector3 Ogre::Vector3::UNIT_Y

static

Definition at line 802 of file OgreVector3.h.

Referenced by Ogre::SceneNode::getCreator(), getRotationTo(), perpendicular(), and primaryAxis().

## UNIT_Z

const Vector3 Ogre::Vector3::UNIT_Z

static

Definition at line 803 of file OgreVector3.h.

Referenced by primaryAxis().

## x

Real Ogre::Vector3::x

Definition at line 54 of file OgreVector3.h.

Referenced by absDotProduct(), Ogre::Volume::DualGridGenerator::addDualCell(), Ogre::Volume::MeshBuilder::addVertex(), Ogre::AxisAlignedBox::contains(), crossProduct(), Ogre::Volume::CSGCubeSource::distanceTo(), Ogre::Volume::SimplexNoise::dot(), dotProduct(), Ogre::AxisAlignedBox::getAllCorners(), Ogre::AxisAlignedBox::getCenter(), Ogre::Volume::OctreeNode::getCenterBack(), Ogre::Volume::OctreeNode::getCenterBackBottom(), Ogre::Volume::OctreeNode::getCenterBackLeft(), Ogre::Volume::OctreeNode::getCenterBackRight(), Ogre::Volume::OctreeNode::getCenterBackTop(), Ogre::Volume::OctreeNode::getCenterBottom(), Ogre::Volume::OctreeNode::getCenterFront(), Ogre::Volume::OctreeNode::getCenterFrontBottom(), Ogre::Volume::OctreeNode::getCenterFrontLeft(), Ogre::Volume::OctreeNode::getCenterFrontRight(), Ogre::Volume::OctreeNode::getCenterFrontTop(), Ogre::Volume::OctreeNode::getCenterLeft(), Ogre::Volume::OctreeNode::getCenterLeftBottom(), Ogre::Volume::OctreeNode::getCenterLeftTop(), Ogre::Volume::OctreeNode::getCenterRight(), Ogre::Volume::OctreeNode::getCenterRightBottom(), Ogre::Volume::OctreeNode::getCenterRightTop(), Ogre::Volume::OctreeNode::getCenterTop(), Ogre::Volume::OctreeNode::getChildrenDimensions(), Ogre::AxisAlignedBox::getCorner(), Ogre::Volume::OctreeNode::getCorner1(), Ogre::Volume::OctreeNode::getCorner2(), Ogre::Volume::OctreeNode::getCorner3(), Ogre::Volume::OctreeNode::getCorner4(), Ogre::Volume::OctreeNode::getCorner5(), Ogre::Volume::OctreeNode::getCorner7(), Ogre::Volume::CSGNoiseSource::getInternalValue(), getRotationTo(), Ogre::Matrix4::getScale(), Ogre::Matrix4::getTrans(), Ogre::Volume::IsoSurfaceMC::interpolate(), Ogre::Volume::OctreeNodeSplitPolicy::interpolate(), Ogre::AxisAlignedBox::intersection(), Ogre::AxisAlignedBox::intersects(), Ogre::Volume::OctreeNode::isBorderLeft(), Ogre::Volume::OctreeNode::isBorderRight(), makeCeil(), makeFloor(), Ogre::Matrix4::makeTrans(), midPoint(), operator!=(), Ogre::EdgeListBuilder::vectorLess::operator()(), operator*(), Ogre::Matrix4::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator=(), Ogre::Vector4::operator=(), operator==(), operator>(), positionEquals(), Ogre::AxisAlignedBox::setExtents(), Ogre::AxisAlignedBox::setMaximum(), Ogre::AxisAlignedBox::setMaximumX(), Ogre::AxisAlignedBox::setMinimum(), Ogre::AxisAlignedBox::setMinimumX(), Ogre::Matrix4::setScale(), Ogre::Matrix4::setTrans(), Ogre::AxisAlignedBox::squaredDistance(), swap(), Ogre::AxisAlignedBox::transform(), Ogre::AxisAlignedBox::transformAffine(), Ogre::Matrix4::transformAffine(), and Ogre::AxisAlignedBox::volume().

## y

Real Ogre::Vector3::y

Definition at line 54 of file OgreVector3.h.

Referenced by absDotProduct(), Ogre::Volume::DualGridGenerator::addDualCell(), Ogre::Volume::MeshBuilder::addVertex(), Ogre::AxisAlignedBox::contains(), crossProduct(), Ogre::Volume::CSGCubeSource::distanceTo(), Ogre::Volume::SimplexNoise::dot(), dotProduct(), Ogre::AxisAlignedBox::getAllCorners(), Ogre::AxisAlignedBox::getCenter(), Ogre::Volume::OctreeNode::getCenterBack(), Ogre::Volume::OctreeNode::getCenterBackBottom(), Ogre::Volume::OctreeNode::getCenterBackLeft(), Ogre::Volume::OctreeNode::getCenterBackRight(), Ogre::Volume::OctreeNode::getCenterBackTop(), Ogre::Volume::OctreeNode::getCenterBottom(), Ogre::Volume::OctreeNode::getCenterFront(), Ogre::Volume::OctreeNode::getCenterFrontBottom(), Ogre::Volume::OctreeNode::getCenterFrontLeft(), Ogre::Volume::OctreeNode::getCenterFrontRight(), Ogre::Volume::OctreeNode::getCenterFrontTop(), Ogre::Volume::OctreeNode::getCenterLeft(), Ogre::Volume::OctreeNode::getCenterLeftBottom(), Ogre::Volume::OctreeNode::getCenterLeftTop(), Ogre::Volume::OctreeNode::getCenterRight(), Ogre::Volume::OctreeNode::getCenterRightBottom(), Ogre::Volume::OctreeNode::getCenterRightTop(), Ogre::Volume::OctreeNode::getCenterTop(), Ogre::Volume::OctreeNode::getChildrenDimensions(), Ogre::AxisAlignedBox::getCorner(), Ogre::Volume::OctreeNode::getCorner1(), Ogre::Volume::OctreeNode::getCorner2(), Ogre::Volume::OctreeNode::getCorner3(), Ogre::Volume::OctreeNode::getCorner4(), Ogre::Volume::OctreeNode::getCorner5(), Ogre::Volume::OctreeNode::getCorner7(), Ogre::Volume::CSGNoiseSource::getInternalValue(), getRotationTo(), Ogre::Matrix4::getScale(), Ogre::Matrix4::getTrans(), Ogre::Volume::IsoSurfaceMC::interpolate(), Ogre::Volume::OctreeNodeSplitPolicy::interpolate(), Ogre::AxisAlignedBox::intersection(), Ogre::AxisAlignedBox::intersects(), Ogre::Volume::OctreeNode::isBorderBottom(), Ogre::Volume::OctreeNode::isBorderTop(), makeCeil(), makeFloor(), Ogre::Matrix4::makeTrans(), midPoint(), operator!=(), Ogre::EdgeListBuilder::vectorLess::operator()(), operator*(), Ogre::Matrix4::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator=(), Ogre::Vector4::operator=(), operator==(), operator>(), positionEquals(), Ogre::AxisAlignedBox::setExtents(), Ogre::AxisAlignedBox::setMaximum(), Ogre::AxisAlignedBox::setMaximumY(), Ogre::AxisAlignedBox::setMinimum(), Ogre::AxisAlignedBox::setMinimumY(), Ogre::Matrix4::setScale(), Ogre::Matrix4::setTrans(), Ogre::AxisAlignedBox::squaredDistance(), swap(), Ogre::AxisAlignedBox::transform(), Ogre::AxisAlignedBox::transformAffine(), Ogre::Matrix4::transformAffine(), and Ogre::AxisAlignedBox::volume().

## z

Real Ogre::Vector3::z

Definition at line 54 of file OgreVector3.h.

Referenced by absDotProduct(), Ogre::Volume::DualGridGenerator::addDualCell(), Ogre::Volume::MeshBuilder::addVertex(), Ogre::AxisAlignedBox::contains(), crossProduct(), Ogre::Volume::CSGCubeSource::distanceTo(), Ogre::Volume::SimplexNoise::dot(), dotProduct(), Ogre::AxisAlignedBox::getAllCorners(), Ogre::AxisAlignedBox::getCenter(), Ogre::Volume::OctreeNode::getCenterBack(), Ogre::Volume::OctreeNode::getCenterBackBottom(), Ogre::Volume::OctreeNode::getCenterBackLeft(), Ogre::Volume::OctreeNode::getCenterBackRight(), Ogre::Volume::OctreeNode::getCenterBackTop(), Ogre::Volume::OctreeNode::getCenterBottom(), Ogre::Volume::OctreeNode::getCenterFront(), Ogre::Volume::OctreeNode::getCenterFrontBottom(), Ogre::Volume::OctreeNode::getCenterFrontLeft(), Ogre::Volume::OctreeNode::getCenterFrontRight(), Ogre::Volume::OctreeNode::getCenterFrontTop(), Ogre::Volume::OctreeNode::getCenterLeft(), Ogre::Volume::OctreeNode::getCenterLeftBottom(), Ogre::Volume::OctreeNode::getCenterLeftTop(), Ogre::Volume::OctreeNode::getCenterRight(), Ogre::Volume::OctreeNode::getCenterRightBottom(), Ogre::Volume::OctreeNode::getCenterRightTop(), Ogre::Volume::OctreeNode::getCenterTop(), Ogre::Volume::OctreeNode::getChildrenDimensions(), Ogre::AxisAlignedBox::getCorner(), Ogre::Volume::OctreeNode::getCorner1(), Ogre::Volume::OctreeNode::getCorner2(), Ogre::Volume::OctreeNode::getCorner3(), Ogre::Volume::OctreeNode::getCorner4(), Ogre::Volume::OctreeNode::getCorner5(), Ogre::Volume::OctreeNode::getCorner7(), Ogre::Volume::CSGNoiseSource::getInternalValue(), getRotationTo(), Ogre::Matrix4::getScale(), Ogre::Matrix4::getTrans(), Ogre::Volume::IsoSurfaceMC::interpolate(), Ogre::Volume::OctreeNodeSplitPolicy::interpolate(), Ogre::AxisAlignedBox::intersection(), Ogre::AxisAlignedBox::intersects(), Ogre::Volume::OctreeNode::isBorderBack(), Ogre::Volume::OctreeNode::isBorderFront(), makeCeil(), makeFloor(), Ogre::Matrix4::makeTrans(), midPoint(), operator!=(), Ogre::EdgeListBuilder::vectorLess::operator()(), operator*(), Ogre::Matrix4::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator=(), Ogre::Vector4::operator=(), operator==(), operator>(), positionEquals(), Ogre::AxisAlignedBox::setExtents(), Ogre::AxisAlignedBox::setMaximum(), Ogre::AxisAlignedBox::setMaximumZ(), Ogre::AxisAlignedBox::setMinimum(), Ogre::AxisAlignedBox::setMinimumZ(), Ogre::Matrix4::setScale(), Ogre::Matrix4::setTrans(), Ogre::AxisAlignedBox::squaredDistance(), swap(), Ogre::AxisAlignedBox::transform(), Ogre::AxisAlignedBox::transformAffine(), Ogre::Matrix4::transformAffine(), and Ogre::AxisAlignedBox::volume().

## ZERO

const Vector3 Ogre::Vector3::ZERO

static

Definition at line 800 of file OgreVector3.h.

Referenced by Ogre::InstancedEntity::_getDerivedPosition(), Ogre::Volume::OctreeNode::getChildrenDimensions(), Ogre::SceneNode::getCreator(), Ogre::Entity::getCurrentLodIndex(), Ogre::AxisAlignedBox::getHalfSize(), getRotationTo(), Ogre::AxisAlignedBox::getSize(), Ogre::StringConverter::parseAngle(), and randomDeviant().

The documentation for this class was generated from the following file:

- OgreVector3.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.