![]() |
Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Templated vector in R3. More...
#include <Vector3.h>
Public Member Functions | |
| Vector3d () | |
| Default constructor. It does NOT initialize the fields. | |
| Vector3d (Type x, Type y, Type z) | |
| Constructor with arguments. More... | |
| Vector3d (const Vector3d &v) | |
| Copy constructor. More... | |
| Type | x () const |
| Get the x-value. More... | |
| Type | y () const |
| Get the y-value. More... | |
| Type | z () const |
| Get the z-value. More... | |
| void | set (Type x, Type y, Type z) |
| Set the x- and y-values from scalar values. More... | |
| void | set (const Vector3d &v) |
| Set the x-, y- and z-values from a vector. More... | |
| void | setX (Type x) |
| Set the x-value. More... | |
| void | setY (Type y) |
| Set the y-value. More... | |
| void | setZ (Type z) |
| Set the z-value. More... | |
| Type | operator[] (const int i) const |
| Index-style access to vector components. More... | |
| Type & | operator[] (const int i) |
| Index-style access to vector components as a reference. More... | |
| void | zero () |
| Set the vector to zero. | |
| Vector3d< Type > | operator- () const |
| Vector negation. Creates a new vector which is the negation of this vector. More... | |
| float | operator* (const Vector3d &v) const |
| Computes the dot product of this vector with the given vector. More... | |
| Vector3d< Type > | operator* (float s) const |
| Computes the scalar multiplication of this vector with the given scalar value. More... | |
| Vector3d< Type > | operator/ (float s) const |
| Computes the scalar division of this vector with the given scalar value. More... | |
| Vector3d | operator+ (const Vector3d &v) const |
| Computes the vector sum of this vector with the given vector. More... | |
| Vector3d | operator- (const Vector3d &v) const |
| Computes the vector difference of this vector with the given vector. More... | |
| bool | operator== (const Vector3d &v) const |
| Reports if this vector is the same as the given vector. More... | |
| bool | operator!= (const Vector3d &v) const |
| Reports if this vector is the different from the given vector. More... | |
| Vector3d & | operator*= (float s) |
| Perform in-place scalar multiplication on this vector. More... | |
| Vector3d & | operator/= (float s) |
| Perform in-place scalar division on this vector. More... | |
| Vector3d & | operator+= (const Vector3d &v) |
| Perform in-place vector addition on this vector. More... | |
| Vector3d & | operator-= (const Vector3d &v) |
| Perform in-place vector subtraction on this vector. More... | |
| void | negate () |
| Negate the vector in place. | |
| void | normalize () |
| Normalize the vector in place. | |
| void | SumScale (Type s, const Vector3d &v) |
| Adds in a scaled version of another vector this += s * v. More... | |
| Vector3d | rotateX (float angle) const |
| Rotate the vector around the x axis. More... | |
| Vector3d | rotateY (float angle) const |
| Rotate the vector around the y axis. More... | |
| Vector3d | rotateZ (float angle) const |
| Rotate the vector around the z axis. More... | |
| Vector3d | rotateV (Type angle, const Vector3d &v) const |
| Rotate the vector around an arbitrary vector. More... | |
| void | rotateV_ip (Type angle, const Vector3d &v) |
| Rotate the vector around an arbitrary vector - change the vector in place. More... | |
| Type | Length () const |
| Compute the magnitude (aka length) of the vector. More... | |
| Vector3d | cross (const Vector3d< Type > &v) |
| Cross product of this vector with the given vector this x v. More... | |
| float | distance (const Vector3d &p) const |
| Compute the distance from this vector to another point. More... | |
| float | distance (float x, float y, float z) const |
| Compute the distance from this vector to another point. More... | |
| float | distanceSq (const Vector3d &p) const |
| Compute the squared-distance from this vector to another point. More... | |
| float | distanceSq (float x, float y, float z) const |
| Compute the squared-distance from this vector to another point. More... | |
Public Attributes | |
| Type | _x |
| x-component of the vector | |
| Type | _y |
| y-component of the vector | |
| Type | _z |
| z-component of the vector | |
Templated vector in R3.
|
inline |
Constructor with arguments.
| x | The vector's x-component. |
| y | The vector's y-component. |
| z | The vector's z-component. |
|
inline |
Copy constructor.
| v | The vector to copy from. |
|
inline |
Cross product of this vector with the given vector this x v.
| v | The second opearand. |
|
inline |
Compute the distance from this vector to another point.
| p | The point whose distance from this vector (interpreted as a point) is to be computed |
|
inline |
Compute the distance from this vector to another point.
| x | The x-value of the other point. |
| y | The y-value of the other point. |
| z | The z-value of the other point. |
|
inline |
Compute the squared-distance from this vector to another point.
| p | The point whose distance from this vector (interpreted as a point) is to be computed |
|
inline |
Compute the squared-distance from this vector to another point.
| x | The x-value of the other point. |
| y | The y-value of the other point. |
| z | The z-value of the other point. |
|
inline |
Compute the magnitude (aka length) of the vector.
|
inline |
Reports if this vector is the different from the given vector.
| v | The second operand. |
|
inline |
Computes the dot product of this vector with the given vector.
| v | The with which the dot product should be computed. |
|
inline |
Computes the scalar multiplication of this vector with the given scalar value.
| s | The scalar value |
|
inline |
Perform in-place scalar multiplication on this vector.
| s | The scalar mutliplicand. |
|
inline |
Computes the vector sum of this vector with the given vector.
| v | The second operand. |
|
inline |
Perform in-place vector addition on this vector.
| v | The second vector operand. |
|
inline |
Vector negation. Creates a new vector which is the negation of this vector.
|
inline |
Computes the vector difference of this vector with the given vector.
| v | The second operand. |
|
inline |
Perform in-place vector subtraction on this vector.
| v | The second vector operand. |
|
inline |
Computes the scalar division of this vector with the given scalar value.
| s | The scalar value |
|
inline |
Perform in-place scalar division on this vector.
| s | The scalar divisor. |
|
inline |
Reports if this vector is the same as the given vector.
| v | The second operand. |
|
inline |
Index-style access to vector components.
| i | The index of the desired component. Sould be in the range [0, 2]. |
|
inline |
Index-style access to vector components as a reference.
| i | The index of the desired component. Sould be in the range [0, 2]. |
|
inline |
Rotate the vector around an arbitrary vector.
| angle | The amoutn of rotations (in radians) |
| v | The axis of rotation - it should be normalized |
|
inline |
Rotate the vector around an arbitrary vector - change the vector in place.
| angle | The amoutn of rotations (in radians) |
| v | The axis of rotation - it should be normalized |
|
inline |
Rotate the vector around the x axis.
| angle | The amoutn of rotations (in radians) |
|
inline |
Rotate the vector around the y axis.
| angle | The amoutn of rotations (in radians) |
|
inline |
Rotate the vector around the z axis.
| angle | The amoutn of rotations (in radians) |
|
inline |
Set the x- and y-values from scalar values.
| x | The value for the x-component |
| y | The value for the y-component |
| z | The value for the z-component |
|
inline |
Set the x-, y- and z-values from a vector.
| v | The vector containing the newvalues |
|
inline |
Set the x-value.
| x | The x-value. |
|
inline |
Set the y-value.
| y | The y-value. |
|
inline |
Set the z-value.
| z | The z-value. |
|
inline |
Adds in a scaled version of another vector this += s * v.
| s | The scale factor for the vector v |
| v | The vector to scale |
|
inline |
Get the x-value.
|
inline |
Get the y-value.
|
inline |
Get the z-value.
1.8.8