|
Nebula
|
#include <pfeedbackloop.h>
A P feedback loop (proportional feedback loop) is a simple object which moves a system's current state towards a goal, using the resulting error (difference between goal and state as feedback on the next run.
If you need to implement motion controllers, camera controllers, etc... then the feedback loop is your friend.
See Game Developer Mag issue June/July 2004.
Public Member Functions | |
| PFeedbackLoop () | |
| constructor | |
| void | Reset (Timing::Time time, float stepSize, float gain, const TYPE &curState) |
| reset the time | |
| void | SetGain (float g) |
| set the gain | |
| float | GetGain () const |
| get the gain | |
| void | SetGoal (const TYPE &c) |
| set the goal | |
| const TYPE & | GetGoal () const |
| get the goal | |
| void | SetState (const TYPE &s) |
| set the current state directly | |
| const TYPE & | GetState () const |
| get the current state the system is in | |
| void | Update (Timing::Time time) |
| update the object, return new state | |
Private Attributes | |
| Timing::Time | time |
| float | stepSize |
| float | gain |
| TYPE | goal |
| TYPE | state |
| Math::PFeedbackLoop< TYPE >::PFeedbackLoop | ( | ) |
constructor
| float Math::PFeedbackLoop< TYPE >::GetGain | ( | ) | const |
get the gain
| const TYPE & Math::PFeedbackLoop< TYPE >::GetGoal | ( | ) | const |
get the goal
| const TYPE & Math::PFeedbackLoop< TYPE >::GetState | ( | ) | const |
get the current state the system is in
| void Math::PFeedbackLoop< TYPE >::Reset | ( | Timing::Time | time, |
| float | stepSize, | ||
| float | gain, | ||
| const TYPE & | curState ) |
reset the time
| void Math::PFeedbackLoop< TYPE >::SetGain | ( | float | g | ) |
set the gain
| void Math::PFeedbackLoop< TYPE >::SetGoal | ( | const TYPE & | c | ) |
set the goal
| void Math::PFeedbackLoop< TYPE >::SetState | ( | const TYPE & | s | ) |
set the current state directly
| void Math::PFeedbackLoop< TYPE >::Update | ( | Timing::Time | time | ) |
update the object, return new state
|
private |
|
private |
|
private |
|
private |
|
private |