Particle3DEmitterTests SmokeAndWind Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering3D.Particles.Tests
Assembly: DeltaEngine.Rendering3D.Particles.Tests (in DeltaEngine.Rendering3D.Particles.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void SmokeAndWind()
Examples

[Test]
public void SmokeAndWind()
{
    window.BackgroundColor = new Color(40, 64, 20);
    var defaultForce = new RangeGraph<Vector3D>(Vector3D.Zero);
    var windForce = new RangeGraph<Vector3D>(new Vector3D(-0.5f, -0.01f, 0.0f),
        new Vector3D(-1.0f, 0.01f, 0.0f));
    var emitterData = GetEmitterData(spark, 256, 2.0f);
    emitterData.Color = new RangeGraph<Color>(Color.White, Color.Transparent(Color.DarkGray));
    emitterData.Size = new RangeGraph<Size>(new Size(0.05f), new Size(0.2f));
    emitterData.Acceleration = defaultForce;
    emitterData.StartVelocity = new RangeGraph<Vector3D>(new Vector3D(0.0f, 0.0f, 0.35f),
        new Vector3D(0.1f, 0.1f, 0.1f));
    var emitter = new ParticleEmitter(emitterData, Vector3D.Zero);
    new Command(() => emitter.EmitterData.Acceleration = windForce).Add(new KeyTrigger(Key.Space));
    new Command(() => emitter.EmitterData.Acceleration = defaultForce).Add(
        new KeyTrigger(Key.Space, State.Releasing));
}
See Also