//-------------------------------------------------------------------------
	void ExternTranslator::translate(ScriptCompiler* compiler, const AbstractNodePtr &node)
	{
		ObjectAbstractNode* obj = reinterpret_cast<ObjectAbstractNode*>(node.get());
		ObjectAbstractNode* parent = obj->parent ? reinterpret_cast<ObjectAbstractNode*>(obj->parent) : 0;

		// The name of the obj is the type of the Extern
		// Remark: This can be solved by using a listener, so that obj->values is filled with type + name. Something for later
		String type;
		if(!obj->name.empty())
		{
			type = obj->name;
		}
		else
		{
			compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
			return;
		}

		// Get the factory
		ExternFactory* externFactory = ParticleSystemManager::getSingletonPtr()->getExternFactory(type);
		if (!externFactory)
		{
			compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
			return;
		}

		// Create the Extern
		mExtern = ParticleSystemManager::getSingletonPtr()->createExtern(type);
		if (!mExtern)
		{
			compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
			return;
		}

		if (!obj->parent->context.isEmpty())
		{
			ParticleTechnique* technique = any_cast<ParticleTechnique*>(obj->parent->context);
			technique->addExtern(mExtern);
		}
		else
		{
			// It is an alias
			mExtern->setAliasName(parent->name);
			ParticleSystemManager::getSingletonPtr()->addAlias(mExtern);
		}

		// The first value is the (optional) name
		String name;
		if(!obj->values.empty())
		{
			getString(obj->values.front(), &name);
			mExtern->setName(name);
		}

		// Set it in the context
		obj->context = Any(mExtern);

		// Run through properties
		for(AbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
		{
			// No properties of its own
			if((*i)->type == ANT_PROPERTY)
			{
				PropertyAbstractNode* prop = reinterpret_cast<PropertyAbstractNode*>((*i).get());
				if (externFactory->translateChildProperty(compiler, *i))
				{
					// Parsed the property by another translator; do nothing
				}
				else
				{
					errorUnexpectedProperty(compiler, prop);
				}
			}
			else if((*i)->type == ANT_OBJECT)
			{
				if (externFactory->translateChildObject(compiler, *i))
				{
					// Parsed the object by another translator; do nothing
				}
				else
				{
					processNode(compiler, *i);
				}
			}
            else
			{
				errorUnexpectedToken(compiler, *i);
			}
		}
	}
	//-------------------------------------------------------------------------
	void DynamicAttributeTranslator::translate(ScriptCompiler* compiler, const AbstractNodePtr &node)
	{
		ObjectAbstractNode* obj = reinterpret_cast<ObjectAbstractNode*>(node.get());

		// The first value is the type
		String type = obj->name;

		if (type == token[TOKEN_DYN_RANDOM])
		{
			mDynamicAttribute = PU_NEW_T(DynamicAttributeRandom, MEMCATEGORY_SCENE_OBJECTS)();
		}
		else if (type == token[TOKEN_DYN_CURVED_LINEAR])
		{
			mDynamicAttribute = PU_NEW_T(DynamicAttributeCurved, MEMCATEGORY_SCENE_OBJECTS)(IT_LINEAR);
		}
		else if (type == token[TOKEN_DYN_CURVED_SPLINE])
		{
			mDynamicAttribute = PU_NEW_T(DynamicAttributeCurved, MEMCATEGORY_SCENE_OBJECTS)(IT_SPLINE);
		}
		else if (type == token[TOKEN_DYN_OSCILLATE])
		{
			mDynamicAttribute = PU_NEW_T(DynamicAttributeOscillate, MEMCATEGORY_SCENE_OBJECTS)();
		}
		else
		{
			// Create a fixed one.
			mDynamicAttribute = PU_NEW_T(DynamicAttributeFixed, MEMCATEGORY_SCENE_OBJECTS)();
		}

		// Run through properties
		for(AbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
		{
			if((*i)->type == ANT_PROPERTY)
			{
				PropertyAbstractNode* prop = reinterpret_cast<PropertyAbstractNode*>((*i).get());
				if (prop->name == token[TOKEN_DYN_MIN])
				{
					// Property: min
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_RANDOM)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_MIN], VAL_REAL))
						{
							Real val = 0.0f;
							if(getReal(prop->values.front(), &val))
							{
								(static_cast<DynamicAttributeRandom*>(mDynamicAttribute))->setMin(val);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_MAX])
				{
					// Property: max
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_RANDOM)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_MAX], VAL_REAL))
						{
							Real val = 0.0f;
							if(getReal(prop->values.front(), &val))
							{
								(static_cast<DynamicAttributeRandom*>(mDynamicAttribute))->setMax(val);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_CONTROL_POINT])
				{
					// Property: control_point
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_CURVED)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_CONTROL_POINT], VAL_VECTOR2))
						{
							Vector2 val;
							if(getVector2(prop->values.begin(), prop->values.end(), &val))
							{
								(static_cast<DynamicAttributeCurved*>(mDynamicAttribute))->addControlPoint(val.x, val.y);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_OSCILLATE_FREQUENCY])
				{
					// Property: oscillate_frequency
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_OSCILLATE)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_FREQUENCY], VAL_REAL))
						{
							Real val = 0.0f;
							if(getReal(prop->values.front(), &val))
							{
								(static_cast<DynamicAttributeOscillate*>(mDynamicAttribute))->setFrequency(val);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_OSCILLATE_PHASE])
				{
					// Property: oscillate_phase
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_OSCILLATE)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_PHASE], VAL_REAL))
						{
							Real val = 0.0f;
							if(getReal(prop->values.front(), &val))
							{
								(static_cast<DynamicAttributeOscillate*>(mDynamicAttribute))->setPhase(val);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_OSCILLATE_BASE])
				{
					// Property: oscillate_base
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_OSCILLATE)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_BASE], VAL_REAL))
						{
							Real val = 0.0f;
							if(getReal(prop->values.front(), &val))
							{
								(static_cast<DynamicAttributeOscillate*>(mDynamicAttribute))->setBase(val);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_OSCILLATE_AMPLITUDE])
				{
					// Property: oscillate_amplitude
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_OSCILLATE)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_AMPLITUDE], VAL_REAL))
						{
							Real val = 0.0f;
							if(getReal(prop->values.front(), &val))
							{
								(static_cast<DynamicAttributeOscillate*>(mDynamicAttribute))->setAmplitude(val);
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_DYN_OSCILLATE_TYPE])
				{
					// Property: oscillate_type
					if (mDynamicAttribute->getType() == DynamicAttribute::DAT_OSCILLATE)
					{
						if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_TYPE], VAL_STRING))
						{
							String val;
							if(getString(prop->values.front(), &val))
							{
								if (val == token[TOKEN_DYN_SINE])
								{
									(static_cast<DynamicAttributeOscillate*>(mDynamicAttribute))->setOscillationType(
										DynamicAttributeOscillate::OSCT_SINE);
								}
								else if (val == token[TOKEN_DYN_SQUARE])
								{
									(static_cast<DynamicAttributeOscillate*>(mDynamicAttribute))->setOscillationType(
										DynamicAttributeOscillate::OSCT_SQUARE);
								}
							}
						}
					}
				}
				else
				{
					errorUnexpectedProperty(compiler, prop);
				}

			}
			else if((*i)->type == ANT_OBJECT)
			{
				processNode(compiler, *i);
			}
            else
			{
				errorUnexpectedToken(compiler, *i);
			}
		}

		// Set it in the context
		obj->context = Any(mDynamicAttribute);
	}
void PUParticle3DDynamicAttributeTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode *node)
{
    PUObjectAbstractNode* obj = reinterpret_cast<PUObjectAbstractNode*>(node);

    // The first value is the type
    std::string type = obj->name;

    if (type == token[TOKEN_DYN_RANDOM])
    {
        _dynamicAttribute = new (std::nothrow) PUDynamicAttributeRandom();
    }
    else if (type == token[TOKEN_DYN_CURVED_LINEAR])
    {
        _dynamicAttribute = new (std::nothrow) PUDynamicAttributeCurved();
    }
    else if (type == token[TOKEN_DYN_CURVED_SPLINE])
    {
        _dynamicAttribute = new (std::nothrow) PUDynamicAttributeCurved();
    }
    else if (type == token[TOKEN_DYN_OSCILLATE])
    {
        _dynamicAttribute = new (std::nothrow) PUDynamicAttributeOscillate();
    }
    else
    {
        // Create a fixed one.
        _dynamicAttribute = new (std::nothrow) PUDynamicAttributeFixed();
    }

    // Run through properties
    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_DYN_MIN])
            {
                // Property: min
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_RANDOM)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_MIN], VAL_REAL))
                    {
                        float val = 0.0f;
                        if(getFloat(*prop->values.front(), &val))
                        {
                            (static_cast<PUDynamicAttributeRandom*>(_dynamicAttribute))->setMin(val);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_MAX])
            {
                // Property: max
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_RANDOM)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_MAX], VAL_REAL))
                    {
                        float val = 0.0f;
                        if(getFloat(*prop->values.front(), &val))
                        {
                            (static_cast<PUDynamicAttributeRandom*>(_dynamicAttribute))->setMax(val);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_CONTROL_POINT])
            {
                // Property: control_point
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_CURVED)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_CONTROL_POINT], VAL_VECTOR2))
                    {
                        Vec2 val;
                        if(getVector2(prop->values.begin(), prop->values.end(), &val))
                        {
                            (static_cast<PUDynamicAttributeCurved*>(_dynamicAttribute))->addControlPoint(val.x, val.y);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_OSCILLATE_FREQUENCY])
            {
                // Property: oscillate_frequency
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_OSCILLATE)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_FREQUENCY], VAL_REAL))
                    {
                        float val = 0.0f;
                        if(getFloat(*prop->values.front(), &val))
                        {
                            (static_cast<PUDynamicAttributeOscillate*>(_dynamicAttribute))->setFrequency(val);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_OSCILLATE_PHASE])
            {
                // Property: oscillate_phase
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_OSCILLATE)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_PHASE], VAL_REAL))
                    {
                        float val = 0.0f;
                        if(getFloat(*prop->values.front(), &val))
                        {
                            (static_cast<PUDynamicAttributeOscillate*>(_dynamicAttribute))->setPhase(val);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_OSCILLATE_BASE])
            {
                // Property: oscillate_base
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_OSCILLATE)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_BASE], VAL_REAL))
                    {
                        float val = 0.0f;
                        if(getFloat(*prop->values.front(), &val))
                        {
                            (static_cast<PUDynamicAttributeOscillate*>(_dynamicAttribute))->setBase(val);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_OSCILLATE_AMPLITUDE])
            {
                // Property: oscillate_amplitude
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_OSCILLATE)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_AMPLITUDE], VAL_REAL))
                    {
                        float val = 0.0f;
                        if(getFloat(*prop->values.front(), &val))
                        {
                            (static_cast<PUDynamicAttributeOscillate*>(_dynamicAttribute))->setAmplitude(val);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_DYN_OSCILLATE_TYPE])
            {
                // Property: oscillate_type
                if (_dynamicAttribute->getType() == PUDynamicAttribute::DAT_OSCILLATE)
                {
                    if (passValidateProperty(compiler, prop, token[TOKEN_DYN_OSCILLATE_TYPE], VAL_STRING))
                    {
                        std::string val;
                        if(getString(*prop->values.front(), &val))
                        {
                            if (val == token[TOKEN_DYN_SINE])
                            {
                                (static_cast<PUDynamicAttributeOscillate*>(_dynamicAttribute))->setOscillationType(
                                    PUDynamicAttributeOscillate::OSCT_SINE);
                            }
                            else if (val == token[TOKEN_DYN_SQUARE])
                            {
                                (static_cast<PUDynamicAttributeOscillate*>(_dynamicAttribute))->setOscillationType(
                                    PUDynamicAttributeOscillate::OSCT_SQUARE);
                            }
                        }
                    }
                }
            }
            else
            {
                errorUnexpectedProperty(compiler, prop);
            }

        }
        else if((*i)->type == ANT_OBJECT)
        {
            processNode(compiler, *i);
        }
        else
        {
            errorUnexpectedToken(compiler, *i);
        }
    }

    // Set it in the context
    obj->context = _dynamicAttribute;
}
예제 #4
0
//-------------------------------------------------------------------------
void PUBehaviourTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode *node)
{
    PUObjectAbstractNode* obj = reinterpret_cast<PUObjectAbstractNode*>(node);
    PUObjectAbstractNode* parent = obj->parent ? reinterpret_cast<PUObjectAbstractNode*>(obj->parent) : 0;

    // The name of the obj is the type of the Behaviour
    std::string type;
    if(!obj->name.empty())
    {
        type = obj->name;
    }
    else
    {
        //compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
        return;
    }

    //// Get the factory
    //ParticleBehaviourFactory* behaviourFactory = ParticleSystemManager::getSingletonPtr()->getBehaviourFactory(type);
    //if (!behaviourFactory)
    //{
    //	//compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
    //	return;
    //}

    PUScriptTranslator *particleBehaviourTranlator = PUBehaviourManager::Instance()->getTranslator(type);
    if (!particleBehaviourTranlator) return;

    // Create the Behaviour
    _behaviour = PUBehaviourManager::Instance()->createBehaviour(type);
    if (!_behaviour)
    {
        //compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
        return;
    }

    _behaviour->setBehaviourType(type);
    if (parent && parent->context)
    {
        PUParticleSystem3D* system = static_cast<PUParticleSystem3D*>(parent->context);
        system->addBehaviourTemplate(_behaviour);
    }
    else
    {
        //// It is an alias
        //_behaviour->setAliasName(parent->name);
        //ParticleSystemManager::getSingletonPtr()->addAlias(mBehaviour);
    }

    // Set it in the context
    obj->context = _behaviour;

    // Run through properties
    for(PUAbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
    {
        // No properties of its own
        if((*i)->type == ANT_PROPERTY)
        {
            PUPropertyAbstractNode* prop = reinterpret_cast<PUPropertyAbstractNode*>((*i));
            if (particleBehaviourTranlator->translateChildProperty(compiler, *i))
            {
                // Parsed the property by another translator; do nothing
            }
            else
            {
                errorUnexpectedProperty(compiler, prop);
            }
        }
        else if((*i)->type == ANT_OBJECT)
        {
            if (particleBehaviourTranlator->translateChildObject(compiler, *i))
            {
                // Parsed the object by another translator; do nothing
            }
            else
            {
                processNode(compiler, *i);
            }
        }
        else
        {
            errorUnexpectedToken(compiler, *i);
        }
    }
}
//-------------------------------------------------------------------------
void PUAffectorTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode *node)
{
    PUObjectAbstractNode* obj = reinterpret_cast<PUObjectAbstractNode*>(node);
    PUObjectAbstractNode* parent = obj->parent ? reinterpret_cast<PUObjectAbstractNode*>(obj->parent) : 0;
    
    // The name of the obj is the type of the affector
    // Remark: This can be solved by using a listener, so that obj->values is filled with type + name. Something for later
    std::string type;
    if(!obj->name.empty())
    {
        type = obj->name;
    }
    
    //// Get the factory
    //ParticleAffectorFactory* particleAffectorFactory = ParticleSystemManager::getSingletonPtr()->getAffectorFactory(type);
    //if (!particleAffectorFactory)
    //{
    //    compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
    //    return;
    //}
    PUScriptTranslator *particleAffectorTranlator = PUAffectorManager::Instance()->getTranslator(type);
    if (!particleAffectorTranlator) return;
    //// Create the affector
    //mAffector = ParticleSystemManager::getSingletonPtr()->createAffector(type);
    //if (!mAffector)
    //{
    //    compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
    //    return;
    //}
    _affector = PUAffectorManager::Instance()->createAffector(type);
    if (!_affector) return;
    _affector->setAffectorType(type);

    if (parent && parent->context)
    {
        PUParticleSystem3D* system = static_cast<PUParticleSystem3D*>(parent->context);
        system->addAffector(_affector);
    }
    
    // The first value is the (optional) name
    std::string name;
    if(!obj->values.empty())
    {
        getString(*obj->values.front(), &name);
        _affector->setName(name);
    }
    
    // Set it in the context
    obj->context = _affector;
    
    // Run through properties
    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))
                    {
                        _affector->setEnabled(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_POSITION])
            {
                // Property: position
                if (passValidateProperty(compiler, prop, token[TOKEN_POSITION], VAL_VECTOR3))
                {
                    Vec3 val;
                    if(getVector3(prop->values.begin(), prop->values.end(), &val))
                    {
                        //mAffector->position = val;
                        //mAffector->originalPosition = val;
                        _affector->setLocalPosition(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_AFFECTOR_MASS])
            {
                if (passValidateProperty(compiler, prop, token[TOKEN_AFFECTOR_MASS], VAL_REAL))
                {
                    float val = 0.0f;
                    if(getFloat(*prop->values.front(), &val))
                    {
                        _affector->setMass(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_AFFECTOR_SPECIALISATION])
            {
                if (passValidateProperty(compiler, prop, token[TOKEN_AFFECTOR_SPECIALISATION], VAL_STRING))
                {
                    std::string val;
                    if(getString(*prop->values.front(), &val))
                    {
                        if (val == token[TOKEN_AFFECTOR_SPEC_DEFAULT])
                        {
                            _affector->setAffectSpecialisation(PUAffector::AFSP_DEFAULT);
                        }
                        else if (val == token[TOKEN_AFFECTOR_SPEC_TTL_INCREASE])
                        {
                            _affector->setAffectSpecialisation(PUAffector::AFSP_TTL_INCREASE);
                        }
                        else if (val == token[TOKEN_AFFECTOR_SPEC_TTL_DECREASE])
                        {
                            _affector->setAffectSpecialisation(PUAffector::AFSP_TTL_DECREASE);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_AFFECTOR_EXCLUDE_EMITTER])
            {
                if (passValidatePropertyNoValues(compiler, prop, token[TOKEN_AFFECTOR_EXCLUDE_EMITTER]))
                {
                    for(PUAbstractNodeList::iterator j = prop->values.begin(); j != prop->values.end(); ++j)
                    {
                        std::string val;
                        if(getString(**j, &val))
                        {
                            _affector->addEmitterToExclude(val);
                        }
                    }
                }
            }
            else if (particleAffectorTranlator->translateChildProperty(compiler, *i))
            {
                // Parsed the property by another translator; do nothing
            }
            else
            {
                errorUnexpectedProperty(compiler, prop);
            }
        }
        else if((*i)->type == ANT_OBJECT)
        {
            if (particleAffectorTranlator->translateChildObject(compiler, *i))
            {
                // Parsed the object by another translator; do nothing
            }
            else
            {
                processNode(compiler, *i);
            }
        }
        else
        {
            errorUnexpectedToken(compiler, *i);
        }
    }
}
예제 #6
0
//-------------------------------------------------------------------------
void PUObserverTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode *node)
{
    PUObjectAbstractNode* obj = reinterpret_cast<PUObjectAbstractNode*>(node);
    PUObjectAbstractNode* parent = obj->parent ? reinterpret_cast<PUObjectAbstractNode*>(obj->parent) : 0;

    // The name of the obj is the type of the Observer
    // Remark: This can be solved by using a listener, so that obj->values is filled with type + name. Something for later
    std::string type;
    if(!obj->name.empty())
    {
        type = obj->name;
    }
    else
    {
        //compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
        return;
    }

    // Get the factory
    //ParticleObserverFactory* particleObserverFactory = ParticleSystemManager::getSingletonPtr()->getObserverFactory(type);
    //if (!particleObserverFactory)
    //{
    //	//compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
    //	return;
    //}

    PUScriptTranslator *particleObserverTranlator = PUObserverManager::Instance()->getTranslator(type);
    if (!particleObserverTranlator) return;

    // Create the Observer
    _observer = PUObserverManager::Instance()->createObserver(type);
    if (!_observer)
    {
        //compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
        return;
    }
    _observer->setObserverType(type);

    if (parent && parent->context)
    {
        PUParticleSystem3D* system = static_cast<PUParticleSystem3D *>(parent->context);
        system->addObserver(_observer);
    }
    else
    {
        //// It is an alias
        //mObserver->setAliasName(parent->name);
        //ParticleSystemManager::getSingletonPtr()->addAlias(mObserver);
    }

    // The first value is the (optional) name
    std::string name;
    if(!obj->values.empty())
    {
        getString(*obj->values.front(), &name);
        _observer->setName(name);
    }

    // Set it in the context
    obj->context = _observer;

    // Run through properties
    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))
                    {
                        _observer->setEnabled(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_OBSERVE_PARTICLE_TYPE])
            {
                // Property: observe_particle_type
                if (passValidateProperty(compiler, prop, token[TOKEN_OBSERVE_PARTICLE_TYPE], VAL_STRING))
                {
                    std::string val;
                    if(getString(*prop->values.front(), &val))
                    {
                        if (val == token[TOKEN_VISUAL_PARTICLE])
                        {
                            _observer->setParticleTypeToObserve(PUParticle3D::PT_VISUAL);
                        }
                        else if (val == token[TOKEN_EMITTER_PARTICLE])
                        {
                            _observer->setParticleTypeToObserve(PUParticle3D::PT_EMITTER);
                        }
                        else if (val == token[TOKEN_AFFECTOR_PARTICLE])
                        {
                            _observer->setParticleTypeToObserve(PUParticle3D::PT_AFFECTOR);
                        }
                        else if (val == token[TOKEN_TECHNIQUE_PARTICLE])
                        {
                            _observer->setParticleTypeToObserve(PUParticle3D::PT_TECHNIQUE);
                        }
                        else if (val == token[TOKEN_SYSTEM_PARTICLE])
                        {
                            _observer->setParticleTypeToObserve(PUParticle3D::PT_SYSTEM);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_OBSERVE_INTERVAL])
            {
                // Property: observe_interval
                if (passValidateProperty(compiler, prop, token[TOKEN_OBSERVE_INTERVAL], VAL_REAL))
                {
                    float val;
                    if(getFloat(*prop->values.front(), &val))
                    {
                        _observer->setObserverInterval(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_OBSERVE_UNTIL_EVENT])
            {
                // Property: observe_until_event
                if (passValidateProperty(compiler, prop, token[TOKEN_OBSERVE_UNTIL_EVENT], VAL_BOOL))
                {
                    bool val;
                    if(getBoolean(*prop->values.front(), &val))
                    {
                        _observer->setObserveUntilEvent(val);
                    }
                }
            }
            else if (particleObserverTranlator->translateChildProperty(compiler, *i))
            {
                // Parsed the property by another translator; do nothing
            }
            else
            {
                errorUnexpectedProperty(compiler, prop);
            }
        }
        else if((*i)->type == ANT_OBJECT)
        {
            if (particleObserverTranlator->translateChildObject(compiler, *i))
            {
                // Parsed the object by another translator; do nothing
            }
            else
            {
                processNode(compiler, *i);
            }
        }
        else
        {
            errorUnexpectedToken(compiler, *i);
        }
    }
}
	//-------------------------------------------------------------------------
	void SystemTranslator::translate(ScriptCompiler* compiler, const AbstractNodePtr &node)
	{
		ObjectAbstractNode* obj = reinterpret_cast<ObjectAbstractNode*>(node.get());
		if(obj->name.empty())
		{
			compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, obj->file, obj->line);
			return;
		}

		// Create a particle system with the given name
		mSystem = ParticleSystemManager::getSingletonPtr()->createParticleSystemTemplate(obj->name, compiler->getResourceGroup());
		if (!mSystem)
		{
			compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
			return;
		}
		obj->context = Any(mSystem);

		for(AbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
		{
			if((*i)->type == ANT_PROPERTY)
			{
				PropertyAbstractNode* prop = reinterpret_cast<PropertyAbstractNode*>((*i).get());
				if (prop->name == token[TOKEN_PS_ITERATION_INTERVAL])
				{
					// Property: iteration_interval
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_ITERATION_INTERVAL], VAL_REAL))
					{
						Real val = 0.0f;
						if(getReal(prop->values.front(), &val))
						{
							mSystem->setIterationInterval(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_NONVIS_UPDATE_TIMEOUT])
				{
					// Property: nonvisible_update_timeout
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_NONVIS_UPDATE_TIMEOUT], VAL_REAL))
					{
						Real val = 0.0f;
						if(getReal(prop->values.front(), &val))
						{
							mSystem->setNonVisibleUpdateTimeout(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_FIXED_TIMEOUT])
				{
					// Property: fixed_timeout
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_FIXED_TIMEOUT], VAL_REAL))
					{
						Real val = 0.0f;
						if(getReal(prop->values.front(), &val))
						{
							mSystem->setFixedTimeout(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_LOD_DISTANCES])
				{
					// Property: lod_distances
					if (passValidatePropertyNoValues(compiler, prop, token[TOKEN_PS_LOD_DISTANCES]))
					{
						for(AbstractNodeList::iterator j = prop->values.begin(); j != prop->values.end(); ++j)
						{
							Real val = 0.0f;
							if(getReal(*j, &val))
							{
								mSystem->addLodDistance(val);
							}
							else
							{
								compiler->addError(ScriptCompiler::CE_NUMBEREXPECTED, prop->file, prop->line,
									"PU Compiler: lod_distances expects only numbers as arguments");
							}
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_MAIN_CAMERA_NAME])
				{
					// Property: main_camera_name
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_MAIN_CAMERA_NAME], VAL_STRING))
					{
						String val;
						if(getString(prop->values.front(), &val))
						{
							mSystem->setMainCameraName(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_SMOOTH_LOD])
				{
					// Property: smooth_lod
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_SMOOTH_LOD], VAL_BOOL))
					{
						bool val;
						if(getBoolean(prop->values.front(), &val))
						{
							mSystem->setSmoothLod(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_FAST_FORWARD])
				{
					// Property: fast_forward
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_SCALE], VAL_VECTOR2))
					{
						Vector2 val;
						if(getVector2(prop->values.begin(), prop->values.end(), &val))
						{
							mSystem->setFastForward(val.x, val.y);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_SCALE])
				{
					// Property: scale
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_SCALE], VAL_VECTOR3))
					{
						Vector3 val;
						if(getVector3(prop->values.begin(), prop->values.end(), &val))
						{
							mSystem->setScale(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_SCALE_VELOCITY])
				{
					// Property: scale_velocity
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_ITERATION_INTERVAL], VAL_REAL))
					{
						Real val = 0.0f;
						if(getReal(prop->values.front(), &val))
						{
							mSystem->setScaleVelocity(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_SCALE_TIME])
				{
					// Property: scale_time
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_SCALE_TIME], VAL_REAL))
					{
						Real val = 0.0f;
						if(getReal(prop->values.front(), &val))
						{
							mSystem->setScaleTime(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))
						{
							mSystem->setKeepLocal(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_TIGHT_BOUNDING_BOX])
				{
					// Property: tight_bounding_box
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_TIGHT_BOUNDING_BOX], VAL_BOOL))
					{
						bool val;
						if(getBoolean(prop->values.front(), &val))
						{
							mSystem->setTightBoundingBox(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_PS_CATEGORY])
				{
					// Property: category
					if (passValidateProperty(compiler, prop, token[TOKEN_PS_CATEGORY], VAL_STRING))
					{
						String val;
						if(getString(prop->values.front(), &val))
						{
							mSystem->setCategory(val);
						}
					}
				}
				else if (prop->name == token[TOKEN_USE_ALIAS])
				{
					// Property: use_alias
					// The alias can only be a technique
					if (passValidateProperty(compiler, prop, token[TOKEN_USE_ALIAS], VAL_STRING))
					{
						String val;
						if(getString(prop->values.front(), &val))
						{
							IAlias* alias = ParticleSystemManager::getSingletonPtr()->getAlias(val);
							if (alias->getAliasType() == IAlias::AT_TECHNIQUE)
							{
								ParticleTechnique* technique = static_cast<ParticleTechnique*>(alias);
								ParticleTechnique* newTechnique = ParticleSystemManager::getSingletonPtr()->cloneTechnique(technique);
								mSystem->addTechnique(newTechnique);
							}
						}
					}
				}
				else
				{
					errorUnexpectedProperty(compiler, prop);
				}
			}
			else if((*i)->type == ANT_OBJECT)
			{
				processNode(compiler, *i);
			}
            else
			{
				errorUnexpectedToken(compiler, *i);
			}
		}
	}
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])
            {
                //// Property: emitted_affector_quota
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_AFFECTOR_QUOTA], VAL_UINT))
                //{
                //    uint val = 0;
                //    if(getUInt(prop->values.front(), &val))
                //    {
                //        mTechnique->setEmittedAffectorQuota(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_TECH_EMITTED_TECHNIQUE_QUOTA])
            {
                // Property: emitted_technique_quota
                if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_TECHNIQUE_QUOTA], VAL_UINT))
                {
                    unsigned int val = 0;
                    if(getUInt(*prop->values.front(), &val))
                    {
                        _system->setEmittedSystemQuota(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_TECH_EMITTED_SYSTEM_QUOTA])
            {
                //// Property: emitted_system_quota
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_SYSTEM_QUOTA], VAL_UINT))
                //{
                //    uint val = 0;
                //    if(getUInt(prop->values.front(), &val))
                //    {
                //        mTechnique->setEmittedSystemQuota(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_MATERIAL])
            {
                // Property: material
                if (passValidateProperty(compiler, prop, token[TOKEN_MATERIAL], VAL_STRING))
                {
                    std::string val;
                    if(getString(*prop->values.front(), &val))
                    {
                        _system->setMaterialName(val);
                        PUMaterial *material = PUMaterialCache::Instance()->getMaterial(val);
                        if (material){
                            _system->setBlendFunc(material->blendFunc);
                        }
                    }
                }
            }
            else if (prop->name == token[TOKEN_TECH_LOD_INDEX])
            {
                //// Property: lod_index
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_LOD_INDEX], VAL_UINT))
                //{
                //    uint val = 0;
                //    if(getUInt(prop->values.front(), &val))
                //    {
                //        mTechnique->setLodIndex(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_TECH_DEFAULT_PARTICLE_WIDTH])
            {
                // Property: default_particle_width
                if (passValidateProperty(compiler, prop, token[TOKEN_TECH_DEFAULT_PARTICLE_WIDTH], VAL_REAL))
                {
                    float val = 0.0f;
                    if(getFloat(*prop->values.front(), &val))
                    {
                        _system->setDefaultWidth(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_TECH_DEFAULT_PARTICLE_HEIGHT])
            {
                // Property: default_particle_height
                if (passValidateProperty(compiler, prop, token[TOKEN_TECH_DEFAULT_PARTICLE_HEIGHT], VAL_REAL))
                {
                    float val = 0.0f;
                    if(getFloat(*prop->values.front(), &val))
                    {
                        _system->setDefaultHeight(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_TECH_DEFAULT_PARTICLE_DEPTH])
            {
                // Property: default_particle_depth
                if (passValidateProperty(compiler, prop, token[TOKEN_TECH_DEFAULT_PARTICLE_DEPTH], VAL_REAL))
                {
                    float val = 0.0f;
                    if(getFloat(*prop->values.front(), &val))
                    {
                        _system->setDefaultDepth(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_TECH_SPHASHING_CELL_DIMENSION])
            {
                //// Property: spatial_hashing_cell_dimension
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_SPHASHING_CELL_DIMENSION], VAL_UINT))
                //{
                //    unsigned int val = 0;
                //    if(getUInt(prop->values.front(), &val))
                //    {
                //        mTechnique->setSpatialHashingCellDimension(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_TECH_SPHASHING_CELL_OVERLAP])
            {
                //// Property: spatial_hashing_cell_overlap
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_SPHASHING_CELL_OVERLAP], VAL_UINT))
                //{
                //    unsigned int val = 0;
                //    if(getUInt(prop->values.front(), &val))
                //    {
                //        mTechnique->setSpatialHashingCellOverlap(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_TECH_SPHASHING_SIZE])
            {
                //// Property: spatial_hashtable_size
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_SPHASHING_SIZE], VAL_UINT))
                //{
                //    unsigned int val = 0;
                //    if(getUInt(prop->values.front(), &val))
                //    {
                //        mTechnique->setSpatialHashTableSize(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_TECH_SPHASHING_UPDATE_INTERVAL])
            {
                //// Property: spatial_hashing_update_interval
                //if (passValidateProperty(compiler, prop, token[TOKEN_TECH_SPHASHING_UPDATE_INTERVAL], VAL_REAL))
                //{
                //    float val = 0.0f;
                //    if(getReal(prop->values.front(), &val))
                //    {
                //        mTechnique->setSpatialHashingInterval(val);
                //    }
                //}
            }
            else if (prop->name == token[TOKEN_TECH_MAX_VELOCITY])
            {
                // Property: max_velocity
                if (passValidateProperty(compiler, prop, token[TOKEN_TECH_MAX_VELOCITY], VAL_REAL))
                {
                    float val = 0.0f;
                    if(getFloat(*prop->values.front(), &val))
                    {
                        _system->setMaxVelocity(val);
                    }
                }
            }
            else if (prop->name == token[TOKEN_USE_ALIAS])
            {
                //// Property: use_alias
                //if (passValidateProperty(compiler, prop, token[TOKEN_USE_ALIAS], VAL_STRING))
                //{
                //    String val;
                //    if(getString(prop->values.front(), &val))
                //    {
                //        IAlias* alias = ParticleSystemManager::getSingletonPtr()->getAlias(val);
                //        switch (alias->getAliasType())
                //        {
                //            case IAlias::AT_RENDERER:
                //            {
                //                ParticleRenderer* renderer = static_cast<ParticleRenderer*>(alias);
                //                ParticleRenderer* newRenderer = ParticleSystemManager::getSingletonPtr()->cloneRenderer(renderer);
                //                mTechnique->setRenderer(newRenderer);
                //            }
                //                break;
                //                
                //            case IAlias::AT_EMITTER:
                //            {
                //                ParticleEmitter* emitter = static_cast<ParticleEmitter*>(alias);
                //                ParticleEmitter* newEmitter = ParticleSystemManager::getSingletonPtr()->cloneEmitter(emitter);
                //                mTechnique->addEmitter(newEmitter);
                //            }
                //                break;
                //                
                //            case IAlias::AT_AFFECTOR:
                //            {
                //                ParticleAffector* affector = static_cast<ParticleAffector*>(alias);
                //                ParticleAffector* newAffector = ParticleSystemManager::getSingletonPtr()->cloneAffector(affector);
                //                mTechnique->addAffector(newAffector);
                //            }
                //                break;
                //                
                //            case IAlias::AT_OBSERVER:
                //            {
                //                ParticleObserver* observer = static_cast<ParticleObserver*>(alias);
                //                ParticleObserver* newObserver = ParticleSystemManager::getSingletonPtr()->cloneObserver(observer);
                //                mTechnique->addObserver(newObserver);
                //            }
                //                break;
                //                
                //            case IAlias::AT_EXTERN:
                //            {
                //                Extern* externObject = static_cast<Extern*>(alias);
                //                Extern* newExternObject = ParticleSystemManager::getSingletonPtr()->cloneExtern(externObject);
                //                mTechnique->addExtern(newExternObject);
                //            }
                //                break;
                //                
                //            case IAlias::AT_BEHAVIOUR:
                //            {
                //                ParticleBehaviour* behaviour = static_cast<ParticleBehaviour*>(alias);
                //                ParticleBehaviour* newBehaviour = ParticleSystemManager::getSingletonPtr()->cloneBehaviour(behaviour);
                //                mTechnique->_addBehaviourTemplate(newBehaviour);
                //            }
                //                break;
                //        }
                //    }
                //}
            }
            else
            {
                errorUnexpectedProperty(compiler, prop);
            }
        }
        else if((*i)->type == ANT_OBJECT)
        {
            //ObjectAbstractNode* child = reinterpret_cast<ObjectAbstractNode*>((*i).get());
            //if (child->cls == token[TOKEN_CAMERA_DEPENDENCY])
            //{
            //    // Property: camera_dependency
            //    CameraDependency* cameraDependency = PU_NEW_T(CameraDependency, MEMCATEGORY_SCRIPTING)();
            //    child->context = Any(cameraDependency);
            //    CameraDependencyTranslator cameraDependencyTranslator;
            //    cameraDependencyTranslator.translate(compiler, *i);
            //    Real threshold = cameraDependency->getThreshold();
            //    bool increase = cameraDependency->isIncrease();
            //    if (child->name == token[TOKEN_TECH_DEFAULT_PARTICLE_WIDTH])
            //    {
            //        mTechnique->setWidthCameraDependency(threshold * threshold, increase);
            //    }
            //    else if (child->name == token[TOKEN_TECH_DEFAULT_PARTICLE_HEIGHT])
            //    {
            //        mTechnique->setHeightCameraDependency(threshold * threshold, increase);
            //    }
            //    else if (child->name == token[TOKEN_TECH_DEFAULT_PARTICLE_DEPTH])
            //    {
            //        mTechnique->setDepthCameraDependency(threshold * threshold, increase);
            //    }
            //    // Delete the camera dependency
            //    PU_DELETE_T(cameraDependency, CameraDependency, MEMCATEGORY_SCRIPTING);
            //}
            //else
            {
                processNode(compiler, *i);
            }
        }
        else
        {
            errorUnexpectedToken(compiler, *i);
        }
    }
}