Ejemplo n.º 1
0
        public void SetScene(Scene scene)
        {
            if (this.scene != null) {
                this.scene.primitiveAdded -= SceneUpdated;
                this.scene.scenePrimitiveUpdated -= SceneUpdated;
            }
            if (camera != null) {
                camera.cameraUpdated -= CameraUpdated;
            }

            this.scene = scene;
            switch (cameraType) {
                case CameraType.XOrtho: camera = scene.XOrthographicCamera; break;
                case CameraType.YOrtho: camera = scene.YOrthographicCamera; break;
                case CameraType.ZOrtho: camera = scene.ZOrthographicCamera; break;
                case CameraType.Perspective: camera = scene.PerspectiveCamera; break;
            }

            this.scene.primitiveAdded += SceneUpdated;
            this.scene.scenePrimitiveUpdated += SceneUpdated;
            camera.cameraUpdated += CameraUpdated;

            camera.Width = glControl.Width;
            camera.Height = glControl.Height;
        }
 private void OnCameraUpdated(Camera camera)
 {
     UpdateUIFromCamera();
 }
Ejemplo n.º 3
0
 private void CameraUpdated(Camera camera)
 {
     glControl.Invalidate();
 }