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>
        /// Constructor.
        /// </summary>
        public VideoParticle(GameCamera camera, string resource)
        {
            this.camera = camera;
            this.resource = resource;

            Loaded = false;
        }
Beispiel #3
0
        public GameTerrain(GameEngine game, GameCamera camera, string resource)
            : base(game)
        {
            this.camera = camera;
            this.resource = resource;

            Loaded = false;
        }
Beispiel #4
0
 public virtual void Setup(GameCamera camera, Matrix world)
 {
     if (Effect == null)
     {
         Log.Write(this, "You cannot setup a technique that has not been added to a video effect object.", LogLevels.Error);
         return;
     }
 }
Beispiel #5
0
        public GameSky(GameEngine game, GameCamera camera, string resource, string effect)
            : base(game)
        {
            this.camera = camera;
            this.resource = resource;

            Loaded = false;
        }
Beispiel #6
0
        public VideoPrimitive(GameCamera camera, string resource, int size)
        {
            this.camera = camera;
            this.resource = resource;
            this.useTexture = true;
            this.vertexTextures = new VertexPositionTexture[size];

            Loaded = false;
        }
Beispiel #7
0
        public VideoPrimitive(GameCamera camera, int size)
        {
            this.camera = camera;
            this.resource = String.Empty;
            this.useTexture = false;
            this.vertexColors = new VertexPositionColor[size];

            Loaded = false;
        }
Beispiel #8
0
        public GameTerrain2(GameEngine game, GameCamera camera, GameSkyDome dome, string modelResource, string textureResource)
            : base(game)
        {
            Throw.IfNull(this, "dome", dome);
            Throw.IfNull(this, "camera", camera);

            this.dome = dome;
            this.camera = camera;

            this.modelResource = modelResource;
            this.textureResource = textureResource;
            this.effectResource = @"Effects\atmosphere";

            Loaded = false;
        }
Beispiel #9
0
        public ParticleScene(GameEngine game)
            : base(game)
        {
            // Setup a camera to view this scene.
            Camera = new GameCamera(game, PlayerIndex.One, new Vector3(0, 0, 0), new Vector3(0, 0, 0), Vector3.Up, 1, 10000, 1.0f);
            //Camera.CurrentType = VideoCamera.Types.Third;
            //Camera.Near = 1;
            //Camera.Far = 10000;

            // Create a title sprite to display the name of this scene.
            title = new VideoFont("Nibiru Engine - Particle Demo Scene", @"Fonts\trebuchet", new Vector2(10, 10), Color.White);

            // Simply change the class of the effect to try out other effects.
            effect = new VideoParticle(Camera, @"Particles\smoke");

            Attach(title);
            Attach(effect);
        }
Beispiel #10
0
 public VideoModel(GameCamera camera, string resource)
     : base(camera, resource, 0)
 {
     Destroy = false;
     UseBasicEffect = true;
 }
Beispiel #11
0
 public GameSkyDome(GameEngine game, GameCamera camera)
     : base(game)
 {
     this.camera = camera;
 }