Beispiel #1
0
        private void UpdateRays(float elapsedSeconds)
        {
            bool flag = (double)this.PhaseTime > 1.5;

            this.MakeRay();
            if (flag)
            {
                this.MakeRay();
            }
            for (int i = this.RaysMesh.Groups.Count - 1; i >= 0; --i)
            {
                Group            group    = this.RaysMesh.Groups[i];
                DotHost.RayState rayState = group.CustomData as DotHost.RayState;
                rayState.Age          += elapsedSeconds * 0.15f;
                group.Material.Diffuse = Vector3.One * FezMath.Saturate(rayState.Age * 8f);
                group.Scale           *= new Vector3(1.5f, 1f, 1f);
                if ((double)rayState.Age > 1.0)
                {
                    this.RaysMesh.RemoveGroupAt(i);
                }
            }
            this.RaysMesh.AlwaysOnTop       = false;
            this.FlareMesh.Position         = this.RaysMesh.Position = TempleOfLoveHost.HeartCenter;
            this.FlareMesh.Rotation         = this.RaysMesh.Rotation = this.CameraManager.Rotation;
            this.FlareMesh.Material.Opacity = Easing.EaseIn((double)FezMath.Saturate(this.PhaseTime / 2.5f), EasingType.Cubic);
            this.FlareMesh.Scale            = Vector3.One + this.RaysMesh.Scale * Easing.EaseIn(((double)this.PhaseTime - 0.25) / 1.75, EasingType.Decic) * 4f;
        }
