RVO::Vector3 Class Reference

Defines a three-dimensional vector. More...

#include <Vector3.h>

List of all members.

Public Member Functions

RVO_API Vector3 ()
 Constructs and initializes a three-dimensional vector instance to zero.
RVO_API Vector3 (const Vector3 &vector)
 Constructs and initializes a three-dimensional vector from the specified three-dimensional vector.
RVO_API Vector3 (float vx, float vy, float vz)
 Constructs and initializes a three-dimensional vector from the specified xyz-coordinates.
RVO_API Vector3 (const float val[3])
 Constructs and initializes a three-dimensional vector from the specified three-element array.
RVO_API bool operator!= (const Vector3 &vector) const
 Tests this three-dimensional vector for inequality with the specified three-dimensional vector.
RVO_API float operator* (const Vector3 &vector) const
 Computes the dot product of this three-dimensional vector with the specified three-dimensional vector.
RVO_API Vector3 operator* (float scalar) const
 Computes the scalar multiplication of this three-dimensional vector with the specified scalar value.
RVO_API Vector3operator*= (float scalar)
 Sets the value of this three-dimensional vector to the scalar multiplication of itself with the specified scalar value.
RVO_API Vector3 operator+ (const Vector3 &vector) const
 Computes the vector sum of this three-dimensional vector with the specified three-dimensional vector.
RVO_API Vector3operator+= (const Vector3 &vector)
 Sets the value of this three-dimensional vector to the vector sum of itself with the specified three-dimensional vector.
RVO_API Vector3 operator- () const
 Computes the negation of this three-dimensional vector.
RVO_API Vector3 operator- (const Vector3 &vector) const
 Computes the vector difference of this three-dimensional vector with the specified three-dimensional vector.
RVO_API Vector3operator-= (const Vector3 &vector)
 Sets the value of this three-dimensional vector to the vector difference of itself with the specified three-dimensional vector.
RVO_API Vector3 operator/ (float scalar) const
 Computes the scalar division of this three-dimensional vector with the specified scalar value.
RVO_API Vector3operator/= (float scalar)
 Sets the value of this three-dimensional vector to the scalar division of itself with the specified scalar value.
RVO_API bool operator== (const Vector3 &vector) const
 Tests this three-dimensional vector for equality with the specified three-dimensional vector.
RVO_API float & operator[] (size_t i)
 Returns a reference to the specified coordinate of this three-dimensional vector.
RVO_API float operator[] (size_t i) const
 Returns the specified coordinate of this three-dimensional vector.
RVO_API float x () const
 Returns the x-coordinate of this three-dimensional vector.
RVO_API float y () const
 Returns the y-coordinate of this three-dimensional vector.
RVO_API float z () const
 Returns the z-coordinate of this three-dimensional vector.

Detailed Description

Defines a three-dimensional vector.


Constructor & Destructor Documentation

RVO_API RVO::Vector3::Vector3 ( ) [inline]

Constructs and initializes a three-dimensional vector instance to zero.

RVO_API RVO::Vector3::Vector3 ( const Vector3 vector) [inline]

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

Parameters:
vectorThe three-dimensional vector containing the xyz-coordinates.
RVO_API RVO::Vector3::Vector3 ( const float  val[3]) [inline, explicit]

Constructs and initializes a three-dimensional vector from the specified three-element array.

Parameters:
valThe three-element array containing the xyz-coordinates.
RVO_API RVO::Vector3::Vector3 ( float  vx,
float  vy,
float  vz 
) [inline]

Constructs and initializes a three-dimensional vector from the specified xyz-coordinates.

Parameters:
vxThe x-coordinate of the three-dimensional vector.
vyThe y-coordinate of the three-dimensional vector.
vzThe z-coordinate of the three-dimensional vector.

Member Function Documentation

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

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

Parameters:
vectorThe three-dimensional vector with which to test for inequality.
Returns:
True if the three-dimensional vectors are not equal.
RVO_API Vector3 RVO::Vector3::operator* ( float  scalar) const [inline]

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

Parameters:
scalarThe scalar value with which the scalar multiplication should be computed.
Returns:
The scalar multiplication of this three-dimensional vector with a specified scalar value.
RVO_API float RVO::Vector3::operator* ( const Vector3 vector) const [inline]

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

Parameters:
vectorThe three-dimensional vector with which the dot product should be computed.
Returns:
The dot product of this three-dimensional vector with a specified three-dimensional vector.
RVO_API Vector3& RVO::Vector3::operator*= ( float  scalar) [inline]

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

Parameters:
scalarThe scalar value with which the scalar multiplication should be computed.
Returns:
A reference to this three-dimensional vector.
RVO_API Vector3 RVO::Vector3::operator+ ( const Vector3 vector) const [inline]

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

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

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

Parameters:
vectorThe three-dimensional vector with which the vector sum should be computed.
Returns:
A reference to this three-dimensional vector.
RVO_API Vector3 RVO::Vector3::operator- ( const Vector3 vector) const [inline]

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

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

Computes the negation of this three-dimensional vector.

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

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

Parameters:
vectorThe three-dimensional vector with which the vector difference should be computed.
Returns:
A reference to this three-dimensional vector.
RVO_API Vector3 RVO::Vector3::operator/ ( float  scalar) const [inline]

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

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

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

Parameters:
scalarThe scalar value with which the scalar division should be computed.
Returns:
A reference to this three-dimensional vector.
RVO_API bool RVO::Vector3::operator== ( const Vector3 vector) const [inline]

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

Parameters:
vectorThe three-dimensional vector with which to test for equality.
Returns:
True if the three-dimensional vectors are equal.
RVO_API float& RVO::Vector3::operator[] ( size_t  i) [inline]

Returns a reference to the specified coordinate of this three-dimensional vector.

Parameters:
iThe coordinate to which a reference should be returned (0 <= i < 3).
Returns:
A reference to the specified coordinate of the three-dimensional vector.
RVO_API float RVO::Vector3::operator[] ( size_t  i) const [inline]

Returns the specified coordinate of this three-dimensional vector.

Parameters:
iThe coordinate that should be returned (0 <= i < 3).
Returns:
The specified coordinate of the three-dimensional vector.
RVO_API float RVO::Vector3::x ( ) const [inline]

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

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

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

Returns:
The y-coordinate of the three-dimensional vector.
RVO_API float RVO::Vector3::z ( ) const [inline]

Returns the z-coordinate of this three-dimensional vector.

Returns:
The z-coordinate of the three-dimensional vector.