Common vector and quaternion math helpers.
More...
#include <Utils/CVector.h>
|
| static core::vector3df | lerp (const core::vector3df &a, const core::vector3df &b, float t) |
| | Linearly interpolate between two vectors.
|
| static core::vector3df | slerp (const core::vector3df &a, const core::vector3df &b, float t) |
| | Spherically interpolate between two direction vectors.
|
| static core::vector3df | reflect (const core::vector3df &inDirection, const core::vector3df &normal) |
| | Reflect a direction vector around a normal.
|
| static float | angle (const core::vector3df &a, const core::vector3df &b) |
| | Calculate the angle between two vectors in radians.
|
| static core::vector3df | project (const core::vector3df &vector, const core::vector3df &onNormal) |
| | Project a vector onto another vector.
|
| static core::vector3df | projectOnPlane (const core::vector3df &vector, const core::vector3df &planeNormal) |
| | Project a vector onto a plane.
|
| static bool | isParallel (const core::vector3df &a, const core::vector3df &b) |
| | Test whether two vectors are parallel or anti-parallel.
|
| static core::vector3df | quaternionToEuler (const core::quaternion &q) |
| | Convert a quaternion to Euler angles.
|
| static core::quaternion | getQuaternionFromAxes (const core::vector3df &xAxis, const core::vector3df &yAxis, const core::vector3df &zAxis) |
| | Build a quaternion from three orthogonal basis axes.
|
Common vector and quaternion math helpers.
◆ angle()
| float Skylicht::CVector::angle |
( |
const core::vector3df & | a, |
|
|
const core::vector3df & | b ) |
|
static |
Calculate the angle between two vectors in radians.
- Parameters
-
| a | First vector. |
| b | Second vector. |
- Returns
- Angle in radians, or 0 when either vector is too small.
◆ getQuaternionFromAxes()
| core::quaternion Skylicht::CVector::getQuaternionFromAxes |
( |
const core::vector3df & | xAxis, |
|
|
const core::vector3df & | yAxis, |
|
|
const core::vector3df & | zAxis ) |
|
static |
Build a quaternion from three orthogonal basis axes.
- Parameters
-
| xAxis | Local X axis. |
| yAxis | Local Y axis. |
| zAxis | Local Z axis. |
- Returns
- Quaternion representing the basis orientation.
◆ isParallel()
| bool Skylicht::CVector::isParallel |
( |
const core::vector3df & | a, |
|
|
const core::vector3df & | b ) |
|
static |
Test whether two vectors are parallel or anti-parallel.
- Parameters
-
| a | First vector. |
| b | Second vector. |
- Returns
- True when the normalized dot product is approximately +/-1.
◆ lerp()
| core::vector3df Skylicht::CVector::lerp |
( |
const core::vector3df & | a, |
|
|
const core::vector3df & | b, |
|
|
float | t ) |
|
static |
Linearly interpolate between two vectors.
- Parameters
-
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor clamped to [0, 1]. |
- Returns
- Interpolated vector.
◆ project()
| core::vector3df Skylicht::CVector::project |
( |
const core::vector3df & | vector, |
|
|
const core::vector3df & | onNormal ) |
|
static |
Project a vector onto another vector.
- Parameters
-
| vector | Vector to project. |
| onNormal | Target direction. |
- Returns
- Projection of vector on onNormal, or zero if onNormal is too small.
◆ projectOnPlane()
| core::vector3df Skylicht::CVector::projectOnPlane |
( |
const core::vector3df & | vector, |
|
|
const core::vector3df & | planeNormal ) |
|
static |
Project a vector onto a plane.
- Parameters
-
| vector | Vector to project. |
| planeNormal | Plane normal. |
- Returns
- Projection of vector onto the plane, or zero if the normal is too small.
◆ quaternionToEuler()
| core::vector3df Skylicht::CVector::quaternionToEuler |
( |
const core::quaternion & | q | ) |
|
|
static |
Convert a quaternion to Euler angles.
- Parameters
-
- Returns
- Euler angles in radians.
◆ reflect()
| core::vector3df Skylicht::CVector::reflect |
( |
const core::vector3df & | inDirection, |
|
|
const core::vector3df & | normal ) |
|
static |
Reflect a direction vector around a normal.
- Parameters
-
| inDirection | Incoming direction. |
| normal | Surface normal. |
- Returns
- Reflected direction.
◆ slerp()
| core::vector3df Skylicht::CVector::slerp |
( |
const core::vector3df & | a, |
|
|
const core::vector3df & | b, |
|
|
float | t ) |
|
static |
Spherically interpolate between two direction vectors.
- Parameters
-
| a | Start direction. |
| b | End direction. |
| t | Interpolation factor. |
- Returns
- Spherically interpolated vector.
The documentation for this class was generated from the following file: