OGRE: Ogre::VectorBase< 2, Real > Struct Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::VectorBase< 2, Real > Struct Reference
Core » Math

`#include <OgreVector.h>`

## Public Member Functions
| VectorBase ()
constexpr | VectorBase (Real _x, Real _y)
Radian | angleTo (const Vector2 &other) const
| Gets the oriented angle between 2 vectors.
Real | crossProduct (const VectorBase &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.
Vector2 | midPoint (const Vector2 &vec) const
| Returns a vector at a point half way between this and the passed in vector.
Vector2 | perpendicular (void) const
| Generates a vector perpendicular to this vector (eg an 'up' vector).
Real * | ptr ()
const Real * | ptr () const
Vector2 | randomDeviant (Radian angle) const
| Generates a new random vector which deviates from this vector by a given angle in a random direction.

## Public Attributes
Real | data [dims]
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

## Constructor & Destructor Documentation

## ◆ VectorBase() [1/2]

Ogre::VectorBase< 2, Real >::VectorBase | ( |  | ) |
| inline

Referenced by angleTo(), crossProduct(), midPoint(), perpendicular(), and randomDeviant().

## ◆ VectorBase() [2/2]

Ogre::VectorBase< 2, Real >::VectorBase | ( | Real | _x,
|  | Real | _y )
| inlineconstexpr

References x, and y.

## Member Function Documentation

## ◆ ptr() [1/2]

Real * Ogre::VectorBase< 2, Real >::ptr | ( |  | ) |
| inline

References x.

## ◆ ptr() [2/2]

const Real * Ogre::VectorBase< 2, Real >::ptr | ( |  | ) | const
| inline

References x.

## ◆ crossProduct()

Real Ogre::VectorBase< 2, Real >::crossProduct | ( | const VectorBase< 2, Real > & | rkVector | ) | const
| inline

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.

References VectorBase(), x, and y.

Referenced by angleTo().

## Member Data Documentation

## ◆ x

Real Ogre::VectorBase< 2, Real >::x

Referenced by VectorBase(), crossProduct(), midPoint(), perpendicular(), ptr(), ptr(), and randomDeviant().

## ◆ y

Real Ogre::VectorBase< 2, Real >::y

Referenced by VectorBase(), crossProduct(), midPoint(), perpendicular(), and randomDeviant().

## ◆ ZERO

const Vector2& Ogre::VectorBase< 2, Real >::ZERO
| static

## ◆ UNIT_X

const Vector2& Ogre::VectorBase< 2, Real >::UNIT_X
| static

## ◆ UNIT_Y

const Vector2& Ogre::VectorBase< 2, Real >::UNIT_Y
| static

## ◆ NEGATIVE_UNIT_X

const Vector2& Ogre::VectorBase< 2, Real >::NEGATIVE_UNIT_X
| static

## ◆ NEGATIVE_UNIT_Y

const Vector2& Ogre::VectorBase< 2, Real >::NEGATIVE_UNIT_Y
| static

## ◆ UNIT_SCALE

const Vector2& Ogre::VectorBase< 2, Real >::UNIT_SCALE
| static

## ◆ data

Real Ogre::VectorBase< dims, Real >::data[dims]

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

- OgreVector.h