Bromeon
Static Public Member Functions | Public Member Functions
thor::Arrow Class Reference

Drawable arrow class. More...

List of all members.

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.

Detailed Description

Drawable arrow class.

Arrows behave very similar to lines. They can be used to visualize vectors. This class inherits sf::Drawable and sf::Transformable.


Constructor & Destructor Documentation

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:
positionStarting point of the arrow.
directionDirection of the arrow (the vector you want to represent).
colorThe line and triangle color.
thicknessThe line thickness.

Member Function Documentation

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: