Aether3D Game Engine
Public Member Functions | Public Attributes | List of all members
ae3d::Vec4 Struct Reference

4-component vector. More...

#include <Vec3.hpp>

Public Member Functions

 Vec4 (float ax, float ay, float az, float aw)
 
 Vec4 (Vec4 &&v) noexcept=default
 Move constructor.
 
 Vec4 (const Vec4 &other) noexcept=default
 Copy constructor.
 
 Vec4 (const Vec3 &v)
 
 Vec4 (const Vec3 &v, float aW)
 
bool IsAlmost (const Vec4 &v2) const
 
Vec4operator= (const Vec4 &v)
 
Vec4 operator* (float f) const
 
Vec4operator+= (const Vec4 &v)
 
Vec4operator-= (const Vec4 &v)
 
float Dot (const Vec4 &v) const
 
float Length () const
 
void Normalize ()
 

Public Attributes

float x = 0
 X coordinate.
 
float y = 0
 Y coordinate.
 
float z = 0
 Z coordinate.
 
float w = 0
 W coordinate.
 

Detailed Description

4-component vector.

Constructor & Destructor Documentation

ae3d::Vec4::Vec4 ( float  ax,
float  ay,
float  az,
float  aw 
)
inline

Constructor.

Parameters
axX-coordinate.
ayY-coordinate.
azZ-coordinate.
awW-coordinate.
ae3d::Vec4::Vec4 ( const Vec3 v)
inlineexplicit
Parameters
vVec3
ae3d::Vec4::Vec4 ( const Vec3 v,
float  aW 
)
inline

Constructor.

Parameters
vVec3
aW.w component

Member Function Documentation

float ae3d::Vec4::Dot ( const Vec4 v) const
inline

Dot product.

Parameters
vanother vector.
Returns
Dot product of this vector and v.
bool ae3d::Vec4::IsAlmost ( const Vec4 v2) const
inline

Compares this vector with another vector.

Parameters
v2Another vector.
Returns
True if vectors are almost equal.
float ae3d::Vec4::Length ( ) const
inline
Returns
length.
void ae3d::Vec4::Normalize ( )
inline

Normalizes this vector.

Vec4 ae3d::Vec4::operator* ( float  f) const
inline

Multiplication operator.

Parameters
fA value that is multiplied with this vector.
Returns
This vector multiplied by f.
Vec4& ae3d::Vec4::operator+= ( const Vec4 v)
inline

Operator addition and assign.

Parameters
vVector that is to be added to this vector.
Vec4& ae3d::Vec4::operator-= ( const Vec4 v)
inline

Operator subtract and assign.

Parameters
vVector that is to be subtracted from this vector.
Vec4& ae3d::Vec4::operator= ( const Vec4 v)
inline

Assignment operator.

Parameters
va vector that is assigned to this vector.
Returns
Reference to this vector.

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