vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::Camera Struct Reference

Component representing a camera, containing projection and view parameters. More...

#include <camera.h>

Static Public Member Functions

static glm::mat4 computeProjection (const Camera &camera, float viewportAspect)
 Compute the projection matrix for this camera.
static glm::mat4 computeViewmodelProjection (const Camera &camera, float viewportAspect)
 The projection Viewmodel meshes draw through: viewmodelFovY, VIEWMODEL_Z_NEAR.

Public Attributes

float fovY = glm::radians(70.0f)
 Vertical, radians.
float orthoHeight = 10.0f
float aspect = 0.0f
 Width / height; <= 0 derives it from the viewport each frame.
float focusDistance = 10.0f
 World distance held in sharp focus.
float dofAmount = 0.0f
float dofMaxBlur = 0.011f
 Widest blur radius, fraction of viewport height (0..0.05)
float viewmodelFovY = 0.0f
 Vertical field of view the eye draws Viewmodel meshes at, radians; 0 is fovY's.

Static Public Attributes

static constexpr float VIEWMODEL_Z_NEAR = 0.01f
 Near plane of the viewmodel's projection: a weapon held close is not cut by the world's.

Detailed Description

Component representing a camera, containing projection and view parameters.

Member Function Documentation

◆ computeProjection()

glm::mat4 Vkm::Engine::Camera::computeProjection ( const Camera & camera,
float viewportAspect )
inlinestatic

Compute the projection matrix for this camera.

Parameters
cameraThe camera.
viewportAspectUsed while camera.aspect <= 0.
Returns
The projection matrix.

◆ computeViewmodelProjection()

glm::mat4 Vkm::Engine::Camera::computeViewmodelProjection ( const Camera & camera,
float viewportAspect )
inlinestatic

The projection Viewmodel meshes draw through: viewmodelFovY, VIEWMODEL_Z_NEAR.

An orthographic camera's own: a field of view means nothing to it.

Parameters
cameraThe camera.
viewportAspectUsed while camera.aspect <= 0.
Returns
The projection matrix.

Member Data Documentation

◆ orthoHeight

float Vkm::Engine::Camera::orthoHeight = 10.0f

Half-height, world units

◆ dofAmount

float Vkm::Engine::Camera::dofAmount = 0.0f

0 = off

◆ viewmodelFovY

float Vkm::Engine::Camera::viewmodelFovY = 0.0f

Vertical field of view the eye draws Viewmodel meshes at, radians; 0 is fovY's.

Arms and a weapon keep their look whatever the world's field of view (Mesh::seenBy).


The documentation for this struct was generated from the following file: