Drawable arrow class. More...
Static Public Member Functions | |
static void | SetZeroVectorTolerance (float tolerance) |
Specifies the zero length tolerance. | |
static float | GetZeroVectorTolerance () |
Returns the zero length tolerance. | |
Public Member Functions | |
Arrow (sf::Vector2f position=sf::Vector2f(), sf::Vector2f direction=sf::Vector2f(), const sf::Color &color=sf::Color::White, float thickness=3.f) | |
(Default) constructor | |
void | SetDirection (sf::Vector2f direction) |
Aligns the arrow so that it points to the given direction. | |
void | SetDirection (float dirX, float dirY) |
Aligns the arrow so that it points to the given direction. | |
sf::Vector2f | GetDirection () const |
Returns the arrow's direction. | |
void | SetThickness (float thickness) |
Sets the arrow's thickness (3.f by default). | |
float | GetThickness () const |
Returns the arrow's thickness. | |
void | SetColor (const sf::Color &color) |
Sets the arrow color. | |
sf::Color | GetColor () const |
Returns the arrow color. |
Drawable arrow class.
Arrows behave very similar to lines. They can be used to visualize vectors. This class inherits sf::Drawable and sf::Transformable.
thor::Arrow::Arrow | ( | sf::Vector2f | position = sf::Vector2f() , |
sf::Vector2f | direction = sf::Vector2f() , |
||
const sf::Color & | color = sf::Color::White , |
||
float | thickness = 3.f |
||
) | [explicit] |
(Default) constructor
position | Starting point of the arrow. |
direction | Direction of the arrow (the vector you want to represent). |
color | The line and triangle color. |
thickness | The line thickness. |
static float thor::Arrow::GetZeroVectorTolerance | ( | ) | [static] |
Returns the zero length tolerance.
The tolerance is the bound, below which a vector is considered a zero vector.
static void thor::Arrow::SetZeroVectorTolerance | ( | float | tolerance | ) | [static] |
Specifies the zero length tolerance.
All arrows shorter than tolerance are represented as zero vectors (i.e. by circles).