|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
#include <Vector3.hpp>
Public Member Functions | |
| constexpr | Vector3 (float x=0, float y=0, float z=0) |
| Creates a vector with the specified values. If no values are provided, it creates a zero vector. | |
| constexpr | Vector3 (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. | |
| Vector3 & | Normalize () |
| Normalizes this vector in-place. | |
| Vector3 & | operator+= (const Vector3 &v) |
| Adds another vector to this vector in-place. | |
| Vector3 | operator+ (const Vector3 &v) const |
| Adds another vector to this vector and returns the result. | |
| Vector3 & | operator-= (const Vector3 &v) |
| Subtracts another vector from this vector in-place. | |
| Vector3 | operator- (const Vector3 &v) const |
| Subtracts another vector from this vector and returns the result. | |
| Vector3 & | operator- () |
| Negates this vector in-place. | |
| Vector3 | operator- () const |
| Returns the negated form of this vector. | |
| Vector3 & | operator*= (float s) |
| Multiplies this vector by a scalar in-place. | |
| Vector3 | operator* (float s) const |
| Multiplies this vector by a scalar and returns the result. | |
| Vector3 & | operator/= (float s) |
| Divides this vector by a scalar in-place. | |
| Vector3 | operator/ (float s) const |
| Divides this vector by a scalar and returns the result. | |
| Vector3 & | Cross (const Vector3 &v) |
| Computes the cross product of this vector with another vector in-place. | |
| float | Dot (const Vector3 &v) const |
| Computes the dot product of this vector with another vector. | |
| Vector3 & | Transform (const Quaternion &q) |
| Transforms this vector in-place by the specified quaternion rotation. | |
| Vector3 & | Transform (const Matrix4x4 &m) |
| Transforms this vector in-place by the specified matrix. | |
| Vector3 & | Hadamard (const Vector3 &v) |
| Vector2 | XX () const noexcept |
| Returns a vector with the components swizzled to (X, X). | |
| Vector2 | XY () const noexcept |
| Returns a vector with the components swizzled to (X, Y). | |
| Vector2 | XZ () const noexcept |
| Returns a vector with the components swizzled to (X, Z). | |
| Vector2 | YX () const noexcept |
| Returns a vector with the components swizzled to (Y, X). | |
| Vector2 | YY () const noexcept |
| Returns a vector with the components swizzled to (Y, Y). | |
| Vector2 | YZ () const noexcept |
| Returns a vector with the components swizzled to (Y, Z). | |
| Vector2 | ZX () const noexcept |
| Returns a vector with the components swizzled to (Z, X). | |
| Vector2 | ZY () const noexcept |
| Returns a vector with the components swizzled to (Z, Y). | |
| Vector2 | ZZ () const noexcept |
| Returns a vector with the components swizzled to (Z, Z). | |
| auto | operator<=> (const Vector3 &v) const =default |
| Compares this vector with another vector for equality. | |
Static Public Member Functions | |
| static Vector3 | Zero () |
| Returns a zero vector (0, 0, 0). | |
| static Vector3 | UnitX () |
| Returns the unit vector along the X-axis (1, 0, 0). | |
| static Vector3 | UnitY () |
| Returns the unit vector along the Y-axis (0, 1, 0). | |
| static Vector3 | UnitZ () |
| Returns the unit vector along the Z-axis (0, 0, 1). | |
| static Vector3 | One () |
| Returns a vector with all components set to 1 (1, 1, 1). | |
| static Vector3 | Up () |
| Returns the up direction unit vector. | |
| static Vector3 | Down () |
| Returns the down direction unit vector. | |
| static Vector3 | Forward () |
| Returns the forward direction unit vector. | |
| static Vector3 | Backward () |
| Returns the backward direction unit vector. | |
| static Vector3 | Left () |
| Returns the left direction unit vector. | |
| static Vector3 | Right () |
| Returns the right direction unit vector. | |
| static Vector3 | Normalize (const Vector3 &v) |
| Returns the normalized form of the specified vector. | |
| static Vector3 | Cross (const Vector3 &v1, const Vector3 &v2) |
| Computes the cross product of two vectors. | |
| static float | Dot (const Vector3 &a, const Vector3 &b) |
| Computes the dot product of two vectors. | |
| static Vector3 | Transform (const Vector3 &v, const Quaternion &q) |
| Transforms the specified vector by the given quaternion rotation. | |
| static Vector3 | Transform (const Vector3 &v, const Matrix4x4 &m) |
| Transforms the specified vector by the given matrix. | |
| static Vector3 | Hadamard (const Vector3 &a, const Vector3 &b) |
Public Attributes | |
| float | X |
| X component of the vector. | |
| float | Y |
| Y component of the vector. | |
| float | Z |
| Z component of the vector. | |
|
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. |
|
inlineexplicitconstexpr |
Creates a vector from an initializer list of floats.
| lst | The initializer list containing up to 3 values (X, Y, Z). |
|
static |
Returns the backward direction unit vector.
Computes the cross product of this vector with another vector in-place.
| v | The other vector. |
Computes the cross product of two vectors.
| v1 | The first vector. |
| v2 | The second vector. |
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. |
|
static |
Returns the down direction unit vector.
|
static |
Returns the forward direction unit vector.
|
static |
Returns the left direction unit vector.
| float Vector3::Length | ( | ) | const |
Returns the length (magnitude) of this vector.
| float Vector3::LengthSquared | ( | ) | const |
Returns the squared length of this vector.
| Vector3 & Vector3::Normalize | ( | ) |
Normalizes this vector in-place.
Returns the normalized form of the specified vector.
| v | The vector to normalize. |
|
static |
Returns a vector with all components set to 1 (1, 1, 1).
Multiplies this vector by a scalar and returns the result.
| s | The scalar value. |
Multiplies this vector by a scalar in-place.
| s | 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. |
| Vector3 & Vector3::operator- | ( | ) |
Negates this vector in-place.
| Vector3 Vector3::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.
| s | The scalar value. |
Divides this vector by a scalar in-place.
| s | The scalar value. |
|
default |
Compares this vector with another vector for equality.
| v | The vector to compare with. |
|
static |
Returns the right direction unit vector.
Transforms this vector in-place by the specified matrix.
| m | The matrix to transform by. |
| Vector3 & Vector3::Transform | ( | const Quaternion & | q | ) |
Transforms this vector in-place by the specified quaternion rotation.
| q | The quaternion to transform by. |
Transforms the specified vector by the given matrix.
| v | The vector to transform. |
| m | The matrix to transform by. |
|
static |
Transforms the specified vector by the given quaternion rotation.
| v | The vector to transform. |
| q | The quaternion to transform by. |
|
static |
Returns the unit vector along the X-axis (1, 0, 0).
|
static |
Returns the unit vector along the Y-axis (0, 1, 0).
|
static |
Returns the unit vector along the Z-axis (0, 0, 1).
|
static |
Returns the up direction unit vector.
|
noexcept |
Returns a vector with the components swizzled to (X, X).
|
noexcept |
Returns a vector with the components swizzled to (X, Y).
|
noexcept |
Returns a vector with the components swizzled to (X, Z).
|
noexcept |
Returns a vector with the components swizzled to (Y, X).
|
noexcept |
Returns a vector with the components swizzled to (Y, Y).
|
noexcept |
Returns a vector with the components swizzled to (Y, Z).
|
static |
Returns a zero vector (0, 0, 0).
|
noexcept |
Returns a vector with the components swizzled to (Z, X).
|
noexcept |
Returns a vector with the components swizzled to (Z, Y).
|
noexcept |
Returns a vector with the components swizzled to (Z, Z).
| float Engine3DRadSpace.Math::Vector3::X |
X component of the vector.
| float Engine3DRadSpace.Math::Vector3::Y |
Y component of the vector.
| float Engine3DRadSpace.Math::Vector3::Z |
Z component of the vector.