JK2eA
 All Classes Functions Variables
Public Member Functions | Protected Attributes
CControllerMixer< CntType, ParamType > Class Template Reference
Inheritance diagram for CControllerMixer< CntType, ParamType >:
Inheritance graph
[legend]
Collaboration diagram for CControllerMixer< CntType, ParamType >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CControllerMixer (const std::string &name)
virtual ~CControllerMixer (void)
bool IsEmpty ()
void RegisterController (CntType *cnt, float *weight)
void UnRegisterController (CntType *cnt)
void Normalize ()
ParamType * GetParameter ()
virtual void Update (float dt)
 CNTRL_CLASS_NAME (CControllerMixer)

Protected Attributes

std::vector< std::pair< float
*, CntType * > > 
m_controllers
 seznam zaregistrovanych controlleru
ParamType m_accumulated_param
 hodnota parametru

template<class CntType, class ParamType>
class CControllerMixer< CntType, ParamType >


Constructor & Destructor Documentation

template<class CntType , class ParamType >
CControllerMixer< CntType, ParamType >::CControllerMixer ( const std::string &  name)

Konstruktor

Parameters:
namenazev controlleru
template<class CntType , class ParamType >
CControllerMixer< CntType, ParamType >::~CControllerMixer ( void  ) [virtual]

Destruktor


Member Function Documentation

template<class CntType , class ParamType >
ParamType * CControllerMixer< CntType, ParamType >::GetParameter ( ) [inline]

Ziskani parametru

Returns:
ukazatel na parametr
template<class CntType , class ParamType >
bool CControllerMixer< CntType, ParamType >::IsEmpty ( ) [inline]

Zjisteni zda jsou v zaregistrovany nejake controllery

Returns:
ano, ne
template<class CntType , class ParamType >
void CControllerMixer< CntType, ParamType >::Normalize ( )

Normalizace vah, tak aby soucet vsech vah byl 1

template<class CntType , class ParamType >
void CControllerMixer< CntType, ParamType >::RegisterController ( CntType *  cnt,
float *  weight 
)

Zaregistruje novy controller. Vaha je udavana jako ukazatel, na ktery muze byt navazan jiny controller.
Vaha muze byt vetsi nez 1. Takovy controller prevezme uplnou okntrolu nad hodnotou parametru. (Pokud tedy bude dostatek zbyvajici vahy) Lze registrovat je controllery, ktere maji stejny parametr jako prvni zaregistrovany.

Parameters:
cntukazatel na controller
weightukazatel na vahu
template<class CntType , class ParamType >
void CControllerMixer< CntType, ParamType >::UnRegisterController ( CntType *  cnt)

Odregistruje controller

Parameters:
cntukazatel na controller, ktery ma byt odebran, pokud neexistuje nic se neprovede
template<class CntType , class ParamType >
void CControllerMixer< CntType, ParamType >::Update ( float  dt) [virtual]

Aktualizace controlleru, u vsech controlleru se zavola update a takto nove vznikle hodnoty parametru se linearne smichaji.
Pouziva se zbyvajici vaha, ktera se na zacatku rovna 1 a postupne jak se zprocovavaji controllery se od ni odecita vaha daneho
controlleru. Pokud je vaha = 0, update metoda konci a to i kdyby nebyly zpracovany vsechny controllery.

Parameters:
dt

Implements CController.


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