ParticleSystem ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Entities DrawableEntity
      DeltaEngine.Rendering3D Entity3D
        DeltaEngine.Rendering3D HierarchyEntity3D
          DeltaEngine.Rendering3D.Particles ParticleSystem

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

public class ParticleSystem : HierarchyEntity3D

The ParticleSystem type exposes the following members.

Constructors

  NameDescription
Public methodParticleSystem 
Initializes a new instance of the ParticleSystem class
Public methodParticleSystem(ParticleSystemData)
Initializes a new instance of the ParticleSystem class
Top
Methods

  NameDescription
Public methodAdd(HierarchyObject3D) (Inherited from HierarchyEntity3D.)
Public methodAdd T (T) (Inherited from Entity3D.)
Public methodAddTag (Inherited from Entity.)
Public methodAttachEmitter
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity3D.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodDisposeEmitter(Int32)
Public methodDisposeEmitter(ParticleEmitter)
Public methodDisposeSystem
Public methodFireBurstAtRelativePosition
Public methodFireBurstAtRelativePositionAndRotation
Public methodFireBurstOfAllEmitters
Public methodGet T  (Inherited from Entity3D.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity3D.)
Protected methodGetDrawBehaviors (Inherited from DrawableEntity.)
Public methodGetFirstChildOfType T  (Inherited from HierarchyEntity3D.)
Public methodGetInterpolatedArray T  (Inherited from DrawableEntity.)
Public methodGetInterpolatedList T  (Inherited from DrawableEntity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Protected methodNextUpdateStarted (Inherited from Entity3D.)
Public methodOnDraw T  (Inherited from DrawableEntity.)
Protected methodOnOrientationChanged (Overrides HierarchyEntity3D OnOrientationChanged .)
Protected methodOnPositionChanged (Overrides HierarchyEntity3D OnPositionChanged .)
Protected methodOnScaleChanged (Inherited from HierarchyEntity3D.)
Public methodRemove(HierarchyObject3D) (Inherited from HierarchyEntity3D.)
Public methodRemove T   (Inherited from Entity.)
Public methodRemoveEmitter(Int32)
Public methodRemoveEmitter(ParticleEmitter)
Public methodRemoveTag (Inherited from Entity.)
Public methodSet (Inherited from Entity3D.)
Public methodSetComponents (Inherited from Entity.)
Public methodSetWithoutInterpolation T  (Inherited from Entity3D.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToggleVisibility (Inherited from DrawableEntity.)
Public methodToString (Inherited from Entity.)
Public methodUpdateGlobalsFromParent (Inherited from HierarchyEntity3D.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Protected fieldlastOrientation (Inherited from Entity3D.)
Protected fieldlastPosition (Inherited from Entity3D.)
Protected fieldlastTickLerpComponents
Each element can either be a Lerp, a Lerp List or an array of Lerp objects. View code on GitHub
(Inherited from DrawableEntity.)
Top
Properties

  NameDescription
Public propertyAttachedEmitters
Public propertyChildren (Inherited from HierarchyEntity3D.)
Public propertyIsActive (Overrides HierarchyEntity3D IsActive.)
Public propertyIsPauseable (Inherited from Entity.)
Public propertyIsVisible (Inherited from DrawableEntity.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyOrientation (Inherited from Entity3D.)
Public propertyParent (Inherited from HierarchyEntity3D.)
Public propertyPosition (Inherited from Entity3D.)
Public propertyRelativeOrientation (Inherited from HierarchyEntity3D.)
Public propertyRelativePosition (Inherited from HierarchyEntity3D.)
Public propertyRenderLayer (Inherited from DrawableEntity.)
Public propertyScale (Inherited from Entity3D.)
Public propertyUpdatePriority (Inherited from Entity.)
Top
Remarks

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

8 unit tests call DeltaEngine.Rendering3D.Particles.ParticleSystem
[Test, CloseAfterFirstFrame]
public void NewSystemHasListInitialized()
{
    Assert.IsNotNull(particleSystem.AttachedEmitters);
}
[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);
}
See Also