blob: 832f4735130571eb13ad5370b4431b84651f6f17 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#ifndef O3D_CAMERA_H
#define O3D_CAMERA_H
#include "math/mat4.h"
#include "math/tform.h"
using
engine::math::Matrix4,
engine::math::Transform;
namespace engine::o3d {
struct Camera {
float fov;
Transform transform;
constexpr Matrix4 to_mat4(float aspect_ratio, float min_z, float max_z) const & {
return Matrix4::projection(fov, aspect_ratio, min_z, max_z) * transform.to_inverse_mat4();
}
};
}
#endif // O3D_CAMERA_H
|