OGRE 14.4
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::VectorBase< 2, Real > Struct Reference

#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).
Realptr ()
const Realptr () 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 Vector2NEGATIVE_UNIT_X
static const Vector2NEGATIVE_UNIT_Y
static const Vector2UNIT_SCALE
static const Vector2UNIT_X
static const Vector2UNIT_Y
static const Vector2ZERO

Constructor & Destructor Documentation

◆ VectorBase() [1/2]

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

◆ 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

◆ y

◆ 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: