Пример #1
0
        /// <summary>
        /// Given a scene, render all the objects in the scene.
        /// </summary>
        /// <param name="scene">Scene to be rendered</param>
        /// <param name="camera">Camera object</param>
        public void Draw(Scene scene, GameObject camera)
        {
            List<GameObject> objects = scene.Visible();

            game.GraphicsDevice.Clear(Color.Black);

            Matrix worldMatrix = Matrix.Identity;
            Matrix cameraMatrix = camera.position.matrix();
            Matrix objectMatrix;

            foreach (GameObject obj in objects)
            {
                objectMatrix = worldMatrix * obj.position.matrix();
                RenderObject(obj, cameraMatrix, objectMatrix);
            }
        }