|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
#include <Vector4.hpp>
Public Member Functions | |
| constexpr | Vector4 (float x=0.0f, float y=0.0f, float z=0.0f, float w=0.0f) |
| Creates a vector with the specified values. If no values are provided, it creates a zero vector. | |
| constexpr | Vector4 (Vector3 v, float w=1.0f) |
| Creates a vector from a Vector3, setting W to 1. | |
| constexpr | Vector4 (std::initializer_list< float > lst) |
| Creates a vector from an initializer list of floats. | |
| float | Length () const |
| Returns the length (magnitude) of this vector. | |
| float | LengthSquared () const |
| Returns the squared length of this vector. | |
| Vector4 & | Normalize () |
| Normalizes this vector in-place. | |
| float | Dot (const Vector4 &v) const |
| Computes the dot product of this vector with another vector. | |
| Vector4 & | Hadamard (const Vector4 &v) |
| Element-wise (Hadamard) multiplication of this vector with another vector. | |
| Vector4 | operator+ (const Vector4 &v) const |
| Adds another vector to this vector and returns the result. | |
| Vector4 & | operator+= (const Vector4 &v) |
| Adds another vector to this vector in-place. | |
| Vector4 & | operator- () |
| Negates this vector in-place. | |
| Vector4 | operator- () const |
| Returns the negated form of this vector. | |
| Vector4 | operator- (const Vector4 &v) const |
| Subtracts another vector from this vector and returns the result. | |
| Vector4 & | operator-= (const Vector4 &v) |
| Subtracts another vector from this vector in-place. | |
| Vector4 | operator* (float scalar) const |
| Multiplies this vector by a scalar and returns the result. | |
| Vector4 & | operator*= (float scalar) |
| Multiplies this vector by a scalar in-place. | |
| Vector4 | operator/ (float f) const |
| Divides this vector by a scalar and returns the result. | |
| Vector4 & | operator/= (float f) |
| Divides this vector by a scalar in-place. | |
| Vector4 & | Transform (const Matrix4x4 &m) |
| Transforms this vector in-place by the specified matrix. | |
| auto | operator<=> (const Vector4 &v) const =default |
| Compares this vector with another vector for equality. | |
Static Public Member Functions | |
| static Vector4 | Zero () |
| Returns a zero vector (0, 0, 0, 0). | |
| static Vector4 | UnitX () |
| Returns the unit vector along the X-axis (1, 0, 0, 0). | |
| static Vector4 | UnitY () |
| Returns the unit vector along the Y-axis (0, 1, 0, 0). | |
| static Vector4 | UnitZ () |
| Returns the unit vector along the Z-axis (0, 0, 1, 0). | |
| static Vector4 | UnitW () |
| Returns the unit vector along the W-axis (0, 0, 0, 1). | |
| static Vector4 | One () |
| Returns a vector with all components set to 1 (1, 1, 1, 1). | |
| static float | Dot (const Vector4 &a, const Vector4 &b) |
| Computes the dot product of two vectors. | |
| static Vector4 | Hadamard (const Vector4 &a, const Vector4 &b) |
| Element-wise (Hadamard) product of two vectors. | |
| static Vector4 | Transform (const Vector4 &v, const Matrix4x4 &m) |
| Transforms the specified vector by the given matrix. | |
Public Attributes | |
| float | X |
| X, Y, Z, W components of the vector. | |
| float | Y |
| float | Z |
| float | W |
|
inlineexplicitconstexpr |
Creates a vector with the specified values. If no values are provided, it creates a zero vector.
| x | The X component. |
| y | The Y component. |
| z | The Z component. |
| w | The W component. |
Creates a vector from a Vector3, setting W to 1.
| v | The source Vector3. |
|
inlineexplicitconstexpr |
Creates a vector from an initializer list of floats.
| lst | The initializer list containing up to 4 values (X, Y, Z, W). |
Computes the dot product of two vectors.
| a | The first vector. |
| b | The second vector. |
Computes the dot product of this vector with another vector.
| v | The other vector. |
Element-wise (Hadamard) product of two vectors.
| a | The first vector. |
| b | The second vector. |
Element-wise (Hadamard) multiplication of this vector with another vector.
| v | The vector to multiply with. |
| float Vector4::Length | ( | ) | const |
Returns the length (magnitude) of this vector.
| float Vector4::LengthSquared | ( | ) | const |
Returns the squared length of this vector.
| Vector4 & Engine3DRadSpace.Math::Vector4::Normalize | ( | ) |
Normalizes this vector in-place.
|
static |
Returns a vector with all components set to 1 (1, 1, 1, 1).
Multiplies this vector by a scalar and returns the result.
| scalar | The scalar value. |
Multiplies this vector by a scalar in-place.
| scalar | The scalar value. |
Adds another vector to this vector and returns the result.
| v | The vector to add. |
Adds another vector to this vector in-place.
| v | The vector to add. |
| Vector4 & Engine3DRadSpace.Math::Vector4::operator- | ( | ) |
Negates this vector in-place.
| Vector4 Vector4::operator- | ( | ) | const |
Returns the negated form of this vector.
Subtracts another vector from this vector and returns the result.
| v | The vector to subtract. |
Subtracts another vector from this vector in-place.
| v | The vector to subtract. |
Divides this vector by a scalar and returns the result.
| f | The scalar value. |
Divides this vector by a scalar in-place.
| f | The scalar value. |
|
default |
Compares this vector with another vector for equality.
| v | The vector to compare with. |
Transforms this vector in-place by the specified matrix.
| m | The matrix to transform by. |
Transforms the specified vector by the given matrix.
| v | The vector to transform. |
| m | The matrix to transform by. |
|
static |
Returns the unit vector along the W-axis (0, 0, 0, 1).
|
static |
Returns the unit vector along the X-axis (1, 0, 0, 0).
|
static |
Returns the unit vector along the Y-axis (0, 1, 0, 0).
|
static |
Returns the unit vector along the Z-axis (0, 0, 1, 0).
|
static |
Returns a zero vector (0, 0, 0, 0).
| float Engine3DRadSpace.Math::Vector4::W |
| float Engine3DRadSpace.Math::Vector4::X |
X, Y, Z, W components of the vector.
| float Engine3DRadSpace.Math::Vector4::Y |
| float Engine3DRadSpace.Math::Vector4::Z |