Beispiel #1
0
        public void Draw(CanvasDrawingSession ds, CanvasSpriteBatch SBatch, TextureLoader Textures)
        {
            lock ( PFSim )
            {
                var Snapshot = PFSim.Snapshot();
                while (Snapshot.MoveNext())
                {
                    Particle P = Snapshot.Current;

                    float A = Vector2.Transform(new Vector2(0, 1), Matrix3x2.CreateRotation(P.ttl * 0.01f)).X;

                    Vector4 Tint = new Vector4(
                        P.Tint.M11 + P.Tint.M21 + P.Tint.M31 + P.Tint.M41 + P.Tint.M51,
                        P.Tint.M12 + P.Tint.M22 + P.Tint.M32 + P.Tint.M42 + P.Tint.M52,
                        P.Tint.M13 + P.Tint.M23 + P.Tint.M33 + P.Tint.M43 + P.Tint.M53,
                        P.Tint.M14 + P.Tint.M24 + P.Tint.M34 + P.Tint.M44 + P.Tint.M54
                        );

                    Tint.W *= A;
                    ScrollWind.Strength *= 0.5f;

                    SBatch.Draw(
                        Textures[P.TextureId]
                        , P.Pos, Tint
                        , Textures.Center[P.TextureId], 0, P.Scale
                        , CanvasSpriteFlip.None);
                }

                DrawWireFrames(ds);
            }
        }
Beispiel #2
0
        public void Draw(CanvasDrawingSession ds, CanvasSpriteBatch SBatch, TextureLoader Textures)
        {
            lock ( PFSim )
            {
                var Snapshot = PFSim.Snapshot();
                while (Snapshot.MoveNext())
                {
                    Particle P = Snapshot.Current;

                    float A = (P.Trait & PFTrait.IMMORTAL) == 0 ? P.ttl * 0.033f : 1;

                    P.Tint.M12 = 4 * (1 - A);
                    P.Tint.M21 = 3 * A;

                    Vector4 Tint = new Vector4(
                        P.Tint.M11 + P.Tint.M21 + P.Tint.M31 + P.Tint.M41 + P.Tint.M51,
                        P.Tint.M12 + P.Tint.M22 + P.Tint.M32 + P.Tint.M42 + P.Tint.M52,
                        P.Tint.M13 + P.Tint.M23 + P.Tint.M33 + P.Tint.M43 + P.Tint.M53,
                        P.Tint.M14 + P.Tint.M24 + P.Tint.M34 + P.Tint.M44 + P.Tint.M54
                        ) * 2;

                    Tint.W *= A * 0.125f;

                    SBatch.Draw(Textures[P.TextureId], P.Pos, Tint, Textures.Center[P.TextureId], 0, P.Scale * A, CanvasSpriteFlip.None);
                }

                DrawWireFrames(ds);
            }
        }