Particle Color Property Delta Engine Documentation

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

public Color Color { get; set; }

Property Value

Type: Color
Remarks

Tests: DeltaEngine.Rendering3D.Particles.Tests.Particle3DEmitterTests
Examples

2 unit tests call DeltaEngine.Rendering3D.Particles.Particle.Color
[Test]
public void Fire()
{
    var emitterData = GetEmitterData(fire, 512, 2.0f);
    emitterData.Color = new RangeGraph<Color>(new Color(16, 16, 16), new Color(255, 64, 64, 0));
    emitterData.Acceleration = new RangeGraph<Vector3D>(Vector3D.Zero, Vector3D.UnitZ * 0.1f);
    emitterData.Size = new RangeGraph<Size>(new Size(0.2f), new Size(0.1f));
    emitterData.StartVelocity = new RangeGraph<Vector3D>(new Vector3D(0.0f, 0.0f, 0.3f),
        new Vector3D(0.1f, 0.1f, 0.1f));
    new ParticleEmitter(emitterData, new Vector3D(0.1f, 0.0f, 0.0f));
    new ParticleEmitter(emitterData, new Vector3D(0.0f, 0.1f, 0.0f));
}
[Test]
public void FireOneBullet()
{
    var emitterData = GetEmitterData(water, 512, 2.0f);
    emitterData.SpawnInterval = 0.0f;
    emitterData.Acceleration = new RangeGraph<Vector3D>(Vector3D.Zero, Vector3D.Zero);
    emitterData.Color = new RangeGraph<Color>(new Color(255, 255, 255), new Color(255, 255, 255));
    emitterData.Size = new RangeGraph<Size>(new Size(0.5f), new Size(0.5f));
    var emitter = new ParticleEmitter(emitterData, Vector3D.Zero);
    var enemy = new MockEnemy(new Vector3D(0, -3, 0), Size.Half, spark);
    new Command(() => //ncrunch: no coverage start
    {
        emitter.EmitterData.BillboardMode = BillboardMode.Ground;
        emitter.EmitterData.StartVelocity.Start = enemy.Position * 4.0f + enemy.direction * 0.5f;
        emitter.EmitterData.StartVelocity.End = Vector3D.Zero;
        emitter.Spawn();
    }).Add(new KeyTrigger(Key.Space));
    //ncrunch: no coverage end
}
See Also