コード例 #1
0
 public ParticleSystem(Sprite particleSprite, Vector2 position)
 {
     MaximumParticleCount = 200;
     //TODO start with sane defaults
     Acceleration         = new Vector2();
     AccelerationVariance = 0f;
     ColorRange           = new SS14.Shared.Utility.Range <Vector4>(Vector4.UnitX * 255, Vector4.Zero);
     ColorVariance        = 0f;
     EmissionOffset       = new Vector2();
     EmissionRadiusRange  = new SS14.Shared.Utility.Range <float>(0f, 0f);
     Emit                           = false;
     EmitRate                       = 1;
     EmitterPosition                = position;
     Lifetime                       = 1.0f;
     LifetimeVariance               = 0f;
     ParticleSprite                 = particleSprite;
     RadialAcceleration             = 0f;
     RadialAccelerationVariance     = 0f;
     RadialVelocity                 = 0f;
     RadialVelocityVariance         = 0f;
     SizeRange                      = new SS14.Shared.Utility.Range <float>(1, 0);
     SizeVariance                   = 0.1f;
     SpinVelocity                   = new SS14.Shared.Utility.Range <float>(0f, 0f);
     SpinVelocityVariance           = 0f;
     TangentialAcceleration         = 0;
     TangentialAccelerationVariance = 0;
     TangentialVelocity             = 0;
     TangentialVelocityVariance     = 0;
     Velocity                       = new Vector2();
     VelocityVariance               = 0;
 }
コード例 #2
0
 private Vector2 RandomRangeVector2(SS14.Shared.Utility.Range <Vector2> randomRange)
 {
     return(new Vector2(
                RandomRangeFloat(randomRange.Start.X, randomRange.End.X),
                RandomRangeFloat(randomRange.Start.Y, randomRange.End.Y)
                ));
 }
コード例 #3
0
 private Vector4 RandomRangeVector4(SS14.Shared.Utility.Range <Vector4> randomRange)
 {
     return(new Vector4(
                RandomRangeFloat(randomRange.Start.X, randomRange.End.X),
                RandomRangeFloat(randomRange.Start.Y, randomRange.End.Y),
                RandomRangeFloat(randomRange.Start.Z, randomRange.End.Z),
                RandomRangeFloat(randomRange.Start.W, randomRange.End.W)
                ));
 }
コード例 #4
0
 private float RandomRangeFloat(SS14.Shared.Utility.Range <float> randomRange)
 {
     return((RandomFloat() * (randomRange.End - randomRange.Start)) + randomRange.Start);
 }