Esempio n. 1
0
        protected override void Init()
        {
            CameraComponent = Components.First(c => c.Id == CameraComponentId) as CameraComponent;
            CameraComponent.ClearColor = new Vector4(0.2f, 0.2f, 0.2f, 1.0f);

            Position = new Vector3(0, 0, 10);
        }
Esempio n. 2
0
        public void SetCurrentCamera(CameraComponent cameraComponent)
        {
            if (!_gameObjects.Any(g => g.Components.Contains(cameraComponent)))
            {
                throw new Exception("Camera is not part of this scene");
            }

            CurrentCamera = cameraComponent;
        }
Esempio n. 3
0
 public Camera(float fieldOfViewRadians, float aspectRatio, float zNear, float zFar)
 {
     CameraComponent = new CameraComponent(this, fieldOfViewRadians, aspectRatio, zNear, zFar);
     AddComponent(CameraComponent);
 }