My Project
|
a list of CParameter{name, value} pairs of anything. More...
#include <ParameterBlock.h>
Public Types | |
typedef map< string, CParameter >::iterator | ParamIterator |
Public Member Functions | |
ParamIterator | BeginIter () |
ParamIterator | EndIter () |
bool | IsEmpty () |
template<class t > | |
void | SetParameter (const string &sName, const t &value) |
if there is already a parameter with the same name, it will be overridden. More... | |
bool | AddParameter (const CParameter &p) |
add a new parameter to block. More... | |
CParameter * | GetParameter (const string &sName) |
get parameter by its name, NULL will be returned if parameter is not found. More... | |
void | SetParamByStringValue (const char *sParamName, const char *sValue_) |
void | Clear () |
bool | ApplyToEffect (CEffectFile *pEffectFile) |
apply to effect file. More... | |
Public Attributes | |
map< string, CParameter > | m_params |
a list of CParameter{name, value} pairs of anything.
usually used for DirectX effect parameter block. value can be integer, float, vector3, vector4, matrix, TextureEntity, etc. Current the effect parameters can be set via ParaParamBlock interface from the scripting interface. we offer three levels of effect parameters: per effect file, per asset file, per mesh object. Effect parameters are also applied in that order. e.g. per effect file affects all object rendering with the effect file; per asset file affects all objects that use the mesh asset file; per mesh object affects only the mesh object.
bool CParameterBlock::AddParameter | ( | const CParameter & | p | ) |
add a new parameter to block.
if there is already a parameter with the same name, it will be overridden.
bool CParameterBlock::ApplyToEffect | ( | CEffectFile * | pEffectFile | ) |
apply to effect file.
|
inline |
get parameter by its name, NULL will be returned if parameter is not found.
void CParameterBlock::SetParamByStringValue | ( | const char * | sParamName, |
const char * | sValue_ | ||
) |
sParamName | the name of the object to set |
sValue_ | internal name or value string |
|
inline |
if there is already a parameter with the same name, it will be overridden.