OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::Vector4 Class Reference

4-dimensional homogeneous vector. More...

#include <OgreVector4.h>

Public Member Functions

 Vector4 ()
 Default constructor.
 
 Vector4 (const int afCoordinate[4])
 
 Vector4 (const Real afCoordinate[4])
 
 Vector4 (const Real fX, const Real fY, const Real fZ, const Real fW)
 
 Vector4 (const Real scaler)
 
 Vector4 (const Vector3 &rhs)
 
 Vector4 (Real *const r)
 
Real dotProduct (const Vector4 &vec) const
 Calculates the dot (scalar) product of this vector with another.
 
bool isNaN () const
 Check whether this vector contains valid values.
 
bool operator!= (const Vector4 &rkVector) const
 
Vector4 operator* (const Real fScalar) const
 
Vector4 operator* (const Vector4 &rhs) const
 
Vector4operator*= (const Real fScalar)
 
Vector4operator*= (const Vector4 &rkVector)
 
const Vector4operator+ () const
 
Vector4 operator+ (const Vector4 &rkVector) const
 
Vector4operator+= (const Real fScalar)
 
Vector4operator+= (const Vector4 &rkVector)
 
Vector4 operator- () const
 
Vector4 operator- (const Vector4 &rkVector) const
 
Vector4operator-= (const Real fScalar)
 
Vector4operator-= (const Vector4 &rkVector)
 
Vector4 operator/ (const Real fScalar) const
 
Vector4 operator/ (const Vector4 &rhs) const
 
Vector4operator/= (const Real fScalar)
 
Vector4operator/= (const Vector4 &rkVector)
 
Vector4operator= (const Real fScalar)
 
Vector4operator= (const Vector3 &rhs)
 
Vector4operator= (const Vector4 &rkVector)
 Assigns the value of the other vector.
 
bool operator== (const Vector4 &rkVector) const
 
Realoperator[] (const size_t i)
 
Real operator[] (const size_t i) const
 
Realptr ()
 Pointer accessor for direct copying.
 
const Realptr () const
 Pointer accessor for direct copying.
 
void swap (Vector4 &other)
 Exchange the contents of this vector with another.
 
Vector2 xy () const
 
Vector3 xyz () const
 Swizzle-like narrowing operations.
 

Public Attributes

Real w
 
Real x
 
Real y
 
Real z
 

Static Public Attributes

static const Vector4 ZERO
 

Friends

Vector4 operator* (const Real fScalar, const Vector4 &rkVector)
 
Vector4 operator+ (const Real lhs, const Vector4 &rhs)
 
Vector4 operator+ (const Vector4 &lhs, const Real rhs)
 
Vector4 operator- (const Real lhs, const Vector4 &rhs)
 
Vector4 operator- (const Vector4 &lhs, Real rhs)
 
Vector4 operator/ (const Real fScalar, const Vector4 &rkVector)
 
_OgreExport friend std::ostream & operator<< (std::ostream &o, const Vector4 &v)
 Function for writing to a stream.
 

Detailed Description

4-dimensional homogeneous vector.

Constructor & Destructor Documentation

◆ Vector4() [1/7]

Ogre::Vector4::Vector4 ( )
inline

Default constructor.

Note
It does NOT initialize the vector for efficiency.

◆ Vector4() [2/7]

Ogre::Vector4::Vector4 ( const Real  fX,
const Real  fY,
const Real  fZ,
const Real  fW 
)
inline

◆ Vector4() [3/7]

Ogre::Vector4::Vector4 ( const Real  afCoordinate[4])
inlineexplicit

◆ Vector4() [4/7]

Ogre::Vector4::Vector4 ( const int  afCoordinate[4])
inlineexplicit

◆ Vector4() [5/7]

Ogre::Vector4::Vector4 ( Real *const  r)
inlineexplicit

◆ Vector4() [6/7]

Ogre::Vector4::Vector4 ( const Real  scaler)
inlineexplicit

◆ Vector4() [7/7]

Ogre::Vector4::Vector4 ( const Vector3 rhs)
inlineexplicit

Member Function Documentation

◆ dotProduct()

Real Ogre::Vector4::dotProduct ( const Vector4 vec) const
inline

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

Parameters
vecVector with which to calculate the dot product (together with this one).
Returns
A float representing the dot product value.

◆ isNaN()

bool Ogre::Vector4::isNaN ( ) const
inline

Check whether this vector contains valid values.

References Ogre::Math::isNaN().

◆ operator!=()

