コード例 #1
0
ファイル: Renderer.cs プロジェクト: jreese/equinox
        /// <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);
            }
        }