Public Member Functions

RVO::Vector2 Class Reference

Defines a two-dimensional vector. More...

#include <Vector2.h>

List of all members.

Public Member Functions

 Vector2 ()
 Constructs and initializes a two-dimensional vector instance to (0.0, 0.0).
 Vector2 (const Vector2 &vector)
 Constructs and initializes a two-dimensional vector from the specified two-dimensional vector.
 Vector2 (float x, float y)
 Constructs and initializes a two-dimensional vector from the specified xy-coordinates.
 ~Vector2 ()
 Destroys this two-dimensional vector instance.
bool operator!= (const Vector2 &vector) const
 Tests this two-dimensional vector for inequality with the specified two-dimensional vector.
float operator* (const Vector2 &vector) const
 Computes the dot product of this two-dimensional vector with the specified two-dimensional vector.
Vector2 operator* (float s) const
 Computes the scalar multiplication of this two-dimensional vector with the specified scalar value.
Vector2operator*= (float s)
 Sets the value of this two-dimensional vector to the scalar multiplication of itself with the specified scalar value.
Vector2 operator+ (const Vector2 &vector) const
 Computes the vector sum of this two-dimensional vector with the specified two-dimensional vector.
Vector2operator+= (const Vector2 &vector)
 Sets the value of this two-dimensional vector to the vector sum of itself with the specified two-dimensional vector.
Vector2 operator- (const Vector2 &vector) const
 Computes the vector difference of this two-dimensional vector with the specified two-dimensional vector.
Vector2 operator- () const
 Computes the negation of this two-dimensional vector.
Vector2operator-= (const Vector2 &vector)
 Sets the value of this two-dimensional vector to the vector difference of itself with the specified two-dimensional vector.
Vector2 operator/ (float s) const
 Computes the scalar division of this two-dimensional vector with the specified scalar value.
Vector2operator/= (float s)
 Sets the value of this two-dimensional vector to the scalar division of itself with the specified scalar value.
bool operator== (const Vector2 &vector) const
 Tests this two-dimensional vector for equality with the specified two-dimensional vector.
float x () const
 Returns the x-coordinate of this two-dimensional vector.
float y () const
 Returns the y-coordinate of this two-dimensional vector.

Detailed Description

Defines a two-dimensional vector.


Constructor & Destructor Documentation

RVO::Vector2::Vector2 (  )  [inline]

Constructs and initializes a two-dimensional vector instance to (0.0, 0.0).

RVO::Vector2::Vector2 ( const Vector2 vector  )  [inline]

Constructs and initializes a two-dimensional vector from the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector containing the xy-coordinates.
RVO::Vector2::Vector2 ( float  x,
float  y 
) [inline]

Constructs and initializes a two-dimensional vector from the specified xy-coordinates.

Parameters:
x The x-coordinate of the two-dimensional vector.
y The y-coordinate of the two-dimensional vector.
RVO::Vector2::~Vector2 (  )  [inline]

Destroys this two-dimensional vector instance.


Member Function Documentation

bool RVO::Vector2::operator!= ( const Vector2 vector  )  const [inline]

Tests this two-dimensional vector for inequality with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which to test for inequality.
Returns:
True if the two-dimensional vectors are not equal.
float RVO::Vector2::operator* ( const Vector2 vector  )  const [inline]

Computes the dot product of this two-dimensional vector with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which the dot product should be computed.
Returns:
The dot product of this two-dimensional vector with a specified two-dimensional vector.
Vector2 RVO::Vector2::operator* ( float  s  )  const [inline]

Computes the scalar multiplication of this two-dimensional vector with the specified scalar value.

Parameters:
s The scalar value with which the scalar multiplication should be computed.
Returns:
The scalar multiplication of this two-dimensional vector with a specified scalar value.
Vector2& RVO::Vector2::operator*= ( float  s  )  [inline]

Sets the value of this two-dimensional vector to the scalar multiplication of itself with the specified scalar value.

Parameters:
s The scalar value with which the scalar multiplication should be computed.
Returns:
A reference to this two-dimensional vector.
Vector2 RVO::Vector2::operator+ ( const Vector2 vector  )  const [inline]

Computes the vector sum of this two-dimensional vector with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which the vector sum should be computed.
Returns:
The vector sum of this two-dimensional vector with a specified two-dimensional vector.
Vector2& RVO::Vector2::operator+= ( const Vector2 vector  )  [inline]

Sets the value of this two-dimensional vector to the vector sum of itself with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which the vector sum should be computed.
Returns:
A reference to this two-dimensional vector.
Vector2 RVO::Vector2::operator- ( const Vector2 vector  )  const [inline]

Computes the vector difference of this two-dimensional vector with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which the vector difference should be computed.
Returns:
The vector difference of this two-dimensional vector with a specified two-dimensional vector.
Vector2 RVO::Vector2::operator- (  )  const [inline]

Computes the negation of this two-dimensional vector.

Returns:
The negation of this two-dimensional vector.
Vector2& RVO::Vector2::operator-= ( const Vector2 vector  )  [inline]

Sets the value of this two-dimensional vector to the vector difference of itself with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which the vector difference should be computed.
Returns:
A reference to this two-dimensional vector.
Vector2 RVO::Vector2::operator/ ( float  s  )  const [inline]

Computes the scalar division of this two-dimensional vector with the specified scalar value.

Parameters:
s The scalar value with which the scalar division should be computed.
Returns:
The scalar division of this two-dimensional vector with a specified scalar value.
Vector2& RVO::Vector2::operator/= ( float  s  )  [inline]

Sets the value of this two-dimensional vector to the scalar division of itself with the specified scalar value.

Parameters:
s The scalar value with which the scalar division should be computed.
Returns:
A reference to this two-dimensional vector.
bool RVO::Vector2::operator== ( const Vector2 vector  )  const [inline]

Tests this two-dimensional vector for equality with the specified two-dimensional vector.

Parameters:
vector The two-dimensional vector with which to test for equality.
Returns:
True if the two-dimensional vectors are equal.
float RVO::Vector2::x (  )  const [inline]

Returns the x-coordinate of this two-dimensional vector.

Returns:
The x-coordinate of the two-dimensional vector.
float RVO::Vector2::y (  )  const [inline]

Returns the y-coordinate of this two-dimensional vector.

Returns:
The y-coordinate of the two-dimensional vector.