bool Ogre::Vector4::operator!= ( const Vector4 rkVector) const
inline

◆ operator*() [1/2]

Vector4 Ogre::Vector4::operator* ( const Real  fScalar) const
inline

◆ operator*() [2/2]

Vector4 Ogre::Vector4::operator* ( const Vector4 rhs) const
inline

◆ operator*=() [1/2]

Vector4 & Ogre::Vector4::operator*= ( const Real  fScalar)
inline

◆ operator*=() [2/2]

Vector4 & Ogre::Vector4::operator*= ( const Vector4 rkVector)
inline

◆ operator+() [1/2]

const Vector4 & Ogre::Vector4::operator+ ( ) const
inline

◆ operator+() [2/2]

Vector4 Ogre::Vector4::operator+ ( const Vector4 rkVector) const
inline

◆ operator+=() [1/2]

Vector4 & Ogre::Vector4::operator+= ( const Real  fScalar)
inline

◆ operator+=() [2/2]

Vector4 & Ogre::Vector4::operator+= ( const Vector4 rkVector)
inline

◆ operator-() [1/2]

Vector4 Ogre::Vector4::operator- ( ) const
inline

◆ operator-() [2/2]

Vector4 Ogre::Vector4::operator- ( const Vector4 rkVector) const
inline

◆ operator-=() [1/2]

Vector4 & Ogre::Vector4::operator-= ( const Real  fScalar)
inline

◆ operator-=() [2/2]

Vector4 & Ogre::Vector4::operator-= ( const Vector4 rkVector)
inline

◆ operator/() [1/2]

Vector4 Ogre::Vector4::operator/ ( const Real  fScalar) const
inline

◆ operator/() [2/2]

Vector4 Ogre::Vector4::operator/ ( const Vector4 rhs) const
inline

◆ operator/=() [1/2]

Vector4 & Ogre::Vector4::operator/= ( const Real  fScalar)
inline

◆ operator/=() [2/2]

Vector4 & Ogre::Vector4::operator/= ( const Vector4 rkVector)
inline

◆ operator=() [1/3]

Vector4 & Ogre::Vector4::operator= ( const Real  fScalar)
inline

◆ operator=() [2/3]

Vector4 & Ogre::Vector4::operator= ( const Vector3 rhs)
inline

◆ operator=() [3/3]

Vector4 & Ogre::Vector4::operator= ( const Vector4 rkVector)
inline

Assigns the value of the other vector.

Parameters
rkVectorThe other vector

◆ operator==()

bool Ogre::Vector4::operator== ( const Vector4 rkVector) const
inline

◆ operator[]() [1/2]

Real & Ogre::Vector4::operator[] ( const size_t  i)
inline

◆ operator[]() [2/2]

Real Ogre::Vector4::operator[] ( const size_t  i) const
inline

◆ ptr() [1/2]

Real * Ogre::Vector4::ptr ( )
inline

Pointer accessor for direct copying.

◆ ptr() [2/2]

const Real * Ogre::Vector4::ptr ( ) const
inline

Pointer accessor for direct copying.

◆ swap()

void Ogre::Vector4::swap ( Vector4 other)
inline

Exchange the contents of this vector with another.

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

◆ xy()

Vector2 Ogre::Vector4::xy ( ) const
inline

◆ xyz()

Vector3 Ogre::Vector4::xyz ( ) const
inline

Swizzle-like narrowing operations.

Friends And Related Symbol Documentation

◆ operator*

Vector4 operator* ( const Real  fScalar,
const Vector4 rkVector 
)
friend

◆ operator+ [1/2]

Vector4 operator+ ( const Real  lhs,
const Vector4 rhs 
)
friend

◆ operator+ [2/2]

Vector4 operator+ ( const Vector4 lhs,
const Real  rhs 
)
friend

◆ operator- [1/2]

Vector4 operator- ( const Real  lhs,
const Vector4 rhs 
)
friend

◆ operator- [2/2]

Vector4 operator- ( const Vector4 lhs,
Real  rhs 
)
friend

◆ operator/

Vector4 operator/ ( const Real  fScalar,
const Vector4 rkVector 
)
friend

◆ operator<<

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

Function for writing to a stream.

Member Data Documentation

◆ w

Real Ogre::Vector4::w

◆ x

Real Ogre::Vector4::x

Referenced by swap().

◆ y

Real Ogre::Vector4::y

Referenced by swap().

◆ z

Real Ogre::Vector4::z

Referenced by swap().

◆ ZERO

const Vector4 Ogre::Vector4::ZERO
static

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