Defines a three-dimensional vector. More...
#include <Vector3.h>
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. More... | |
RVO_API | Vector3 (const float val[3]) |
Constructs and initializes a three-dimensional vector from the specified three-element array. More... | |
RVO_API | Vector3 (float x, float y, float z) |
Constructs and initializes a three-dimensional vector from the specified xyz-coordinates. More... | |
RVO_API float | x () const |
Returns the x-coordinate of this three-dimensional vector. More... | |
RVO_API float | y () const |
Returns the y-coordinate of this three-dimensional vector. More... | |
RVO_API float | z () const |
Returns the z-coordinate of this three-dimensional vector. More... | |
RVO_API float | operator[] (size_t i) const |
Returns the specified coordinate of this three-dimensional vector. More... | |
RVO_API float & | operator[] (size_t i) |
Returns a reference to the specified coordinate of this three-dimensional vector. More... | |
RVO_API Vector3 | operator- () const |
Computes the negation of this three-dimensional vector. More... | |
RVO_API float | operator* (const Vector3 &vector) const |
Computes the dot product of this three-dimensional vector with the specified three-dimensional vector. More... | |
RVO_API Vector3 | operator* (float scalar) const |
Computes the scalar multiplication of this three-dimensional vector with the specified scalar value. More... | |
RVO_API Vector3 | operator/ (float scalar) const |
Computes the scalar division of this three-dimensional vector with the specified scalar value. More... | |
RVO_API Vector3 | operator+ (const Vector3 &vector) const |
Computes the vector sum of this three-dimensional vector with the specified three-dimensional vector. More... | |
RVO_API Vector3 | operator- (const Vector3 &vector) const |
Computes the vector difference of this three-dimensional vector with the specified three-dimensional vector. More... | |
RVO_API bool | operator== (const Vector3 &vector) const |
Tests this three-dimensional vector for equality with the specified three-dimensional vector. More... | |
RVO_API bool | operator!= (const Vector3 &vector) const |
Tests this three-dimensional vector for inequality with the specified three-dimensional vector. More... | |
RVO_API Vector3 & | operator*= (float scalar) |
Sets the value of this three-dimensional vector to the scalar multiplication of itself with the specified scalar value. More... | |
RVO_API Vector3 & | operator/= (float scalar) |
Sets the value of this three-dimensional vector to the scalar division of itself with the specified scalar value. More... | |
RVO_API Vector3 & | operator+= (const Vector3 &vector) |
Sets the value of this three-dimensional vector to the vector sum of itself with the specified three-dimensional vector. More... | |
RVO_API Vector3 & | operator-= (const Vector3 &vector) |
Sets the value of this three-dimensional vector to the vector difference of itself with the specified three-dimensional vector. More... | |
Related Functions | |
(Note that these are not member functions.) | |
Vector3 | operator* (float scalar, const Vector3 &vector) |
Computes the scalar multiplication of the specified three-dimensional vector with the specified scalar value. More... | |
Vector3 | cross (const Vector3 &vector1, const Vector3 &vector2) |
Computes the cross product of the specified three-dimensional vectors. More... | |
std::ostream & | operator<< (std::ostream &os, const Vector3 &vector) |
Inserts the specified three-dimensional vector into the specified output stream. More... | |
float | abs (const Vector3 &vector) |
Computes the length of a specified three-dimensional vector. More... | |
float | absSq (const Vector3 &vector) |
Computes the squared length of a specified three-dimensional vector. More... | |
Vector3 | normalize (const Vector3 &vector) |
Computes the normalization of the specified three-dimensional vector. More... | |
Defines a three-dimensional vector.
|
inline |
Constructs and initializes a three-dimensional vector from the specified three-dimensional vector.
vector | The three-dimensional vector containing the xyz-coordinates. |
|
inlineexplicit |
Constructs and initializes a three-dimensional vector from the specified three-element array.
val | The three-element array containing the xyz-coordinates. |
|
inline |
Constructs and initializes a three-dimensional vector from the specified xyz-coordinates.
x | The x-coordinate of the three-dimensional vector. |
y | The y-coordinate of the three-dimensional vector. |
z | The z-coordinate of the three-dimensional vector. |
|
inline |
Tests this three-dimensional vector for inequality with the specified three-dimensional vector.
vector | The three-dimensional vector with which to test for inequality. |
|
inline |
Computes the dot product of this three-dimensional vector with the specified three-dimensional vector.
vector | The three-dimensional vector with which the dot product should be computed. |
|
inline |
Computes the scalar multiplication of this three-dimensional vector with the specified scalar value.
scalar | The scalar value with which the scalar multiplication should be computed. |
|
inline |
Sets the value of this three-dimensional vector to the scalar multiplication of itself with the specified scalar value.
scalar | The scalar value with which the scalar multiplication should be computed. |
Computes the vector sum of this three-dimensional vector with the specified three-dimensional vector.
vector | The three-dimensional vector with which the vector sum should be computed. |
Sets the value of this three-dimensional vector to the vector sum of itself with the specified three-dimensional vector.
vector | The three-dimensional vector with which the vector sum should be computed. |
|
inline |
Computes the negation of this three-dimensional vector.
Computes the vector difference of this three-dimensional vector with the specified three-dimensional vector.
vector | The three-dimensional vector with which the vector difference should be computed. |
Sets the value of this three-dimensional vector to the vector difference of itself with the specified three-dimensional vector.
vector | The three-dimensional vector with which the vector difference should be computed. |
|
inline |
Computes the scalar division of this three-dimensional vector with the specified scalar value.
scalar | The scalar value with which the scalar division should be computed. |
|
inline |
Sets the value of this three-dimensional vector to the scalar division of itself with the specified scalar value.
scalar | The scalar value with which the scalar division should be computed. |
|
inline |
Tests this three-dimensional vector for equality with the specified three-dimensional vector.
vector | The three-dimensional vector with which to test for equality. |
|
inline |
Returns a reference to the specified coordinate of this three-dimensional vector.
i | The coordinate to which a reference should be returned (0 <= i < 3). |
|
inline |
Returns the specified coordinate of this three-dimensional vector.
i | The coordinate that should be returned (0 <= i < 3). |
|
inline |
Returns the x-coordinate of this three-dimensional vector.
|
inline |
Returns the y-coordinate of this three-dimensional vector.
|
inline |
Returns the z-coordinate of this three-dimensional vector.
|
related |
Computes the length of a specified three-dimensional vector.
vector | The three-dimensional vector whose length is to be computed. |
|
related |
Computes the squared length of a specified three-dimensional vector.
vector | The three-dimensional vector whose squared length is to be computed. |
Computes the cross product of the specified three-dimensional vectors.
vector1 | The first vector with which the cross product should be computed. |
vector2 | The second vector with which the cross product should be computed. |
Computes the normalization of the specified three-dimensional vector.
vector | The three-dimensional vector whose normalization is to be computed. |
Computes the scalar multiplication of the specified three-dimensional vector with the specified scalar value.
scalar | The scalar value with which the scalar multiplication should be computed. |
vector | The three-dimensional vector with which the scalar multiplication should be computed. |
|
related |
Inserts the specified three-dimensional vector into the specified output stream.
os | The output stream into which the three-dimensional vector should be inserted. |
vector | The three-dimensional vector which to insert into the output stream. |