Flutter Engine
The Flutter Engine
|
A Vector2, broken down as a separate magnitude and direction. Assumes that the direction given is normalized. More...
#include <separated_vector.h>
Public Member Functions | |
SeparatedVector2 () | |
SeparatedVector2 (Vector2 direction, Scalar magnitude) | |
SeparatedVector2 (Vector2 vector) | |
Vector2 | GetVector () const |
Returns the vector representation of the vector. More... | |
Scalar | GetAlignment (const SeparatedVector2 &other) const |
Radians | AngleTo (const SeparatedVector2 &other) const |
Returns the scalar angle between the two rays. More... | |
Public Attributes | |
Vector2 | direction |
The normalized direction of the vector. More... | |
Scalar | magnitude = 0.0 |
The magnitude of the vector. More... | |
A Vector2, broken down as a separate magnitude and direction. Assumes that the direction given is normalized.
This is a simple convenience struct for handling polyline offset values when generating stroke geometry. For performance reasons, it's sometimes adventageous to track the direction and magnitude for offsets separately.
Definition at line 21 of file separated_vector.h.
|
default |
Definition at line 11 of file separated_vector.cc.
|
explicit |
Definition at line 14 of file separated_vector.cc.
Radians impeller::SeparatedVector2::AngleTo | ( | const SeparatedVector2 & | other | ) | const |
Returns the scalar angle between the two rays.
Definition at line 25 of file separated_vector.cc.
Scalar impeller::SeparatedVector2::GetAlignment | ( | const SeparatedVector2 & | other | ) | const |
Returns the scalar alignment of the two vectors. In other words, the dot product of the two normalized vectors.
Range: [-1, 1] A value of 1 indicates the directions are parallel and pointing in the same direction. A value of -1 indicates the vectors are parallel and pointing in opposite directions. A value of 0 indicates the vectors are perpendicular.
Definition at line 21 of file separated_vector.cc.
Vector2 impeller::SeparatedVector2::GetVector | ( | ) | const |
Returns the vector representation of the vector.
Definition at line 17 of file separated_vector.cc.
Vector2 impeller::SeparatedVector2::direction |
The normalized direction of the vector.
Definition at line 23 of file separated_vector.h.
Scalar impeller::SeparatedVector2::magnitude = 0.0 |
The magnitude of the vector.
Definition at line 26 of file separated_vector.h.