spaceconquest.PlanetModel.InitializePrimitive C# (CSharp) Method

InitializePrimitive() public static method

public static InitializePrimitive ( Model m_unpopulated, Model m_populated ) : void
m_unpopulated Microsoft.Xna.Framework.Graphics.Model
m_populated Microsoft.Xna.Framework.Graphics.Model
return void
        public static void InitializePrimitive(Model m_unpopulated, Model m_populated)
        {
            poplulatedPlanet = m_populated;
            unpoplulatedPlanet = m_unpopulated;
            GraphicsDevice graphicsDevice = Game1.device;

            Point center = Point.Zero;

            poplulatedPlanet.Root.Transform = Matrix.CreateScale(20f);
            unpoplulatedPlanet.Root.Transform = Matrix.CreateScale(20f);

            basicEffect = new BasicEffect(Game1.device);

            foreach (ModelMesh mesh in poplulatedPlanet.Meshes)
            {
                foreach (ModelMeshPart part in mesh.MeshParts)
                {
                    part.Effect = basicEffect;
                }
            }

            foreach (ModelMesh mesh in unpoplulatedPlanet.Meshes)
            {
                foreach (ModelMeshPart part in mesh.MeshParts)
                {
                    part.Effect = basicEffect;
                }
            }

            // Create a BasicEffect, which will be used to render the primitive.
            //basicEffect = new BasicEffect(graphicsDevice);

            basicEffect.EnableDefaultLighting();
        }