OGRE-Next: Ogre::Vector4 Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::Vector4 Class Reference
Core » Math

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

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

Referenced by dotProduct(), operator!=(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator<<, operator=(), operator=(), operator==(), and swap().

## ◆ Vector4() [2/8]

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

References w, x, y, and z.

## ◆ Vector4() [3/8]

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

References w, x, y, and z.

## ◆ Vector4() [4/8]

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

References w, x, y, and z.

## ◆ Vector4() [5/8]

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

References w, x, y, and z.

## ◆ Vector4() [6/8]

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

References w, x, y, and z.

## ◆ Vector4() [7/8]

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

References w, x, y, and z.

## ◆ Vector4() [8/8]

Ogre::Vector4::Vector4 | ( | const Vector3 & | rhs,
|  | float | fW )
| inlineexplicit

References w, x, y, and z.

## Member Function Documentation

## ◆ 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 Vector4(), w, x, y, and z.

## ◆ isNaN()

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

Check whether this vector contains valid values.

References Ogre::Math::isNaN(), w, x, y, and z.

## ◆ operator!=()

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4().

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, x, y, and z.

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

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

References Vector4(), w, Ogre::Vector3::x, x, Ogre::Vector3::y, y, Ogre::Vector3::z, and z.

## ◆ operator==()

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

References Vector4(), w, x, y, and z.

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

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

References x.

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

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

References x.

## ◆ ptr() [1/2]

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

Pointer accessor for direct copying.

References x.

## ◆ ptr() [2/2]

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

Pointer accessor for direct copying.

References x.

## ◆ swap()

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

Exchange the contents of this vector with another.

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

## ◆ xy()

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

References x, and y.

## ◆ xyz()

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

Swizzle-like narrowing operations.

References x, y, and z.

## Member Data Documentation

## ◆ w

Real Ogre::Vector4::w

Referenced by Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), dotProduct(), Ogre::ColourValue::fromVector4(), isNaN(), operator!=(), Ogre::Matrix4::operator*(), Ogre::Matrix4::operator*(), Ogre::operator*(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator=(), operator=(), operator==(), swap(), and Ogre::Matrix4::transformAffine().

## ◆ x

Real Ogre::Vector4::x

Referenced by Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), dotProduct(), Ogre::ColourValue::fromVector4(), isNaN(), operator!=(), Ogre::Matrix4::operator*(), Ogre::Matrix4::operator*(), Ogre::operator*(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator=(), operator=(), operator==(), operator[](), operator[](), ptr(), ptr(), swap(), Ogre::Matrix4::transformAffine(), xy(), and xyz().

## ◆ y

Real Ogre::Vector4::y

Referenced by Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), dotProduct(), Ogre::ColourValue::fromVector4(), isNaN(), operator!=(), Ogre::Matrix4::operator*(), Ogre::Matrix4::operator*(), Ogre::operator*(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator=(), operator=(), operator==(), swap(), Ogre::Matrix4::transformAffine(), xy(), and xyz().

## ◆ z

Real Ogre::Vector4::z

Referenced by Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), Vector4(), dotProduct(), Ogre::ColourValue::fromVector4(), isNaN(), operator!=(), Ogre::Matrix4::operator*(), Ogre::Matrix4::operator*(), Ogre::operator*(), operator*(), operator*, operator*(), operator*=(), operator*=(), operator+, operator+, operator+(), operator+=(), operator+=(), operator-(), operator-, operator-, operator-(), operator-=(), operator-=(), operator/(), operator/, operator/(), operator/=(), operator/=(), operator=(), operator=(), operator==(), swap(), Ogre::Matrix4::transformAffine(), and xyz().

## ◆ ZERO

const Vector4 Ogre::Vector4::ZERO
| static

Referenced by Ogre::CompositorManager2::addWorkspace(), Ogre::CompositorManager2::addWorkspace(), and Ogre::StringConverter::parseVector4().

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

- OgreVector4.h