| OGRE 1.11.1 Object-Oriented Graphics Rendering Engine

Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
Ogre::Vector4 Class Reference
Core » Math

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 (const Real scaler)
| Vector4 (const Vector3 &rhs)
| Vector4 (const Vector3 &rhs, Real 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
Vector4 & | operator*= (const Real fScalar)
Vector4 & | operator*= (const Vector4 &rkVector)
Vector4 | operator+ (const Vector4 &rkVector) const
const Vector4 & | operator+ () const
Vector4 & | operator+= (const Vector4 &rkVector)
Vector4 & | operator+= (const Real fScalar)
Vector4 | operator- (const Vector4 &rkVector) const
Vector4 | operator- () const
Vector4 & | operator-= (const Vector4 &rkVector)
Vector4 & | operator-= (const Real fScalar)
Vector4 | operator/ (const Real fScalar) const
Vector4 | operator/ (const Vector4 &rhs) const
Vector4 & | operator/= (const Real fScalar)
Vector4 & | operator/= (const Vector4 &rkVector)
bool | operator== (const Vector4 &rkVector) const
Real | operator[] (const size_t i) const
Real & | operator[] (const size_t i)
Real * | ptr ()
| Pointer accessor for direct copying. More...
const Real * | ptr () const
| Pointer accessor for direct copying. 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)
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/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] | ) |
| inline explicit

## ◆ Vector4() [4/7]

Ogre::Vector4::Vector4 | ( | const int | afCoordinate[4] | ) |
| inline explicit

## ◆ Vector4() [5/7]

Ogre::Vector4::Vector4 | ( | const Real | scaler | ) |
| inline explicit

## ◆ Vector4() [6/7]

Ogre::Vector4::Vector4 | ( | const Vector3 & | rhs | ) |
| inline explicit

## ◆ Vector4() [7/7]

Ogre::Vector4::Vector4 | ( | const Vector3 & | rhs,
|  | Real | fW
| ) |  |
| inline explicit

## Member Function Documentation

## ◆ xyz()

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

Swizzle-like narrowing operations.

## ◆ xy()

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

## ◆ 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.

## ◆ operator==()

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

References w, x, y, and z.

## ◆ operator!=()

bool Ogre::Vector4::operator!= | ( | const Vector4 & | rkVector | ) | const
| 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-() [1/2]

Vector4 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 | ) | const
| inline

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

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

References w, x, y, and z.

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

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

## ◆ 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-=() [1/2]

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

## ◆ operator-=() [2/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 Real | fScalar | ) |
| inline

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

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

References w, x, y, and z.

## ◆ dotProduct()

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

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

Parameters

  vec | Vector 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 | ( |  | ) | const
| inline

Check whether this vector contains valid values.

References Ogre::Math::isNaN().

## Friends And Related Function Documentation

## ◆ operator*

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

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

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

Function for writing to a stream.

## Member Data Documentation

## ◆ x

Real Ogre::Vector4::x

Referenced by dotProduct(), operator!=(), operator*(), Ogre::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), and operator==().

## ◆ y

Real Ogre::Vector4::y

Referenced by dotProduct(), operator!=(), operator*(), Ogre::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), and operator==().

## ◆ z

Real Ogre::Vector4::z

Referenced by dotProduct(), operator!=(), operator*(), Ogre::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), and operator==().

## ◆ w

Real Ogre::Vector4::w

Referenced by dotProduct(), Ogre::Volume::OctreeNode::isIsoSurfaceNear(), operator!=(), operator*(), Ogre::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), and operator==().

## ◆ ZERO

const Vector4 Ogre::Vector4::ZERO
| static

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

- OgreVector4.h