Beispiel #2
0
 private void UpdateRays(float elapsedSeconds)
 {
     if (this.TrialRaysMesh.Groups.Count < 50 && RandomHelper.Probability(0.2))
     {
         float x     = 6f + RandomHelper.Centered(4.0);
         float num   = RandomHelper.Between(0.5, (double)x / 2.5);
         Group group = this.TrialRaysMesh.AddGroup();
         group.Geometry = (IIndexedPrimitiveCollection) new IndexedUserPrimitives <FezVertexPositionTexture>(new FezVertexPositionTexture[6]
         {
             new FezVertexPositionTexture(new Vector3(0.0f, (float)((double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(0.0f, 0.0f)),
             new FezVertexPositionTexture(new Vector3(x, num / 2f, 0.0f), new Vector2(1f, 0.0f)),
             new FezVertexPositionTexture(new Vector3(x, (float)((double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(1f, 0.45f)),
             new FezVertexPositionTexture(new Vector3(x, (float)(-(double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(1f, 0.55f)),
             new FezVertexPositionTexture(new Vector3(x, (float)(-(double)num / 2.0), 0.0f), new Vector2(1f, 1f)),
             new FezVertexPositionTexture(new Vector3(0.0f, (float)(-(double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(0.0f, 1f))
         }, new int[12]
         {
             0,
             1,
             2,
             0,
             2,
             5,
             5,
             2,
             3,
             5,
             3,
             4
         }, PrimitiveType.TriangleList);
         group.CustomData = (object)new DotHost.RayState();
         group.Material   = new Material()
         {
             Diffuse = new Vector3(0.0f)
         };
         group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Forward, RandomHelper.Between(0.0, 6.28318548202515));
     }
     for (int i = this.TrialRaysMesh.Groups.Count - 1; i >= 0; --i)
     {
         Group            group    = this.TrialRaysMesh.Groups[i];
         DotHost.RayState rayState = group.CustomData as DotHost.RayState;
         rayState.Age += elapsedSeconds * 0.15f;
         float num1 = Easing.EaseOut((double)Easing.EaseOut(Math.Sin((double)rayState.Age * 6.28318548202515 - 1.57079637050629) * 0.5 + 0.5, EasingType.Quintic), EasingType.Quintic);
         group.Material.Diffuse = Vector3.Lerp(Vector3.One, rayState.Tint.ToVector3(), 0.05f) * 0.15f * num1;
         float num2 = rayState.Speed;
         group.Rotation *= Quaternion.CreateFromAxisAngle(Vector3.Forward, (float)((double)elapsedSeconds * (double)num2 * (0.100000001490116 + (double)Easing.EaseIn((double)this.TrialTimeAccumulator / 3.0, EasingType.Quadratic) * 0.200000002980232)));
         group.Scale     = new Vector3((float)((double)num1 * 0.75 + 0.25), (float)((double)num1 * 0.5 + 0.5), 1f);
         if ((double)rayState.Age > 1.0)
         {
             this.TrialRaysMesh.RemoveGroupAt(i);
         }
     }
     this.TrialFlareMesh.Position         = this.TrialRaysMesh.Position = this.Rings[0].Position;
     this.TrialFlareMesh.Rotation         = this.TrialRaysMesh.Rotation = this.CameraManager.Rotation;
     this.TrialRaysMesh.Scale             = new Vector3(Easing.EaseIn((double)this.TrialTimeAccumulator / 2.0, EasingType.Quadratic) + 1f);
     this.TrialFlareMesh.Material.Opacity = (float)(0.125 + (double)Easing.EaseIn((double)FezMath.Saturate((float)(((double)this.TrialTimeAccumulator - 2.0) / 3.0)), EasingType.Cubic) * 0.875);
     this.TrialFlareMesh.Scale            = Vector3.One + this.TrialRaysMesh.Scale * Easing.EaseIn((double)Math.Max(this.TrialTimeAccumulator - 2.5f, 0.0f) / 1.5, EasingType.Cubic) * 4f;
 }
Beispiel #3
0
 private void UpdateRays(float elapsedSeconds)
 {
     if (RandomHelper.Probability(0.03))
     {
         float x     = 6f + RandomHelper.Centered(4.0);
         float num   = RandomHelper.Between(0.5, (double)x / 2.5);
         Group group = this.RaysMesh.AddGroup();
         group.Geometry = (IIndexedPrimitiveCollection) new IndexedUserPrimitives <FezVertexPositionTexture>(new FezVertexPositionTexture[6]
         {
             new FezVertexPositionTexture(new Vector3(0.0f, (float)((double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(0.0f, 0.0f)),
             new FezVertexPositionTexture(new Vector3(x, num / 2f, 0.0f), new Vector2(1f, 0.0f)),
             new FezVertexPositionTexture(new Vector3(x, (float)((double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(1f, 0.45f)),
             new FezVertexPositionTexture(new Vector3(x, (float)(-(double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(1f, 0.55f)),
             new FezVertexPositionTexture(new Vector3(x, (float)(-(double)num / 2.0), 0.0f), new Vector2(1f, 1f)),
             new FezVertexPositionTexture(new Vector3(0.0f, (float)(-(double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(0.0f, 1f))
         }, new int[12]
         {
             0,
             1,
             2,
             0,
             2,
             5,
             5,
             2,
             3,
             5,
             3,
             4
         }, PrimitiveType.TriangleList);
         group.CustomData = (object)new DotHost.RayState();
         group.Material   = new Material()
         {
             Diffuse = new Vector3(0.0f)
         };
         group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Forward, RandomHelper.Between(0.0, 6.28318548202515));
     }
     for (int i = this.RaysMesh.Groups.Count - 1; i >= 0; --i)
     {
         Group            group    = this.RaysMesh.Groups[i];
         DotHost.RayState rayState = group.CustomData as DotHost.RayState;
         rayState.Age += elapsedSeconds * 0.15f;
         float num1 = Easing.EaseOut(Math.Sin((double)rayState.Age * 6.28318548202515 - 1.57079637050629) * 0.5 + 0.5, EasingType.Quadratic);
         group.Material.Diffuse = new Vector3(num1 * 0.0375f) + rayState.Tint.ToVector3() * 0.075f * num1;
         float num2 = rayState.Speed;
         group.Rotation *= Quaternion.CreateFromAxisAngle(Vector3.Forward, (float)((double)elapsedSeconds * (double)num2 * 0.300000011920929));
         group.Scale     = new Vector3((float)((double)num1 * 0.75 + 0.25), (float)((double)num1 * 0.5 + 0.5), 1f);
         if ((double)rayState.Age > 1.0)
         {
             this.RaysMesh.RemoveGroupAt(i);
         }
     }
     this.FlareMesh.Position         = this.RaysMesh.Position = this.DotMesh.Position;
     this.FlareMesh.Rotation         = this.RaysMesh.Rotation = Quaternion.Identity;
     this.RaysMesh.Scale             = this.DotMesh.Scale * 0.5f;
     this.FlareMesh.Scale            = new Vector3(MathHelper.Lerp(this.DotMesh.Scale.X * 0.875f, (float)Math.Pow((double)this.DotMesh.Scale.X * 1.5, 1.5), 1f));
     this.FlareMesh.Material.Diffuse = new Vector3(0.25f * FezMath.Saturate(this.Opacity * 2f));
 }