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); }
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; }
public Camera(float fieldOfViewRadians, float aspectRatio, float zNear, float zFar) { CameraComponent = new CameraComponent(this, fieldOfViewRadians, aspectRatio, zNear, zFar); AddComponent(CameraComponent); }