Drawable arrow class.
More...
Inherits Drawable, and Transformable.
|
| Arrow (sf::Vector2f position=sf::Vector2f(), sf::Vector2f direction=sf::Vector2f(), const sf::Color &color=sf::Color::White, float thickness=3.f) |
| (Default) constructor More...
|
|
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.
|
|
void | setStyle (Style style) |
| sets the arrow's visual style (Arrow::Forward by default).
|
|
Style | getStyle () const |
| Returns the arrow's visual style.
|
|
Drawable arrow class.
Arrows behave very similar to lines. They can be used to visualize vectors. This class inherits sf::Drawable and sf::Transformable.
Determines whether the arrow has a triangle on his endpoint.
Enumerator |
---|
Line |
Straight line without any triangles.
|
Forward |
Normal unidirectional arrow.
|
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
- Parameters
-
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).
The documentation for this class was generated from the following file: