public virtual void Draw(GameTime gameTime, Camera camera)
 {
     foreach (ModelMesh mesh in _model.Meshes)
     {
         foreach (BasicEffect b in mesh.Effects)
         {
             b.World = this.World;
             b.View = camera.View;
             b.Projection = camera.Projection;
         }
         mesh.Draw();
     }
 }
示例#2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            camera = new Camera(GraphicsDevice);
            asteroid = new Asteroid(this, "Models/asteroid");
            skybox = new Skybox(this, "Models/skybox2", camera);
            gameSpace = new GameSpace(this, "Models/gamesphere");

            camera.Target = asteroid;
        }
示例#3
0
 //public Skybox( Game game, Camera camera ) : base( game, "skybox" )
 //{
 //    this.camera = camera;
 //}
 public Skybox( Game game, String model, Camera camera )
     : base(game, model)
 {
     this.camera = camera;
 }