#include <Vec3.h>
|
| float | x |
| |
| float | y |
| |
| float | z |
| | The x, y, and z components of the vector.
|
| |
◆ Vec3() [1/3]
Default constructor. Initializes all components to zero.
◆ Vec3() [2/3]
| Vec3::Vec3 |
( |
float |
value | ) |
|
|
explicit |
Constructs a vector with the same value for all components.
- Parameters
-
| value | The value to set for all components. |
◆ Vec3() [3/3]
| Vec3::Vec3 |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Constructs a vector with the given x, y, and z components.
- Parameters
-
| x | The x component. |
| y | The y component. |
| z | The z component. |
◆ Cross()
| Vec3 Vec3::Cross |
( |
const Vec3 & |
other | ) |
const |
Computes the cross product of this vector and another vector.
- Parameters
-
- Returns
- The cross product vector.
◆ Dot()
| float Vec3::Dot |
( |
const Vec3 & |
other | ) |
const |
Computes the dot product of this vector and another vector.
- Parameters
-
- Returns
- The dot product.
◆ Length()
| float Vec3::Length |
( |
| ) |
const |
Calculates the length (magnitude) of the vector.
- Returns
- The length of the vector.
◆ Normalize()
| Vec3 Vec3::Normalize |
( |
| ) |
const |
Returns a normalized (unit length) version of this vector.
- Returns
- The normalized vector.
◆ operator*()
| Vec3 Vec3::operator* |
( |
float |
scalar | ) |
const |
Multiplies this vector by a scalar.
- Parameters
-
| scalar | The scalar value to multiply by. |
- Returns
- The result of scalar multiplication.
◆ operator*=()
| Vec3 & Vec3::operator*= |
( |
float |
scalar | ) |
|
Compound multiplication assignment.
◆ operator+()
| Vec3 Vec3::operator+ |
( |
const Vec3 & |
other | ) |
const |
Adds this vector to another vector.
- Parameters
-
- Returns
- The result of vector addition.
◆ operator+=()
| Vec3 & Vec3::operator+= |
( |
const Vec3 & |
other | ) |
|
Compound addition assignment.
◆ operator-() [1/2]
| Vec3 Vec3::operator- |
( |
| ) |
const |
Negates the vector (flips the sign of all components).
- Returns
- The negated vector.
◆ operator-() [2/2]
| Vec3 Vec3::operator- |
( |
const Vec3 & |
other | ) |
const |
Subtracts another vector from this vector.
- Parameters
-
| other | The vector to subtract. |
- Returns
- The result of vector subtraction.
◆ operator-=()
| Vec3 & Vec3::operator-= |
( |
const Vec3 & |
other | ) |
|
Compound subtraction assignment.
◆ operator/()
| Vec3 Vec3::operator/ |
( |
float |
scalar | ) |
const |
Divides this vector by a scalar.
- Parameters
-
| scalar | The scalar value to divide by. |
- Returns
- The result of scalar division.
The x, y, and z components of the vector.
The documentation for this struct was generated from the following files: