TossableRNTStrategy Class Reference

#include <TossableRNTStrategy.h>

Inherits RNTStrategy.

Inheritance diagram for TossableRNTStrategy:

Inheritance graph
[legend]
Collaboration diagram for TossableRNTStrategy:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

This strategy extends RNT to allow the associated component to be tossed. It adds the behavior of the TossableStrategy to the RNTStrategy. In this way, when the object is tossed, it moves following a RNT transformation.

Author:
Fabricio Anastacio - fabriciocfa@yahoo.com


Constructor & Destructor Documentation

TossableRNTStrategy::TossableRNTStrategy ( void   ) 

Constructs a tossable RNT strategy.

TossableRNTStrategy::~TossableRNTStrategy ( void   ) 

Destroys this strategy.


Member Function Documentation

bool TossableRNTStrategy::isTossing (  )  [inline]

Returns true if the component is being tossed.

Returns:
true if the component is being tossed, false otherwise.

void TossableRNTStrategy::setTossing ( bool  value  )  [inline]

Sets if the component is being tossed.

Parameters:
value true if the component is being tossed, false otherwise.

float TossableRNTStrategy::getCurrentFriction (  )  [inline]

Returns the current dynamic friction coefficient being used when tossing.

Returns:
the current dynamic friction coefficient.

void TossableRNTStrategy::setCurrentFriction ( float  coeff  )  [inline]

Sets the current dynamic friction coefficient being used when tossing.

Parameters:
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.

Returns:
the default dynamic friction coefficient.

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.

Parameters:
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.

Returns:
the default static friction coefficient.

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.

Parameters:
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.

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.

Parameters:
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]

Handles the given event.

Parameters:
evt the event to be handled.

Reimplemented from RNTStrategy.

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.

Parameters:
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.


Member Data Documentation

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.


The documentation for this class was generated from the following files:
Generated on Fri Dec 21 17:46:10 2007 for LargeDisplayFrameworkToolkit by  doxygen 1.5.2