Beispiel #1
0
        public ModelScene(GameEngine game)
            : base(game)
        {
            // Create a title sprite to display the name of this scene.
            title = new VideoFont("Nibiru Engine - Model Demo Scene", @"Fonts\trebuchet", new Vector2(10, 10), Color.White);

            // Setup a camera to view this scene.
            Camera = new GameCamera(game, PlayerIndex.One, new Vector3(0, 0, 50), Vector3.Zero, Vector3.Up, 1, 10000, 250.0f);
            Camera.AllowMove = true;
            Camera.AllowPitch = true;
            Camera.AllowYaw = false;
            Camera.AllowRoll = false;
            Camera.UseKeyboard = true;

            // Setup the sky dome that will render a sky/sun around the world.
            Sky = new GameSkyDome(game, Camera);

            // Setup a game terrain that will be loaded from the heightmap image.
            Terrain = new GameTerrain2(game, Camera, Sky, @"Models\terrain", @"Models\ground");

            // Create the spaceship avatar that the camera will center around.
            spaceship = new VideoModel(Camera, @"Models\spaceship");

            Attach(title);
            Attach(spaceship);
        }
Beispiel #2
0
 /// <summary>
 /// Registers a collision between two video models, resulting in the delegate specified being called.
 /// </summary>
 /// <param name="one"></param>
 /// <param name="two"></param>
 /// <param name="collision"></param>
 public void RegisterCollision(VideoModel collider, bool repeat, CollisionEvent collision)
 {
     collisions.Add(new CollisionEventData(this, collider, repeat, collision));
 }