Represents a 2D vector.
More...
#include <d2Math.h>
◆ d2Vec2() [1/2]
◆ d2Vec2() [2/2]
Constructor that initializes the vector with given x and y components.
- Parameters
-
x | The x component of the vector. |
y | The y component of the vector. |
◆ ~d2Vec2()
◆ Cross()
Calculates the cross product with another vector.
- Parameters
-
- Returns
- The cross product.
◆ Dot()
Calculates the dot product with another vector.
- Parameters
-
- Returns
- The dot product.
◆ Lenght()
real d2Vec2::Lenght |
( |
| ) |
const |
|
inline |
Calculates the magnitude of the vector.
- Returns
- The magnitude of the vector.
◆ LenghtSquared()
real d2Vec2::LenghtSquared |
( |
| ) |
const |
|
inline |
Calculates the squared magnitude of the vector.
- Returns
- The squared magnitude of the vector.
◆ Normal()
d2Vec2 d2Vec2::Normal |
( |
| ) |
const |
|
inline |
Calculates the normal of the vector.
- Returns
- The normal of the vector.
◆ Normalize()
d2Vec2 & d2Vec2::Normalize |
( |
| ) |
|
Normalizes the vector.
- Returns
- The normalized vector.
◆ operator!=()
bool d2Vec2::operator!= |
( |
const d2Vec2 & | v | ) |
const |
◆ operator*() [1/2]
◆ operator*() [2/2]
◆ operator*=() [1/2]
◆ operator*=() [2/2]
◆ operator+()
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator-=()
◆ operator/()
◆ operator/=()
◆ operator=()
◆ operator==()
bool d2Vec2::operator== |
( |
const d2Vec2 & | v | ) |
const |
◆ UnitVector()
d2Vec2 d2Vec2::UnitVector |
( |
| ) |
const |
|
inline |
Calculates the unit vector.
- Returns
- The unit vector.
◆ Zero()
Sets all components of the vector to zero.
The documentation for this struct was generated from the following file: