blob: 0eb02376ef68418303f2704d6d5c955e6602a1ce [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <optional>
#include "impeller/geometry/matrix.h"
namespace impeller {
namespace scene {
class Camera {
public:
static Camera MakePerspective(Scalar fov_y, Vector3 position);
Camera LookAt(Vector3 target, Vector3 up = Vector3(0, -1, 0)) const;
Matrix GetTransform(ISize target_size) const;
private:
Scalar fov_y_ = 60;
Vector3 position_ = Vector3();
Vector3 target_ = Vector3(0, 0, -1);
Vector3 up_ = Vector3(0, -1, 0);
Scalar z_near_ = 0.1;
Scalar z_far_ = 1000;
mutable std::optional<Matrix> transform_;
};
} // namespace scene
} // namespace impeller