3-component vector.
More...
#include <Vec3.hpp>
|
float | x = 0 |
| X coordinate.
|
|
float | y = 0 |
| Y coordinate.
|
|
float | z = 0 |
| Z coordinate.
|
|
ae3d::Vec3::Vec3 |
( |
float |
ax, |
|
|
float |
ay, |
|
|
float |
az |
|
) |
| |
|
inlinenoexcept |
Constructor.
- Parameters
-
ax | X-coordinate. |
ay | Y-coordinate. |
az | Z-coordinate. |
static Vec3 ae3d::Vec3::Cross |
( |
const Vec3 & |
v1, |
|
|
const Vec3 & |
v2 |
|
) |
| |
|
inlinestatic |
Cross product.
- Parameters
-
v1 | Vector. |
v2 | Another vector. |
- Returns
- Cross product of this vector and v.
static float ae3d::Vec3::Distance |
( |
const Vec3 & |
v1, |
|
|
const Vec3 & |
v2 |
|
) |
| |
|
inlinestatic |
Solves distance between two vectors.
- Parameters
-
v1 | Vector. |
v2 | Other vector. |
- Returns
- Distance.
- See also
- DistanceSquared()
static float ae3d::Vec3::DistanceSquared |
( |
const Vec3 & |
v1, |
|
|
const Vec3 & |
v2 |
|
) |
| |
|
inlinestatic |
Solves squared distance between two vectors.
- Parameters
-
v1 | Vector. |
v2 | Other vector. |
- Returns
- Squared distance.
- See also
- Distance()
static float ae3d::Vec3::Dot |
( |
const Vec3 & |
v1, |
|
|
const Vec3 & |
v2 |
|
) |
| |
|
inlinestatic |
Dot product.
- Parameters
-
v1 | Vector. |
v2 | Other vector. |
- Returns
- Dot product of vectors v1 and v2.
bool ae3d::Vec3::IsAlmost |
( |
const Vec3 & |
v2 | ) |
const |
|
inline |
Compares this vector with another vector.
- Parameters
-
- Returns
- True if vectors are almost equal.
float ae3d::Vec3::Length |
( |
| ) |
const |
|
inline |
static Vec3 ae3d::Vec3::Max2 |
( |
const Vec3 & |
v1, |
|
|
const Vec3 & |
v2 |
|
) |
| |
|
inlinestatic |
Gets maximum components and creates a new vector from them. Example: v1( 1, 0, 2 ), v2( 2, 1, 1 ) -> result( 2, 1, 2 ).
- Parameters
-
v1 | Vector. |
v2 | Other vector. |
- Returns
- Vector that has v1's and v2's maximum components.
static Vec3 ae3d::Vec3::Min2 |
( |
const Vec3 & |
v1, |
|
|
const Vec3 & |
v2 |
|
) |
| |
|
inlinestatic |
Gets minimum components and creates a new vector from them. Example:
v1( 1, 0, 2 ), v2( 2, 1, 1 ) -> result( 1, 0, 1 )
.
- Parameters
-
v1 | Vector. |
v2 | Other vector. |
- Returns
- Vector that has v1's and v2's minimum components.
- See also
- Max2()
Vec3 ae3d::Vec3::Normalized |
( |
| ) |
const |
|
inline |
Returns a normalized vector
Vec3 ae3d::Vec3::operator* |
( |
const Vec3 & |
v | ) |
const |
|
inline |
Multiplication operator.
- Parameters
-
v | A vector that is multiplied with this vector |
- Returns
- A vector that is the product of this vector and v.
Vec3 ae3d::Vec3::operator* |
( |
float |
f | ) |
const |
|
inline |
Multiplication operator.
- Parameters
-
f | A value that is multiplied with this vector. |
- Returns
- This vector multiplied by f.
Vec3& ae3d::Vec3::operator*= |
( |
float |
f | ) |
|
|
inline |
Operator multiply and assign.
- Parameters
-
f | A value that is to be multiplied with this vector. |
- Returns
- Reference to this vector.
Vec3& ae3d::Vec3::operator*= |
( |
const Vec3 & |
v | ) |
|
|
inline |
Operator multiply and assign.
- Parameters
-
v | A value that is to be multiplied with this vector. |
- Returns
- Reference to this vector.
Vec3 ae3d::Vec3::operator+ |
( |
const Vec3 & |
v | ) |
const |
|
inline |
Addition operator.
- Parameters
-
v | a vector that is to be added to this vector. |
- Returns
- A vector that is the sum of this vector and v.
Vec3 ae3d::Vec3::operator+ |
( |
float |
f | ) |
const |
|
inline |
Addition operator.
- Parameters
-
f | a value that is to be added to this vector. |
- Returns
- A vector that is the sum of this vector and c.
Vec3& ae3d::Vec3::operator+= |
( |
const Vec3 & |
v | ) |
|
|
inline |
Operator add and assign.
- Parameters
-
v | Vector that is to be added to this vector. |
- Returns
- Reference to this vector.
Vec3 ae3d::Vec3::operator- |
( |
| ) |
const |
|
inline |
Negation operator.
- Returns
- a vector that has negative values.
Vec3 ae3d::Vec3::operator- |
( |
const Vec3 & |
v | ) |
const |
|
inline |
Subtraction operator.
- Parameters
-
v | a vector that is to be subtracted from this vector. |
- Returns
- result of the subtraction.
Vec3& ae3d::Vec3::operator-= |
( |
const Vec3 & |
v | ) |
|
|
inline |
Operator subtract and assign.
- Parameters
-
v | Vector that is to be subtracted from this vector. |
- Returns
- Reference to this vector.
Vec3 ae3d::Vec3::operator/ |
( |
float |
f | ) |
const |
|
inline |
Divides by a scalar operator.
- Parameters
-
- Returns
- a vector that has its values divided by f.
Vec3 ae3d::Vec3::operator/ |
( |
const Vec3 & |
v | ) |
const |
|
inline |
Divides by a vector operator.
- Parameters
-
- Returns
- a vector that has its values divided by v.
Vec3& ae3d::Vec3::operator/= |
( |
float |
f | ) |
|
|
inline |
Operator divide and assign.
- Parameters
-
f | A value that is to be divided with this vector. |
- Returns
- Reference to this vector.
Vec3& ae3d::Vec3::operator= |
( |
const Vec3 & |
v | ) |
|
|
inline |
Assignment operator.
- Parameters
-
v | a vector that is assigned to this vector. |
- Returns
- Reference to this vector.
static Vec3 ae3d::Vec3::Reflect |
( |
const Vec3 & |
vec, |
|
|
const Vec3 & |
normal |
|
) |
| |
|
inlinestatic |
Reflects a vector with normal.
- Parameters
-
- Returns
- Reflected vector.
The documentation for this struct was generated from the following file: