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