<commit_before>﻿/*
** Project ShiftDrive
** (C) <NAME>, 2016.
*/

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ShiftDrive {

    /// <summary>
    /// Contains static utilities to render a skybox.
    /// </summary>
    internal static class Skybox {

        private static float rotation;
        private static bool idleRotation;

        public static void SetIdleRotation(bool enabled) {
            idleRotation = enabled;
        }

        public static void Draw(GraphicsDevice graphicsDevice) {
            // Use the unlit shader to render a skybox.
            Effect fx = Assets.fxUnlit; // shortcut
            fx.Parameters["WVP"].SetValue(Matrix.CreateRotationY(rotation) *
                                          Matrix.CreateLookAt(new Vector3(0f, -0.2f, 2f), new Vector3(0, 0, 0),
                                              Vector3.Up) * SDGame.Inst.Projection);
            fx.Parameters["ModelTexture"].SetValue(Assets.textures["ui/skybox"]);
            foreach (ModelMesh mesh in Assets.mdlSkybox.Meshes) {
                foreach (ModelMeshPart part in mesh.MeshParts) {
                    part.Effect = fx;
                }

                fx.CurrentTechnique.Passes[0].Apply();
                mesh.Draw();
            }
        }

        public static void Update(GameTime gameTime) {
            if (!idleRotation) return;
            rotation += (float)(gameTime.ElapsedGameTime.TotalSeconds * 0.05);
            while (rotation >= MathHelper.TwoPi) rotation -= MathHelper.TwoPi;
        }

    }

}
<commit_msg>Tweak skybox rotation direction and speed<commit_after>﻿/*
** Project ShiftDrive
** (C) <NAME>, 2016.
*/

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ShiftDrive {

    /// <summary>
    /// Contains static utilities to render a skybox.
    /// </summary>
    internal static class Skybox {

        private static float rotation;
        private static bool idleRotation;

        public static void SetIdleRotation(bool enabled) {
            idleRotation = enabled;
        }

        public static void Draw(GraphicsDevice graphicsDevice) {
            // Use the unlit shader to render a skybox.
            Effect fx = Assets.fxUnlit; // shortcut
            fx.Parameters["WVP"].SetValue(Matrix.CreateRotationY(rotation) * Matrix.CreateRotationZ(rotation) *
                                          Matrix.CreateLookAt(new Vector3(0f, -0.25f, 2f), new Vector3(0, 0, 0),
                                              Vector3.Up) * SDGame.Inst.Projection);
            fx.Parameters["ModelTexture"].SetValue(Assets.textures["ui/skybox"]);
            foreach (ModelMesh mesh in Assets.mdlSkybox.Meshes) {
                foreach (ModelMeshPart part in mesh.MeshParts) {
                    part.Effect = fx;
                }

                fx.CurrentTechnique.Passes[0].Apply();
                mesh.Draw();
            }
        }

        public static void Update(GameTime gameTime) {
            if (!idleRotation) return;
            rotation += (float)(gameTime.ElapsedGameTime.TotalSeconds * 0.04);
            while (rotation >= MathHelper.TwoPi) rotation -= MathHelper.TwoPi;
        }

    }

}

{'fraction_non_alphanumeric': 0.10315009264978382, 'fraction_numerical': 0.011426806670784434, 'mean_word_length': 1.82882096069869, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1496781', 'n_tokens_mistral': 904, 'n_tokens_neox': 840, 'n_words': 204}