Public Member Functions | List of all members
RVO::Vector2 Class Reference

#include <vector2.h>

Public Member Functions

float x () const
 
float y () const
 
 Vector2 ()
 
 Vector2 (const Vector2 &q)
 
 Vector2 (float x, float y)
 
Vector2 operator- () const
 
const Vector2operator+ () const
 
float operator* (const Vector2 &q) const
 
Vector2 operator* (float a) const
 
Vector2 operator/ (float a) const
 
Vector2 operator+ (const Vector2 &q) const
 
Vector2 operator- (const Vector2 &q) const
 
bool operator== (const Vector2 &q) const
 
bool operator!= (const Vector2 &q) const
 
Vector2operator*= (float a)
 
Vector2operator/= (float a)
 
Vector2operator+= (const Vector2 &q)
 
Vector2operator-= (const Vector2 &q)
 

Detailed Description

Defines a two-dimensional vector and its operations.

Constructor & Destructor Documentation

◆ Vector2() [1/3]

RVO::Vector2::Vector2 ( )
inline

Constructs a null vector.

◆ Vector2() [2/3]

RVO::Vector2::Vector2 ( const Vector2 q)
inline

Copy constructor.

Parameters
qThe vector to be copied into the new vector.

◆ Vector2() [3/3]

RVO::Vector2::Vector2 ( float  x,
float  y 
)
inline

Constructor.

Parameters
xThe x-component of the new vector.
yThe y-component of the new vector.

Member Function Documentation

◆ operator!=()

bool RVO::Vector2::operator!= ( const Vector2 q) const
inline

Vector inequality.

Parameters
qThe right hand side vector
Returns
True if the lhs vector and the rhs vector are not equal. False otherwise.

◆ operator*() [1/2]

float RVO::Vector2::operator* ( const Vector2 q) const
inline

Dot product.

Parameters
qThe right hand side vector
Returns
The dot product of the lhs vector and the rhs vector.

◆ operator*() [2/2]

Vector2 RVO::Vector2::operator* ( float  a) const
inline

Scalar product.

Parameters
aThe right hand side scalar
Returns
The scalar product of the lhs vector and the rhs scalar.

◆ operator*=()

Vector2& RVO::Vector2::operator*= ( float  a)
inline

The operator multiplies the vector by a scalar.

Parameters
aThe scalar
Returns
A reference to the vector.

◆ operator+() [1/2]

const Vector2& RVO::Vector2::operator+ ( ) const
inline

Unary plus.

Returns
A reference to the vector.

◆ operator+() [2/2]

Vector2 RVO::Vector2::operator+ ( const Vector2 q) const
inline

Vector addition.

Parameters
qThe right hand side vector
Returns
The sum of the lhs vector and the rhs vector.

◆ operator+=()

Vector2& RVO::Vector2::operator+= ( const Vector2 q)
inline

The operator adds an rhs vector to the vector.

Parameters
qThe right hand side vector
Returns
A reference to the vector.

◆ operator-() [1/2]

Vector2 RVO::Vector2::operator- ( ) const
inline

Unary minus.

Returns
The negation of the vector.

◆ operator-() [2/2]

Vector2 RVO::Vector2::operator- ( const Vector2 q) const
inline

Vector subtraction.

Parameters
qThe right hand side vector
Returns
The vector difference of the lhs vector and the rhs vector.

◆ operator-=()

Vector2& RVO::Vector2::operator-= ( const Vector2 q)
inline

The operator subtracts an rhs vector from the vector.

Parameters
qThe right hand side vector
Returns
A reference to the vector.

◆ operator/()

Vector2 RVO::Vector2::operator/ ( float  a) const
inline

Scalar division.

Parameters
aThe right hand side scalar
Returns
The scalar division of the lhs vector and the rhs scalar.

◆ operator/=()

Vector2& RVO::Vector2::operator/= ( float  a)
inline

The operator divides the vector by a scalar.

Parameters
aThe scalar
Returns
A reference to the vector.

◆ operator==()

bool RVO::Vector2::operator== ( const Vector2 q) const
inline

Vector equality.

Parameters
qThe right hand side vector
Returns
True if the lhs vector and the rhs vector are equal. False otherwise.

◆ x()

float RVO::Vector2::x ( ) const
inline
Returns
The x-component of the vector.

◆ y()

float RVO::Vector2::y ( ) const
inline
Returns
The y-component of the vector.

The documentation for this class was generated from the following file: