Nebula
Loading...
Searching...
No Matches
Math::PFeedbackLoop< TYPE > Class Template Reference

#include <pfeedbackloop.h>

Detailed Description

template<class TYPE>
class Math::PFeedbackLoop< TYPE >

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
 

Constructor & Destructor Documentation

◆ PFeedbackLoop()

template<class TYPE >
Math::PFeedbackLoop< TYPE >::PFeedbackLoop ( )

constructor

Member Function Documentation

◆ GetGain()

template<class TYPE >
float Math::PFeedbackLoop< TYPE >::GetGain ( ) const

get the gain

◆ GetGoal()

template<class TYPE >
const TYPE & Math::PFeedbackLoop< TYPE >::GetGoal ( ) const

get the goal

◆ GetState()

template<class TYPE >
const TYPE & Math::PFeedbackLoop< TYPE >::GetState ( ) const

get the current state the system is in

◆ Reset()

template<class TYPE >
void Math::PFeedbackLoop< TYPE >::Reset ( Timing::Time time,
float stepSize,
float gain,
const TYPE & curState )

reset the time

◆ SetGain()

template<class TYPE >
void Math::PFeedbackLoop< TYPE >::SetGain ( float g)

set the gain

◆ SetGoal()

template<class TYPE >
void Math::PFeedbackLoop< TYPE >::SetGoal ( const TYPE & c)

set the goal

◆ SetState()

template<class TYPE >
void Math::PFeedbackLoop< TYPE >::SetState ( const TYPE & s)

set the current state directly

◆ Update()

template<class TYPE >
void Math::PFeedbackLoop< TYPE >::Update ( Timing::Time time)

update the object, return new state

Member Data Documentation

◆ gain

template<class TYPE >
float Math::PFeedbackLoop< TYPE >::gain
private

◆ goal

template<class TYPE >
TYPE Math::PFeedbackLoop< TYPE >::goal
private

◆ state

template<class TYPE >
TYPE Math::PFeedbackLoop< TYPE >::state
private

◆ stepSize

template<class TYPE >
float Math::PFeedbackLoop< TYPE >::stepSize
private

◆ time

template<class TYPE >
Timing::Time Math::PFeedbackLoop< TYPE >::time
private

The documentation for this class was generated from the following file: