Ejemplo n.º 1
0
RESULT
ParticleManager::SetEffect( IN HParticleEmitter hParticleEmitter, HEffect hEffect )
{
    RESULT rval = S_OK;
    
    ParticleEmitter* pParticleEmitter = GetObjectPointer( hParticleEmitter );
    if (pParticleEmitter)
    {
#ifdef DEBUG    
        string name;
        EffectMan.GetName( hEffect, &name );
        DEBUGMSG(ZONE_PARTICLES, "ParticleManager::SetEffect( %s, %s )", 
                 pParticleEmitter->GetName().c_str(), name.c_str());
#endif        
        pParticleEmitter->SetEffect( hEffect );
    }
    else 
    {
        RETAILMSG(ZONE_ERROR, "ERROR: ParticleManager::SetEffect( 0x%x, 0x%x ): object not found", (UINT32)hParticleEmitter, (UINT32)hEffect);
        rval = E_INVALID_ARG;
    }

Exit:
    return rval;
}
Ejemplo n.º 2
0
void Player::SetupShip()
{
    ship_.node_ = rootNode_->CreateChild("Ship");
    ship_.model_ = ship_.node_->CreateComponent<StaticModel>();
    ship_.model_->SetModel(masterControl_->resources.models.ships.swift);
    ship_.model_->SetMaterial(0, masterControl_->resources.materials.shipSecondary);
    ship_.model_->SetMaterial(1, masterControl_->resources.materials.shipPrimary);

    ParticleEmitter* particleEmitter = ship_.node_->CreateComponent<ParticleEmitter>();
    SharedPtr<ParticleEffect> particleEffect = masterControl_->cache_->GetTempResource<ParticleEffect>("Resources/Particles/Shine.xml");
    Vector<ColorFrame> colorFrames;
    colorFrames.Push(ColorFrame(Color(0.0f, 0.0f, 0.0f, 0.0f), 0.0f));
    colorFrames.Push(ColorFrame(Color(0.42f, 0.7f, 0.23f, 0.23f), 0.2f));
    colorFrames.Push(ColorFrame(Color(0.0f, 0.0f, 0.0f, 0.0f), 0.4f));
    particleEffect->SetColorFrames(colorFrames);
    particleEmitter->SetEffect(particleEffect);

    CreateTails();
}