Dura2D
v0.1.0
An educational 2D game physics library
|
Represents an N-dimensional vector. More...
#include <d2Math.h>
Public Member Functions | |
d2VecN () | |
d2VecN (int N) | |
Constructor that initializes the vector with given dimension. | |
d2VecN (const d2VecN &v) | |
Copy constructor. | |
~d2VecN () | |
void | Zero () |
Sets all components of the vector to zero. | |
real | Dot (const d2VecN &v) const |
Calculates the dot product with another vector. | |
d2VecN & | operator= (const d2VecN &v) |
d2VecN | operator+ (const d2VecN &v) const |
d2VecN | operator- (const d2VecN &v) const |
d2VecN | operator* (const real n) const |
const d2VecN & | operator+= (const d2VecN &v) |
const d2VecN & | operator-= (const d2VecN &v) |
const d2VecN & | operator*= (const real n) |
real | operator[] (const int index) const |
real & | operator[] (const int index) |
Public Attributes | |
int | N |
The dimension of the vector. | |
real * | data |
The data of the vector. | |
Represents an N-dimensional vector.
d2VecN::d2VecN | ( | ) |
d2VecN::d2VecN | ( | int | N | ) |
Constructor that initializes the vector with given dimension.
N | The dimension of the vector. |
d2VecN::d2VecN | ( | const d2VecN & | v | ) |
Copy constructor.
v | The vector to copy from. |
d2VecN::~d2VecN | ( | ) |
Calculates the dot product with another vector.
v | The other vector. |
real & d2VecN::operator[] | ( | const int | index | ) |
real d2VecN::operator[] | ( | const int | index | ) | const |
void d2VecN::Zero | ( | ) |
Sets all components of the vector to zero.
real* d2VecN::data |
The data of the vector.
int d2VecN::N |
The dimension of the vector.