olp-cpp-sdk
1.22.0
|
Represents 2D vectors and points. More...
#include <Vector.h>
Public Member Functions | |
Vector2 (T a, T b) | |
Creates a Vector2 instance with the given X and Y components. More... | |
Vector2< T > & | operator= (Vector2< T > const &v) |
Assigns components of one vector to another vector. More... | |
Vector2< T > | operator* (T const &s) const |
Multiplies each vector component by a number. More... | |
Vector2< T > | operator- () |
Negates the vector. | |
Vector2< T > | operator- (Vector2< T > const &v) const |
Subtracts one vector from another. More... | |
Vector2< T > | operator+ (Vector2< T > const &v) const |
Adds corresponding components of two vectors. More... | |
Public Attributes | |
T | x |
The X component of the vector. | |
T | y |
The Y component of the vector. | |
Represents 2D vectors and points.
|
inline |
Creates a Vector2
instance with the given X and Y components.
a | The X component of the vector. |
b | The Y component of the vector. |
|
inline |
Multiplies each vector component by a number.
s | The number to multiply by. |
|
inline |
Adds corresponding components of two vectors.
v | The vector to add. |
|
inline |
Subtracts one vector from another.
v | The vector to substruct from. |
|
inline |
Assigns components of one vector to another vector.
v | The vector to take components from. |