Jolt Physics
A multi core friendly Game Physics Engine
|
Templatized vector class. More...
#include <Vector.h>
Public Member Functions | |
Vector ()=default | |
Constructor. | |
Vector (const Vector &)=default | |
uint | GetRows () const |
Dimensions. | |
void | SetZero () |
Vector with all zeros. | |
template<class OtherVector > | |
void | CopyPart (const OtherVector &inV, uint inSourceRow, uint inNumRows, uint inDestRow) |
Copy a (part) of another vector into this vector. | |
float | operator[] (uint inCoordinate) const |
Get float component by index. | |
float & | operator[] (uint inCoordinate) |
bool | operator== (const Vector &inV2) const |
Comparison. | |
bool | operator!= (const Vector &inV2) const |
bool | IsZero () const |
Test if vector consists of all zeros. | |
bool | IsClose (const Vector &inV2, float inMaxDistSq=1.0e-12f) const |
Test if two vectors are close to each other. | |
Vector & | operator= (const Vector &)=default |
Assignment. | |
Vector | operator* (const float inV2) const |
Multiply vector with float. | |
Vector & | operator*= (const float inV2) |
Vector | operator/ (float inV2) const |
Divide vector by float. | |
Vector & | operator/= (float inV2) |
Vector | operator+ (const Vector &inV2) const |
Add two float vectors (component wise) | |
Vector & | operator+= (const Vector &inV2) |
Vector | operator- () const |
Negate. | |
Vector | operator- (const Vector &inV2) const |
Subtract two float vectors (component wise) | |
Vector & | operator-= (const Vector &inV2) |
float | Dot (const Vector &inV2) const |
Dot product. | |
float | LengthSq () const |
Squared length of vector. | |
float | Length () const |
Length of vector. | |
bool | IsNormalized (float inToleranceSq=1.0e-6f) |
Check if vector is normalized. | |
Vector | Normalized () const |
Normalize vector. | |
Static Public Member Functions | |
static Vector | sZero () |
Public Attributes | |
float | mF32 [Rows] |
Friends | |
Vector | operator* (const float inV1, const Vector &inV2) |
Multiply vector with float. | |
ostream & | operator<< (ostream &inStream, const Vector &inV) |
To String. | |
Templatized vector class.
|
inline |
Copy a (part) of another vector into this vector.
Dot product.
|
inline |
Test if two vectors are close to each other.
Check if vector is normalized.
Test if vector consists of all zeros.
Multiply vector with float.
Add two float vectors (component wise)
Subtract two float vectors (component wise)
Divide vector by float.
Assignment.
Comparison.
Get float component by index.
Multiply vector with float.
To String.