#include <TossableRNTStrategy.h>
Inherits RNTStrategy.
Inheritance diagram for TossableRNTStrategy:
Public Member Functions | |
TossableRNTStrategy (void) | |
~TossableRNTStrategy (void) | |
bool | isTossing () |
void | setTossing (bool value) |
float | getCurrentFriction () |
void | setCurrentFriction (float coeff) |
float | getFrictionCoefficient () |
void | setFrictionCoefficient (float coeff) |
float | getStaticFrictionCoefficient () |
void | setStaticFrictionCoefficient (float coeff) |
float | getTossingCutoff () |
void | setTossingCutoff (float value) |
Protected Member Functions | |
void | initProperties () |
void | process () |
void | onEvent (LargeDisplayEvent *evt) |
void | readPassiveBuffers (const std::vector< unsigned int > &types) |
void | readAllPassiveBuffers () |
Protected Attributes | |
std::queue< Point3f > | recentPositions |
unsigned int | nPositions |
bool | tossing |
float | currentFriction |
float | frictionCoefficient |
float | staticFrictionCoefficient |
float | tossingCutoff |
Vector2f | tossingVector |
Vector2f | initVector |
double | initAngle |
unsigned int | frictionBufferType |
TossableRNTStrategy::TossableRNTStrategy | ( | void | ) |
Constructs a tossable RNT strategy.
TossableRNTStrategy::~TossableRNTStrategy | ( | void | ) |
Destroys this strategy.
bool TossableRNTStrategy::isTossing | ( | ) | [inline] |
Returns true if the component is being tossed.
void TossableRNTStrategy::setTossing | ( | bool | value | ) | [inline] |
Sets if the component is being tossed.
value | true if the component is being tossed, false otherwise. |
float TossableRNTStrategy::getCurrentFriction | ( | ) | [inline] |
Returns the current dynamic friction coefficient being used when tossing.
void TossableRNTStrategy::setCurrentFriction | ( | float | coeff | ) | [inline] |
Sets the current dynamic friction coefficient being used when tossing.
coeff | the value to be set as the current dynamic friction coefficient. |
float TossableRNTStrategy::getFrictionCoefficient | ( | ) | [inline] |
Returns the default dynamic friction coefficient being used when tossing. This value is used when the parent component does not have a friction buffer.
void TossableRNTStrategy::setFrictionCoefficient | ( | float | coeff | ) | [inline] |
Sets the default dynamic friction coefficient being used when tossing. This value is used when the parent component does not have a friction buffer.
coeff | the value to be set as the default dynamic friction coefficient. |
float TossableRNTStrategy::getStaticFrictionCoefficient | ( | ) | [inline] |
Returns the default static friction coefficient being used when tossing. This value is used when the parent component does not have a friction buffer.
void TossableRNTStrategy::setStaticFrictionCoefficient | ( | float | coeff | ) | [inline] |
Sets the default static friction coefficient being used when tossing. This value is used when the parent component does not have a friction buffer.
coeff | the value to be set as the default static friction coefficient. |
float TossableRNTStrategy::getTossingCutoff | ( | ) | [inline] |
Returns the minimum strength the tossing vector should have to move a component.
void TossableRNTStrategy::setTossingCutoff | ( | float | value | ) | [inline] |
Sets the value of the minimum strength the tossing vector should have to move a component.
value | the value to be set as the minimum strength the tossing vector should have to move a component. |
void TossableRNTStrategy::initProperties | ( | ) | [protected] |
Initializes the properties (i. e., i-buffers) of the associated component.
Reimplemented from RNTStrategy.
void TossableRNTStrategy::process | ( | ) | [protected] |
Performs a given action before rendering the component.
void TossableRNTStrategy::onEvent | ( | LargeDisplayEvent * | evt | ) | [protected] |
void TossableRNTStrategy::readPassiveBuffers | ( | const std::vector< unsigned int > & | types | ) | [inline, protected] |
Reads the passive buffer(s) specified by the parameter 'type' and makes the proper updates in the state of the associated component.
type | the type of buffer that should be read from the container. |
Reimplemented from RNTStrategy.
void TossableRNTStrategy::readAllPassiveBuffers | ( | ) | [inline, protected] |
Reads all the passive buffers for a component strategy. This method is called before drawing the component in order to update its state/properties.
Reimplemented from RNTStrategy.
std::queue<Point3f> TossableRNTStrategy::recentPositions [protected] |
Collection of recent cursor positions.
unsigned int TossableRNTStrategy::nPositions [protected] |
Number of cursor positions to keep track in the list.
bool TossableRNTStrategy::tossing [protected] |
Determines if the associated component is being tossed at the moment.
float TossableRNTStrategy::currentFriction [protected] |
The current dynamic friction coefficient.
float TossableRNTStrategy::frictionCoefficient [protected] |
Determines the standart dynamic friction coefficent to be used when tossing. It is used when the parent component does not have a friction buffer.
float TossableRNTStrategy::staticFrictionCoefficient [protected] |
Determines the standart static friction coefficent to be used when tossing. It determines the strenght (length) of the tossing vector necessary to start a tossing movement.
float TossableRNTStrategy::tossingCutoff [protected] |
The minimum strength the tossing vector should have to move a component. It is compared to the value of the length of the tossing vector.
Vector2f TossableRNTStrategy::tossingVector [protected] |
The vector representing the "tossing force".
Vector2f TossableRNTStrategy::initVector [protected] |
The vector between the center of component and the contact point when the component is released and the tossing RNT movement starts.
double TossableRNTStrategy::initAngle [protected] |
The rotation angle of the component when it is released and the tossing RNT movement starts.
unsigned int TossableRNTStrategy::frictionBufferType [protected] |
Friction buffer type identifier.