ParticleSystem IsActive 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 override bool IsActive { get; set; }

Property Value

Type: Boolean

Implements

HierarchyObject3D IsActive
Remarks

Tests: DeltaEngine.Rendering3D.Particles.Tests.ParticleSystemTests
Examples

4 unit tests call DeltaEngine.Rendering3D.Particles.ParticleSystem.IsActive
[Test, CloseAfterFirstFrame]
public void AttachingEmitterSetsPositionAndRotation()
{
    particleSystem.Position = Vector3D.UnitY;
    particleSystem.Orientation = Quaternion.FromAxisAngle(Vector3D.UnitZ, 45);
    var emitter = CreateAndAttachEmitter(Vector3D.UnitX);
    particleSystem.FireBurstOfAllEmitters();
    particleSystem.FireBurstAtRelativePosition(Vector3D.One);
    particleSystem.FireBurstAtRelativePositionAndRotation(Vector3D.One, 0.5f);
    Assert.AreEqual(particleSystem.Position, emitter.Position);
    Assert.AreEqual(particleSystem.Orientation, emitter.Rotation);
    Assert.IsTrue(particleSystem.IsActive);
    particleSystem.IsActive = false;
    Assert.IsFalse(particleSystem.IsActive);
}
[Test, CloseAfterFirstFrame]
public void DisposeEmitterDeactivates()
{
    var emitterAlpha = CreateAndAttachEmitter(Vector3D.Zero);
    var emitterBeta = CreateAndAttachEmitter(Vector3D.UnitY);
    particleSystem.DisposeEmitter(1);
    particleSystem.DisposeEmitter(emitterAlpha);
    particleSystem.DisposeEmitter(emitterAlpha);
    Assert.IsFalse(emitterAlpha.IsActive);
    Assert.IsFalse(emitterBeta.IsActive);
    Assert.AreEqual(0, particleSystem.AttachedEmitters.Count);
}
[Test, CloseAfterFirstFrame]
public void RemoveEmitterJustDeattaches()
{
    var emitterAlpha = CreateAndAttachEmitter(Vector3D.Zero);
    var emitterBeta = CreateAndAttachEmitter(Vector3D.UnitY);
    particleSystem.RemoveEmitter(0);
    particleSystem.RemoveEmitter(emitterBeta);
    Assert.AreEqual(0, particleSystem.AttachedEmitters.Count);
    Assert.IsTrue(emitterAlpha.IsActive);
    Assert.IsTrue(emitterBeta.IsActive);
}
See Also