Aether3D
Game Engine
|
3-component vector. More...
#include <Vec3.hpp>
Public Member Functions | |
Vec3 (const Vec3 &other)=default | |
Copy constructor. | |
Vec3 () | |
Constructor. | |
Vec3 (float ax, float ay, float az) | |
bool | IsAlmost (const Vec3 &v) const |
Vec3 | operator/ (float f) const |
Vec3 | operator/ (const Vec3 &v) const |
Vec3 | operator- () const |
Vec3 | operator- (const Vec3 &v) const |
Vec3 | operator+ (const Vec3 &v) const |
Vec3 | operator+ (float f) const |
bool | operator== (const Vec3 &v) const |
bool | operator!= (const Vec3 &v) const |
Vec3 & | operator-= (const Vec3 &v) |
Vec3 & | operator+= (const Vec3 &v) |
Vec3 & | operator*= (float f) |
Vec3 & | operator/= (float f) |
Vec3 & | operator*= (const Vec3 &v) |
Vec3 & | operator= (const Vec3 &v) |
Vec3 | operator* (const Vec3 &v) const |
Vec3 | operator* (float f) const |
Vec3 | Normalized () const |
float | Length () const |
void | Zero () |
Resets this vector's values to 0. | |
Static Public Member Functions | |
static Vec3 | Cross (const Vec3 &v1, const Vec3 &v2) |
Cross product. More... | |
static float | Distance (const Vec3 &v1, const Vec3 &v2) |
static float | DistanceSquared (const Vec3 &v1, const Vec3 &v2) |
static float | Dot (const Vec3 &v1, const Vec3 &v2) |
static Vec3 | Min2 (const Vec3 &v1, const Vec3 &v2) |
static Vec3 | Max2 (const Vec3 &v1, const Vec3 &v2) |
static Vec3 | Reflect (const Vec3 &vec, const Vec3 &normal) |
Public Attributes | |
float | x |
float | y |
float | z |
3-component vector.
Aether3D's coordinate system is right-handed: up: 0, 1, 0 forward: 0, 0, -1 right: 1, 0, 0
|
inline |
Constructor.
ax | X-coordinate. |
ay | Y-coordinate. |
az | Z-coordinate. |
Cross product.
v1 | Vector. |
v2 | Another vector. |
Solves distance between two vectors.
v1 | Vector. |
v2 | Other vector. |
Solves squared distance between two vectors.
v1 | Vector. |
v2 | Other vector. |
Dot product.
v1 | Vector. |
v2 | Other vector. |
|
inline |
Almost equality.
v | another vector. |
|
inline |
Gets maximum components and creates a new vector from them. Example: v1( 1, 0, 2 ), v2( 2, 1, 1 ) -> result( 2, 1, 2 ).
v1 | Vector. |
v2 | Other vector. |
Gets minimum components and creates a new vector from them. Example:
.
v1 | Vector. |
v2 | Other vector. |
|
inline |
Returns a normalized vector
|
inline |
Inequality operator
v | Vector that is tested for equality. |
Multiplication operator.
v | A vector that is multiplied with this vector |
|
inline |
Multiplication operator.
f | A value that is multiplied with this vector. |
Operator multiply and assign.
v | A value that is to be multiplied with this vector. |
|
inline |
Operator multiply and assign.
f | A value that is to be multiplied with this vector. |
Addition operator.
v | a vector that is to be added to this vector. |
|
inline |
Addition operator.
f | a value that is to be added to this vector. |
Operator add and assign.
v | Vector that is to be added to this vector. |
|
inline |
Negation operator.
Subtraction operator.
v | a vector that is to be subtracted from this vector. |
Operator subtract and assign.
v | Vector that is to be subtracted from this vector. |
Divides by a vector operator.
v | Vector value. |
|
inline |
Divides by a scalar operator.
f | Scalar value. |
|
inline |
Operator divide and assign.
f | A value that is to be divided with this vector. |
Assignment operator.
v | a vector that is assigned to this vector. |
|
inline |
Equality operator
v | Vector that is tested for equality. |
Reflects a vector with normal.
vec | Vector. |
normal | Normal. |