本文整理汇总了C++中PropertyMap::constructPropertyMap方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyMap::constructPropertyMap方法的具体用法?C++ PropertyMap::constructPropertyMap怎么用?C++ PropertyMap::constructPropertyMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyMap
的用法示例。
在下文中一共展示了PropertyMap::constructPropertyMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addParticleSystemNode
IParticleSystemSceneNode* IrrFactory::addParticleSystemNode( const std::string& particleSystemFile )
{
PropertyMap propMap;
if( propMap.constructPropertyMap( SimFactory::TransformPath(particleSystemFile) ) )
{
// default values
const vector3df pos( 0, 0, 0 );
const vector3df rot( 0, 0, 0 );
const vector3df scale( 1, 1, 1 );
// create the particle system node
IParticleSystemSceneNode* pSystem = mIrr.getSceneManager()->addParticleSystemSceneNode( false, 0, -1, pos, rot, scale );
Assert( pSystem );
// read some custom properties
bool globalMovement = true;
dimension2df particleSize( 5.0f, 5.0f );
propMap.getValue( globalMovement, "ParticleSystem.System.GlobalMovement" );
propMap.getValue( particleSize, "ParticleSystem.System.ParticleSize" );
pSystem->setParticlesAreGlobal(globalMovement);
pSystem->setParticleSize(particleSize);
/// ---- load the effectors ----
// get the gravity properties
if( propMap.hasSection( "ParticleSystem.Gravity" ) )
{
vector3df gravDir( 0, -1, 0 );
uint32_t affectorTimeMS(1000);
// try to read params
propMap.getValue( gravDir, "ParticleSystem.Gravity.Direction" );
propMap.getValue( affectorTimeMS, "ParticleSystem.Gravity.AffectorTimeMS" );
gravDir = ConvertNeroToIrrlichtPosition(gravDir);
IParticleAffector* pGravity = pSystem->createGravityAffector( gravDir, affectorTimeMS );
Assert( pGravity );
pSystem->addAffector( pGravity );
pGravity->drop();
}
// get the fade properties
if( propMap.hasSection( "ParticleSystem.Fade" ) )
{
SColor targetColor(0,0,0,0);
uint32_t affectorTimeMS(1000);
// try to read params
propMap.getValue( targetColor, "ParticleSystem.Fade.TargetColor" );
propMap.getValue( affectorTimeMS, "ParticleSystem.Fade.AffectorTimeMS" );
IParticleAffector* pFade = pSystem->createFadeOutParticleAffector( targetColor, affectorTimeMS );
Assert( pFade );
pSystem->addAffector( pFade );
pFade->drop();
}
// ---- load the emitters ----
// --- NOTE: WE ONLY DO BOX EMITTERS ---
if( propMap.hasSection( "ParticleSystem.Emitter" ) )
{
// default params
aabbox3df box(-10, 28,-10, 10, 30, 10);
vector3df dir( 0, .03f, 0 );
uint32_t minParticlesPerSecond = 5;
uint32_t maxParticlesPerSecond = 10;
SColor minStartColor( 255, 0, 0, 0 );
SColor maxStartColor( 255, 255, 255, 255 );
uint32_t lifeTimeMin = 2000;
uint32_t lifeTimeMax = 4000;
int32_t maxAngleDegrees = 0;
// try to read custom params
propMap.getValue( box, "ParticleSystem.Emitter.Box" );
propMap.getValue( dir, "ParticleSystem.Emitter.Direction" );
propMap.getValue( minParticlesPerSecond, "ParticleSystem.Emitter.MinParticlesPerSecond" );
propMap.getValue( maxParticlesPerSecond, "ParticleSystem.Emitter.MaxParticlesPerSecond" );
propMap.getValue( minStartColor, "ParticleSystem.Emitter.MinStartColor" );
propMap.getValue( maxStartColor, "ParticleSystem.Emitter.MaxStartColor" );
propMap.getValue( lifeTimeMin, "ParticleSystem.Emitter.LifetimeMin" );
propMap.getValue( lifeTimeMax, "ParticleSystem.Emitter.LifetimeMax" );
propMap.getValue( maxAngleDegrees, "ParticleSystem.Emitter.MaxAngleDegrees" );
// do coordinate system transformations
dir = ConvertNeroToIrrlichtPosition(dir);
// create the emitter
IParticleEmitter* emit = pSystem->createBoxEmitter
( box,
dir,
minParticlesPerSecond,
//.........这里部分代码省略.........