Ejemplo n.º 1
0
 public LongRunningAction IncrementTimeFactor(float secondsUntilDouble)
 {
     return(new LongRunningAction((Func <float, float, bool>)((elapsedSeconds, _) =>
     {
         this.TimeManager.TimeFactor = FezMath.DoubleIter(this.TimeManager.TimeFactor, elapsedSeconds, secondsUntilDouble);
         return false;
     })));
 }
Ejemplo n.º 2
0
 public LongRunningAction RotateIncrementally(int id, float initPitch, float initYaw, float initRoll, float secondsUntilDouble)
 {
     return(new LongRunningAction((Func <float, float, bool>)((elapsedSeconds, _) =>
     {
         ArtObjectInstance local_0;
         if (!this.LevelManager.ArtObjects.TryGetValue(id, out local_0))
         {
             return true;
         }
         initYaw = FezMath.DoubleIter(initYaw, elapsedSeconds, secondsUntilDouble);
         initPitch = FezMath.DoubleIter(initPitch, elapsedSeconds, secondsUntilDouble);
         initRoll = FezMath.DoubleIter(initRoll, elapsedSeconds, secondsUntilDouble);
         local_0.Rotation = Quaternion.CreateFromYawPitchRoll(initYaw, initPitch, initRoll) * local_0.Rotation;
         return false;
     })));
 }
Ejemplo n.º 3
0
            public void Update(float elapsedSeconds)
            {
                this.AgeSeconds += elapsedSeconds;
                float amount = this.AgeSeconds / this.Settings.ParticleLifetime;

                if ((double)elapsedSeconds != 0.0)
                {
                    this.GravityEffect += this.Settings.Gravity;
                }
                if ((double)this.Settings.Acceleration != 0.0)
                {
                    this.Velocity.X = FezMath.DoubleIter(this.Velocity.X, elapsedSeconds, 1f / this.Settings.Acceleration);
                    this.Velocity.Y = FezMath.DoubleIter(this.Velocity.Y, elapsedSeconds, 1f / this.Settings.Acceleration);
                    this.Velocity.Z = FezMath.DoubleIter(this.Velocity.Z, elapsedSeconds, 1f / this.Settings.Acceleration);
                }
                this.Position += (this.Velocity + this.GravityEffect) * elapsedSeconds;
                Vector4 vector4 = (double)amount >= (double)this.Settings.FadeInDuration ? ((double)amount <= 1.0 - (double)this.Settings.FadeOutDuration ? this.LifeColor : Vector4.Lerp(this.LifeColor, this.DieColor, (amount - (1f - this.Settings.FadeOutDuration)) / this.Settings.FadeOutDuration)) : Vector4.Lerp(this.SpawnColor, this.LifeColor, amount / this.Settings.FadeInDuration);

                if (this.System.FadingOut)
                {
                    vector4 = Vector4.Lerp(vector4, this.DieColor, this.System.FadeOutAge);
                }
                if (this.Settings.Billboarding)
                {
                    this.Phi = this.System.BillboardingPhi;
                }
                if (this.SizeBirth != this.SizeDeath)
                {
                    this.Scale = Vector3.Lerp(this.SizeBirth, this.SizeDeath, amount);
                }
                Vector3 vector3 = this.Position;

                if (this.Settings.ClampToTrixels)
                {
                    vector3 = FezMath.Round(this.Position * 16f) / 16f + this.Scale / 2f;
                }
                this.System.Geometry.Instances[this.InstanceIndex] = new Matrix(vector3.X, vector3.Y, vector3.Z, this.Phi, this.Scale.X, this.Scale.Y, this.Scale.Z, 0.0f, vector4.X, vector4.Y, vector4.Z, vector4.W, 0.0f, 0.0f, 0.0f, 0.0f);
            }