本文整理汇总了C++中PUParticleSystem3D::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ PUParticleSystem3D::addChild方法的具体用法?C++ PUParticleSystem3D::addChild怎么用?C++ PUParticleSystem3D::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PUParticleSystem3D
的用法示例。
在下文中一共展示了PUParticleSystem3D::addChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: translate
void PUTechniqueTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode *node)
{
PUObjectAbstractNode* obj = reinterpret_cast<PUObjectAbstractNode*>(node);
PUObjectAbstractNode* parent = obj->parent ? reinterpret_cast<PUObjectAbstractNode*>(obj->parent) : 0;
// Create the technique
_system = PUParticleSystem3D::create();
//mTechnique = ParticleSystemManager::getSingletonPtr()->createTechnique();
//if (!mTechnique)
//{
// compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
// return;
//}
if (parent && parent->context)
{
PUParticleSystem3D* system = static_cast<PUParticleSystem3D*>(parent->context);
system->addChild(_system);
}
//else
//{
// // It is an alias
// mTechnique->setAliasName(parent->name); // PU 1.4
// ParticleSystemManager::getSingletonPtr()->addAlias(mTechnique);
//}
_system->setName(obj->name);
obj->context = _system; // Add this to the context, because it is needed for the underlying emitters, affectors, ...
// Get the name of the technique
//if(!obj->name.empty())
// mTechnique->setName(obj->name);
for(PUAbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
{
if((*i)->type == ANT_PROPERTY)
{
PUPropertyAbstractNode* prop = reinterpret_cast<PUPropertyAbstractNode*>((*i));
if (prop->name == token[TOKEN_ENABLED])
{
// Property: enabled
if (passValidateProperty(compiler, prop, token[TOKEN_ENABLED], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
_system->setEnabled(val);
}
}
}
else if (prop->name == token[TOKEN_POSITION])
{
// Property: positon
if (passValidateProperty(compiler, prop, token[TOKEN_POSITION], VAL_VECTOR3))
{
Vec3 val;
if(getVector3(prop->values.begin(), prop->values.end(), &val))
{
_system->setPosition3D(val);
}
}
}
else if (prop->name == token[TOKEN_KEEP_LOCAL])
{
// Property: keep_local
if (passValidateProperty(compiler, prop, token[TOKEN_KEEP_LOCAL], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
_system->setKeepLocal(val);
}
}
}
else if (prop->name == token[TOKEN_TECH_VISUAL_PARTICLE_QUOTA])
{
// Property: visual_particle_quota
if (passValidateProperty(compiler, prop, token[TOKEN_TECH_VISUAL_PARTICLE_QUOTA], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
_system->setParticleQuota(val);
}
}
}
else if (prop->name == token[TOKEN_TECH_EMITTED_EMITTER_QUOTA])
{
// Property: emitted_emitter_quota
if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_EMITTER_QUOTA], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
_system->setEmittedEmitterQuota(val);
}
}
}
else if (prop->name == token[TOKEN_TECH_EMITTED_AFFECTOR_QUOTA])
{
//.........这里部分代码省略.........