4#include <glm/gtc/matrix_transform.hpp>
6#include "core/reflect.h"
16enum class ProjectionType {
26 ProjectionType projection = ProjectionType::Perspective;
28 float fovY = glm::radians(70.0f);
50 if (camera.projection == ProjectionType::Perspective) {
51 return glm::perspective(camera.
fovY,
aspect, camera.zNear, camera.zFar);
77EntityId findActiveCamera(
const Scene& scene, EntityId cached = {});
81VKM_ENUM_NAMES(::Vkm::Engine::ProjectionType,
"Perspective",
"Orthographic")
83VKM_REFLECT_BEGIN(::Vkm::Engine::Camera)
Central registry managing entities and an open set of component types.
Definition scene.h:29
Component representing a camera, containing projection and view parameters.
Definition camera.h:25
float aspect
Width / height; <= 0 derives it from the viewport each frame.
Definition camera.h:31
float fovY
Vertical, radians.
Definition camera.h:28
static glm::mat4 computeProjection(const Camera &camera, float viewportAspect)
Compute the projection matrix for this camera.
Definition camera.h:48
float orthoHeight
Definition camera.h:29
float focusDistance
World distance held in sharp focus.
Definition camera.h:35
float dofAmount
Definition camera.h:36
float dofMaxBlur
Widest blur radius, fraction of viewport height (0..0.05)
Definition camera.h:38