OGRE  2.2.4
Object-Oriented Graphics Rendering Engine
Ogre::Vector4 Class Reference

4-dimensional homogeneous vector. More...

#include <OgreVector4.h>

Public Member Functions

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

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 Vector4 &lhs, const Real rhs)
 
Vector4 operator+ (const Real lhs, const Vector4 &rhs)
 
Vector4 operator- (const Vector4 &lhs, Real rhs)
 
Vector4 operator- (const Real lhs, const Vector4 &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. More...
 

Detailed Description

4-dimensional homogeneous vector.

Constructor & Destructor Documentation

◆ Vector4() [1/8]

Ogre::Vector4::Vector4 ( )
inline

Default constructor.

Note
It does NOT initialize the vector for efficiency.

◆ Vector4() [2/8]

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

◆ Vector4() [3/8]

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

◆ Vector4() [4/8]

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

◆ Vector4() [5/8]

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

◆ Vector4() [6/8]

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

◆ Vector4() [7/8]

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

◆ Vector4() [8/8]

Ogre::Vector4::Vector4 ( const Vector3 rhs,
float  fW 
)
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.

References w, x, y, and z.

◆ isNaN()

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

Check whether this vector contains valid values.

References Ogre::Math::isNaN(), and Ogre::RTShader::operator<<().

◆ operator!=()

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

References w, x, y, and z.

◆ operator*() [1/2]

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

◆ operator*() [2/2]

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

References w, x, y, and z.

◆ operator*=() [1/2]

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

◆ operator*=() [2/2]

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

References w, x, y, and z.

◆ operator+() [1/2]

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

References w, x, y, and z.

◆ operator+() [2/2]

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

◆ operator+=() [1/2]

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

References w, x, y, and z.

◆ operator+=() [2/2]

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

◆ operator-() [1/2]

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

References w, x, y, and z.

◆ operator-() [2/2]

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

◆ operator-=() [1/2]

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

References w, x, y, and z.

◆ operator-=() [2/2]

Vector4& Ogre::Vector4::operator-= ( const Real  fScalar)
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

References w, x, y, and z.

◆ operator/=() [1/2]

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

◆ operator/=() [2/2]

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

References w, x, y, and z.

◆ operator=() [1/3]

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

Assigns the value of the other vector.

Parameters
rkVectorThe other vector

References w, x, y, and z.

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

◆ operator==()

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

References w, x, y, and z.

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

Real& Ogre::Vector4::operator[] ( const size_t  i)
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 Function Documentation

◆ operator*

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

◆ operator+ [1/2]

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

◆ operator+ [2/2]

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

◆ operator- [1/2]

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

◆ operator- [2/2]

Vector4 operator- ( const Real  lhs,
const Vector4 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

◆ x

◆ y

◆ z

◆ ZERO


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