Namespace: DeltaEngine.Rendering3D.Particles.Tests
Assembly: DeltaEngine.Rendering3D.Particles.Tests (in DeltaEngine.Rendering3D.Particles.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Rendering3D.Particles.Tests (in DeltaEngine.Rendering3D.Particles.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Examples
[Test] public void TrackRotationOfEmitterVisually() { var emitterData = CreateTrackingParticleData(); emitterData.SpawnInterval = 0; emitterData.BillboardMode = BillboardMode.Ground; emitterData.LifeTime = 1.0f; var emitter = new ParticleEmitter(emitterData, Vector3D.Zero); new Command(Command.Click, () => emitter.Rotation *= Quaternion.FromAxisAngle(Vector3D.UnitY, 30.0f)); //ncrunch: no coverage new Command(Command.MiddleClick, () => emitter.Spawn(1)); }
[Test, CloseAfterFirstFrame] public void TrackRotationOfEmitter() { var emitterData = CreateTrackingParticleData(); emitterData.SpawnInterval = 0; emitterData.BillboardMode = BillboardMode.Ground; emitterData.LifeTime = 0.0f; var emitter = new ParticleEmitter(emitterData, Vector3D.Zero); emitter.Rotation = Quaternion.FromAxisAngle(Vector3D.UnitZ, 60); AdvanceTimeAndUpdateEntities(); emitter.Spawn(1); Assert.AreEqual(emitter.Rotation.CalculateAxisAngle(), emitter.particles[0].Rotation); emitter.Rotation = Quaternion.FromAxisAngle(Vector3D.UnitZ, 90); AdvanceTimeAndUpdateEntities(); Assert.AreEqual(emitter.Rotation.CalculateAxisAngle(), emitter.particles[0].Rotation); }
See Also