JK2eA
 All Classes Functions Variables
Classes | Public Member Functions | Protected Attributes
CControllerPriorityMixer< CntType, ParamType > Class Template Reference

#include <ControllerPriorityMixer.h>

Inheritance diagram for CControllerPriorityMixer< CntType, ParamType >:
Inheritance graph
[legend]
Collaboration diagram for CControllerPriorityMixer< CntType, ParamType >:
Collaboration graph
[legend]

List of all members.

Classes

struct  MIX_NODE

Public Member Functions

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

Protected Attributes

std::vector< MIX_NODEm_controllers
 seznam zaregistrovanych controlleru, serazene podle priority
ParamType m_accumulated_param
 hodnota parametru

Detailed Description

template<class CntType, class ParamType>
class CControllerPriorityMixer< CntType, ParamType >

Slouzi k michani controlleru. Vsechny zaregistrovane controllery jsou serazeny podle priority.
Odstranuje pripadne nedostatky neprioritniho mixeru.

CntType = typ controlleru
ParamType = typ parametru


Constructor & Destructor Documentation

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

Konstruktor

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

Destruktor


Member Function Documentation

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

Ziskani parametru

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

Zjisteni zda jsou v zaregistrovany nejake controllery

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

Normalizace vah, tak aby soucet vsech vah byl 1

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

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.
Controller bude zarazen na misto v seznamu podle sve priority.

Parameters:
cntukazatel na controller
weightukazatel na vahu
prioritypriorita
template<class CntType, class ParamType >
void CControllerPriorityMixer< 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 CControllerPriorityMixer< 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.

Reimplemented in CControllerPriorityMixerSlerp< CntType >.


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