| Flutter Impeller |

Public Member Functions | Static Public Member Functions | List of all members
impeller::scene::Camera Class Reference

`#include <camera.h>`

## Public Member Functions
Camera | LookAt (Vector3 target, Vector3 up=Vector3(0, -1, 0)) const
Matrix | GetTransform (ISize target_size) const

## Static Public Member Functions
static Camera | MakePerspective (Radians fov_y, Vector3 position)

## Detailed Description

Definition at line 15 of file camera.h.

## Member Function Documentation

## ◆ GetTransform()

Matrix impeller::scene::Camera::GetTransform | ( | ISize | target_size | ) | const

Definition at line 24 of file camera.cc.

24 {
25 if (transform_.has_value()) {
26 return transform_.value();
27 }
28
29 transform_ = Matrix::MakePerspective(fov_y_, target_size, z_near_, z_far_) *
30 Matrix::MakeLookAt(position_, target_, up_);
31
32 return transform_.value();
33 }

References impeller::Matrix::MakeLookAt(), and impeller::Matrix::MakePerspective().

Referenced by impeller::scene::Scene::Render().

## ◆ LookAt()

Camera impeller::scene::Camera::LookAt | ( | Vector3 | target,
|  | Vector3 | up = `Vector3(0, -1, 0)`
| ) |  | const

Definition at line 17 of file camera.cc.

17 {
18 Camera camera = *this;
19 camera.target_ = target;
20 camera.up_ = up;
21 return camera;
22 }

Referenced by impeller::scene::testing::TEST_P().

## ◆ MakePerspective()

Camera impeller::scene::Camera::MakePerspective | ( | Radians | fov_y,
|  | Vector3 | position
| ) |  |
| static

Definition at line 10 of file camera.cc.

10 {
11 Camera camera;
12 camera.fov_y_ = fov_y;
13 camera.position_ = position;
14 return camera;
15 }

Referenced by impeller::scene::testing::TEST_P().

The documentation for this class was generated from the following files:

- impeller/scene/camera.h
- impeller/scene/camera.cc

impeller::Matrix::MakeLookAt
static constexpr Matrix MakeLookAt(Vector3 position, Vector3 target, Vector3 up)
Definition: matrix.h:532
impeller::Matrix::MakePerspective
static constexpr Matrix MakePerspective(Radians fov_y, Scalar aspect_ratio, Scalar z_near, Scalar z_far)
Definition: matrix.h:506