Urho3D::Vector4 Class Reference

Four-dimensional vector. More...

`#include <Urho3D/Math/Vector4.h>`

Collaboration diagram for Urho3D::Vector4:
[legend]

## Public Member Functions

Vector4 () noexcept
Construct a zero vector.

Vector4 (const Vector4 &vector) noexcept=default
Copy-construct from another vector.

Vector4 (const Vector3 &vector, float w) noexcept
Construct from a 3-dimensional vector and the W coordinate.

Vector4 (float x, float y, float z, float w) noexcept
Construct from coordinates.

Vector4 (const float *data) noexcept
Construct from a float array.

Vector4operator= (const Vector4 &rhs) noexcept=default
Assign from another vector.

bool operator== (const Vector4 &rhs) const
Test for equality with another vector without epsilon.

bool operator!= (const Vector4 &rhs) const
Test for inequality with another vector without epsilon.

Vector4 operator+ (const Vector4 &rhs) const

Vector4 operator- () const
Return negation.

Vector4 operator- (const Vector4 &rhs) const
Subtract a vector.

Vector4 operator* (float rhs) const
Multiply with a scalar.

Vector4 operator* (const Vector4 &rhs) const
Multiply with a vector.

Vector4 operator/ (float rhs) const
Divide by a scalar.

Vector4 operator/ (const Vector4 &rhs) const
Divide by a vector.

Vector4operator+= (const Vector4 &rhs)

Vector4operator-= (const Vector4 &rhs)
Subtract-assign a vector.

Vector4operator*= (float rhs)
Multiply-assign a scalar.

Vector4operator*= (const Vector4 &rhs)
Multiply-assign a vector.

Vector4operator/= (float rhs)
Divide-assign a scalar.

Vector4operator/= (const Vector4 &rhs)
Divide-assign a vector.

float operator[] (unsigned index) const
Return const value by index.

float & operator[] (unsigned index)
Return mutable value by index.

float DotProduct (const Vector4 &rhs) const
Calculate dot product.

float AbsDotProduct (const Vector4 &rhs) const
Calculate absolute dot product.

float ProjectOntoAxis (const Vector3 &axis) const
Project vector onto axis.

Vector4 Abs () const
Return absolute vector.

Vector4 Lerp (const Vector4 &rhs, float t) const
Linear interpolation with another vector.

bool Equals (const Vector4 &rhs) const
Test for equality with another vector with epsilon.

bool IsNaN () const
Return whether any component is NaN.

bool IsInf () const
Return whether any component is Inf.

operator Vector2 () const
Convert to Vector2.

operator Vector3 () const
Convert to Vector3.

const float * Data () const
Return float data.

String ToString () const
Return as string.

unsigned ToHash () const
Return hash value for HashSet & HashMap.

float x_
X coordinate.

float y_
Y coordinate.

float z_
Z coordinate.

float w_
W coordinate.

## Static Public Attributes

static const Vector4 ZERO
Zero vector.

static const Vector4 ONE
(1,1,1) vector.

## Detailed Description

Four-dimensional vector.

The documentation for this class was generated from the following files:
• Source/Urho3D/Math/Vector4.h
• Source/Urho3D/Math/Vector4.cpp