Rewrote the particles to allow for more advanced particles.
+ Particles can now be detached from the object. + Each particle now has an own Lifetime, that can be controlled. + Particles can now appear in a continuous way.
This commit is contained in:
parent
651628401d
commit
db7f01dca1
9 changed files with 171 additions and 109 deletions
38
SMCode/SM.Base/Drawing/Particles/ParticleInstance.cs
Normal file
38
SMCode/SM.Base/Drawing/Particles/ParticleInstance.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using OpenTK;
|
||||
|
||||
namespace SM.Base.Drawing.Particles
|
||||
{
|
||||
public class ParticleInstance : Instance
|
||||
{
|
||||
public float StartLifetime = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The lifetime this particular particle still has.
|
||||
/// </summary>
|
||||
public float Lifetime = 0;
|
||||
|
||||
/// <summary>
|
||||
/// A additional matrix to store rotation and scale.
|
||||
/// </summary>
|
||||
public Matrix4 Matrix;
|
||||
|
||||
/// <summary>
|
||||
/// Speeeeeeeeeed
|
||||
/// </summary>
|
||||
public float Speed;
|
||||
}
|
||||
|
||||
public class ParticleInstance<TValue> : ParticleInstance
|
||||
where TValue : struct
|
||||
{
|
||||
/// <summary>
|
||||
/// A direction, that the particle should travel.
|
||||
/// </summary>
|
||||
public TValue Direction;
|
||||
|
||||
/// <summary>
|
||||
/// The start position.
|
||||
/// </summary>
|
||||
public TValue StartPosition;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue