Stateless VectorMath class utilizing static methods to manipulate vectors.
Copies of Vector2 are cheap, therefore all functions are "pass by value" at this time.
More...
#include <VectorMath.hpp>
|
static Vector2 | componentProduct (Vector2 a, Vector2 b) |
| A static method returning a vector that is the component product of two vectors.
|
|
static Vector2 | truncate (Vector2 v, float max) |
| A static method returning a truncated vector based on some maximum value.
|
|
static float | dotProduct (Vector2 a, Vector2 b) |
| A static method returning the dot product of two vectors.
|
|
static Vector2 | perpendicular (Vector2 a) |
| A static method returning a vector that is perpendicular to the vector supplied.
|
|
static Vector2 | direction (Vector2 a, Vector2 b) |
| A static method returning the directional vector that vector a needs to be transformed to in order to point towards vector b.
|
|
static float | distance (Vector2 a, Vector2 b) |
| A static method returning the distance between two given vectors, a and b.
|
|
static float | distanceSquared (Vector2 a, Vector2 b) |
| A static method returning the distance squared between two given vectors, a and b - avoids the overhead of sqrt when necessary.
|
|
static float | findAngle (Vector2 v) |
| A static method returning the angle resolved from a vector (pass in vector1 - vector2 or a precomputed vector) - useful for finding the angle of a target, for example.
Internally, this function converts from radians to degrees so you don't have to.
|
|
static float | length (Vector2 v) |
| A static method returning the length (or magnitude) of a vector.
|
|
static float | lengthSquared (Vector2 v) |
| A static method returning the squared length of a vector.
|
|
static Vector2 | normalize (Vector2 v) |
| A static method returning a normalized (or unit) vector.
|
|
static bool | lineIntersectsCircle (Vector2 ahead, Vector2 ahead2, SphereObstacle obstacle, Vector2 agentPosition) |
| A static method returning a boolean to test whether a vector intersects a circle.
|
|
Stateless VectorMath class utilizing static methods to manipulate vectors.
Copies of Vector2 are cheap, therefore all functions are "pass by value" at this time.
A static method returning the directional vector that vector a needs to be transformed to in order to point towards vector b.
- See Also
- static Vector2 direction(Vector2 a, Vector2 b)
- Parameters
-
a | - a vector of doubles. |
b | - a vector of doubles. |
A static method returning the distance between two given vectors, a and b.
- See Also
- static float distance(Vector2 a, Vector2 b)
- Parameters
-
a | - a vector of doubles. |
b | - a vector of doubles. |
A static method returning the distance squared between two given vectors, a and b - avoids the overhead of sqrt when necessary.
- See Also
- static float distanceSquared(Vector2 a, Vector2 b)
- Parameters
-
a | - a vector of doubles. |
b | - a vector of doubles. |
A static method returning the dot product of two vectors.
- See Also
- static float dotProduct(Vector2 a, Vector2 b)
- Parameters
-
a | - a vector of doubles. |
b | - a vector of doubles. |
float steer::VectorMath::findAngle |
( |
Vector2 |
v | ) |
|
|
static |
A static method returning the angle resolved from a vector (pass in vector1 - vector2 or a precomputed vector) - useful for finding the angle of a target, for example.
Internally, this function converts from radians to degrees so you don't have to.
- See Also
- static float findAngle(Vector2 v)
- Parameters
-
float steer::VectorMath::length |
( |
Vector2 |
v | ) |
|
|
static |
A static method returning the length (or magnitude) of a vector.
- See Also
- static float length(Vector2 v)
- Parameters
-
float steer::VectorMath::lengthSquared |
( |
Vector2 |
v | ) |
|
|
static |
A static method returning a boolean to test whether a vector intersects a circle.
- See Also
- static Vector2 lineIntersectsCircle(Vector2 ahead, Vector2 ahead2, SphereObstacle obstacle)
- Parameters
-
A static method returning a truncated vector based on some maximum value.
- See Also
- static Vector2 truncate(Vector2 v, float max)
- Parameters
-
a | - a vector of doubles. |
max | - a plain old float. |
The documentation for this class was generated from the following files: