Пример #1
0
        private List<VertexPositionNormalTexture> GetTwilightVertices(float beat)
        {
            var result = new List<VertexPositionNormalTexture>();

            //The back center star, rotate it
            result.AddRange(GetBoxVertices(0, 1, new Vector2(0.0225F, -0.015F), 0.57F, 0.57F, Matrix.CreateRotationZ(beat * MathHelper.Pi / 3)));

            //The main star
            result.AddRange(GetFrameVertices(0, 0));

            var areaDefs = new AreaDef[] {
                new AreaDef(new Vector2(0.195F, 0.3075F), 0.25F, 0.355F, 0),
                new AreaDef(new Vector2(0.2425F, -0.225F), 0.2625F, 0.51F, 1),
                new AreaDef(new Vector2(-0.11F, -0.3175F), 0.2F, 0.365F, 2),
                new AreaDef(new Vector2(-0.2925F, -0.06F), 0.255F, 0.405F, 3),
                new AreaDef(new Vector2(-0.185F, 0.3525F), 0.185F, 0.295F, 4),
            };

            AdvancePulse(beat);

            result.AddRange(areaDefs.SelectMany(a =>
                GetBoxVertices(0, a.Index + 2, a.Center, a.Width, a.Height, a.Index == currentPulse ? Matrix.CreateScale(2 - (beat - previousBeat)) : Matrix.Identity)));

            return result;
        }
Пример #2
0
        private List<VertexPositionNormalTexture> GetFluttershyVertices(float beat)
        {
            var result = new List<VertexPositionNormalTexture>();

            //3 butterfly wings, then 3 butterfly bodies
            var areaDefs = new AreaDef[] {
                new AreaDef(new Vector2(-0.1975F, -0.18F), 0.6F, 0.5F, 0),
                new AreaDef(new Vector2(0.13F, 0.2F), 0.6F, 0.5F, 1),
                new AreaDef(new Vector2(0.24F, -0.245F), 0.6F, 0.5F, 2),
                new AreaDef(new Vector2(-0.1975F, -0.18F), 0.6F, 0.5F, 3),
                new AreaDef(new Vector2(0.13F, 0.2F), 0.6F, 0.5F, 4),
                new AreaDef(new Vector2(0.24F, -0.245F), 0.6F, 0.5F, 5),
            };

            //butterflies are actually stored on sprite sheet oriented vertically.  rotate them to the proper orientations for the cutie mark _after_ flapping the wings
            var rotations = new Matrix[] {
                Matrix.CreateRotationZ(MathHelper.ToRadians(-33.6F)),
                Matrix.CreateRotationZ(MathHelper.ToRadians(30.1F)),
                Matrix.CreateRotationZ(MathHelper.ToRadians(27.8F))
            };

            result.AddRange(areaDefs.SelectMany(a =>
                GetBoxVertices(4, a.Index, a.Center, a.Width, a.Height,
                    (a.Index <= 2 ? Matrix.CreateScale(1 + (float)Math.Sin(beat * MathHelper.TwoPi) / 4F, 1 + (float)Math.Sin((beat + 0.5F) * MathHelper.TwoPi) / 4F, 1) : Matrix.Identity)
                    * rotations[a.Index % 3])));

            return result;
        }
Пример #3
0
        private List<VertexPositionNormalTexture> GetPinkiePieVertices(float beat)
        {
            var result = new List<VertexPositionNormalTexture>();

            //actual center Ys are -0.1025, 0.1625, -0.1375.  but we don't care where the center is if just translating

            var areaDefs = new AreaDef[] {
                new AreaDef(new Vector2(-0.125F, 0), 0.5F, 1.0F, 0),
                new AreaDef(new Vector2(-0.0175F, 0), 0.5F, 1.0F, 1),
                new AreaDef(new Vector2(0.195F, 0), 0.5F, 1.0F, 2),
            };

            result.AddRange(areaDefs.SelectMany(a =>
                GetBoxVertices(5, a.Index, a.Center, a.Width, a.Height,
                Matrix.CreateTranslation(
                    (float)Math.Sin((beat + a.Index / 2F) * MathHelper.Pi) / 16F,
                    (float)Math.Cos((beat + a.Index / 2F) * MathHelper.Pi) / 16F,
                    0))));

            return result;
        }
Пример #4
0
        private List<VertexPositionNormalTexture> GetApplejackVertices(float beat)
        {
            var result = new List<VertexPositionNormalTexture>();

            var areaDefs = new AreaDef[] {
                new AreaDef(new Vector2(-0.245F, -0.1775F), 0.5F, 0.5F, 0),
                new AreaDef(new Vector2(0.06F, 0.1725F), 0.5F, 0.5F, 1),
                new AreaDef(new Vector2(0.23F, -0.2725F), 0.5F, 0.63F, 2),
            };

            result.AddRange(areaDefs.SelectMany(a =>
                GetBoxVertices(1, a.Index, a.Center, a.Width, a.Height, Matrix.CreateRotationZ((float)Math.Sin((beat - a.Index / 3F) * MathHelper.PiOver2) * 0.75F))));

            return result;
        }