|
Aeon Engine c550894
AeonGames Open Source Game Engine
|
3D vector class. More...
#include <aeongames/Vector3.hpp>

Public Member Functions | |
| DLL | Vector3 () |
| Default constructor. | |
| DLL | Vector3 (const float *const aVector) |
| Constructor. | |
| DLL | Vector3 (const void *const aVector, const uint32_t aStride) |
| Constructor from raw memory with stride. | |
| DLL | Vector3 (float aX, float aY, float aZ) |
| Constructor. | |
| DLL void | Get (float *aData) const |
| Copy vector data to an external float array. | |
| DLL const float *const | GetVector3 () const |
| Get a pointer to the internal vector data. | |
| DLL const float & | GetX () const |
| Get the X component. | |
| DLL const float & | GetY () const |
| Get the Y component. | |
| DLL const float & | GetZ () const |
| Get the Z component. | |
| DLL void | SetVector3 (const float *const aVector) |
| Set the vector from a float array. | |
| DLL void | SetVector3 (const void *const aVector, const uint32_t aStride) |
| Set the vector from raw memory with stride. | |
| DLL float | GetLenghtSquared () const |
| Get the squared length of the vector. | |
| DLL float | GetLenght () const |
| Get the length of the vector. | |
| DLL size_t | GetMaxAxisIndex () const |
| Get the index of the axis with the largest absolute value. | |
| DLL size_t | GetMinAxisIndex () const |
| Get the index of the axis with the smallest absolute value. | |
| DLL float | GetMaxAxisLenght () const |
| Get the absolute value of the largest axis component. | |
| DLL float | GetMinAxisLenght () const |
| Get the absolute value of the smallest axis component. | |
| DLL float | GetDistanceToPlane (const Plane &aPlane) const |
| Get the signed distance from this point to a plane. | |
| DLL bool | IsZero () const |
| Check whether all components are zero. | |
Operators | |
| float | mVector [3] |
| X,Y,Z. | |
| DLL Vector3 & | operator= (const float *aLhs) |
| Assign from a raw float array. | |
| DLL Vector3 & | operator-= (const Vector3 &aLhs) |
| Subtract a vector from this vector. | |
| DLL Vector3 & | operator+= (const Vector3 &aLhs) |
| Add a vector to this vector. | |
| DLL Vector3 & | operator*= (const float aLhs) |
| Scale this vector by a scalar. | |
| DLL Vector3 & | operator*= (const Vector3 &aLhs) |
| Component-wise multiply by another vector. | |
| DLL Vector3 & | operator/= (const float aLhs) |
| Divide this vector by a scalar. | |
| DLL float | operator[] (const size_t aIndex) const |
| Access a component by index (const). | |
| DLL float & | operator[] (const size_t aIndex) |
| Access a component by index. | |
3D vector class.
Definition at line 31 of file Vector3.hpp.
| AeonGames::Vector3::Vector3 | ( | ) |
Default constructor.
Definition at line 22 of file Vector3.cpp.
| AeonGames::Vector3::Vector3 | ( | const float *const | aVector | ) |
Constructor.
| aVector | a float pointer or array containing vector data. |
Definition at line 27 of file Vector3.cpp.
| AeonGames::Vector3::Vector3 | ( | const void *const | aVector, |
| const uint32_t | aStride ) |
Constructor from raw memory with stride.
| aVector | Pointer to raw memory containing vector data. |
| aStride | Byte stride between consecutive float components. |
Definition at line 37 of file Vector3.cpp.
| AeonGames::Vector3::Vector3 | ( | float | aX, |
| float | aY, | ||
| float | aZ ) |
Constructor.
| aX | X component. |
| aY | Y component. |
| aZ | Z component. |
Definition at line 90 of file Vector3.cpp.
| void AeonGames::Vector3::Get | ( | float * | aData | ) | const |
Copy vector data to an external float array.
| [out] | aData | Pointer to a float array of at least 3 elements. |
Definition at line 97 of file Vector3.cpp.
| float AeonGames::Vector3::GetDistanceToPlane | ( | const Plane & | aPlane | ) | const |
Get the signed distance from this point to a plane.
| aPlane | The plane to measure distance to. |
Definition at line 85 of file Vector3.cpp.
| float AeonGames::Vector3::GetLenght | ( | ) | const |
Get the length of the vector.
Definition at line 54 of file Vector3.cpp.
| float AeonGames::Vector3::GetLenghtSquared | ( | ) | const |
Get the squared length of the vector.
Definition at line 49 of file Vector3.cpp.
| size_t AeonGames::Vector3::GetMaxAxisIndex | ( | ) | const |
Get the index of the axis with the largest absolute value.
Definition at line 59 of file Vector3.cpp.
| float AeonGames::Vector3::GetMaxAxisLenght | ( | ) | const |
Get the absolute value of the largest axis component.
Definition at line 75 of file Vector3.cpp.
| size_t AeonGames::Vector3::GetMinAxisIndex | ( | ) | const |
Get the index of the axis with the smallest absolute value.
Definition at line 67 of file Vector3.cpp.
| float AeonGames::Vector3::GetMinAxisLenght | ( | ) | const |
Get the absolute value of the smallest axis component.
Definition at line 80 of file Vector3.cpp.
| const float *const AeonGames::Vector3::GetVector3 | ( | ) | const |
Get a pointer to the internal vector data.
Definition at line 102 of file Vector3.cpp.
| const float & AeonGames::Vector3::GetX | ( | ) | const |
Get the X component.
Definition at line 107 of file Vector3.cpp.
| const float & AeonGames::Vector3::GetY | ( | ) | const |
Get the Y component.
Definition at line 112 of file Vector3.cpp.
| const float & AeonGames::Vector3::GetZ | ( | ) | const |
Get the Z component.
Definition at line 118 of file Vector3.cpp.
| bool AeonGames::Vector3::IsZero | ( | ) | const |
Check whether all components are zero.
Definition at line 205 of file Vector3.cpp.
| Vector3 & AeonGames::Vector3::operator*= | ( | const float | aLhs | ) |
Scale this vector by a scalar.
Definition at line 181 of file Vector3.cpp.
Component-wise multiply by another vector.
Definition at line 189 of file Vector3.cpp.
Add a vector to this vector.
Definition at line 166 of file Vector3.cpp.
Subtract a vector from this vector.
Definition at line 149 of file Vector3.cpp.
| Vector3 & AeonGames::Vector3::operator/= | ( | const float | aLhs | ) |
Divide this vector by a scalar.
Definition at line 197 of file Vector3.cpp.
| Vector3 & AeonGames::Vector3::operator= | ( | const float * | aLhs | ) |
Assign from a raw float array.
Definition at line 143 of file Vector3.cpp.
| float & AeonGames::Vector3::operator[] | ( | const size_t | aIndex | ) |
Access a component by index.
Definition at line 137 of file Vector3.cpp.
| float AeonGames::Vector3::operator[] | ( | const size_t | aIndex | ) | const |
Access a component by index (const).
Definition at line 131 of file Vector3.cpp.
| void AeonGames::Vector3::SetVector3 | ( | const float *const | aVector | ) |
Set the vector from a float array.
| aVector | Pointer to a float array containing X,Y,Z values. |
Definition at line 32 of file Vector3.cpp.
| void AeonGames::Vector3::SetVector3 | ( | const void *const | aVector, |
| const uint32_t | aStride ) |
Set the vector from raw memory with stride.
| aVector | Pointer to raw memory containing vector data. |
| aStride | Byte stride between consecutive float components. |
Definition at line 42 of file Vector3.cpp.
|
protected |
X,Y,Z.
Definition at line 135 of file Vector3.hpp.