Struct Camera

struct Camera

Public Types

enum class Mode : uint8_t

Values:

enumerator MANUAL
enumerator OBJECT
using Projection = P64::Camera::Projection

Public Functions

inline void setPerspective(float fov)

Switches the camera over to a perspective projection.

Parameters:

fov – vertical fov in radians

inline void setOrthographic(float orthoSize)

Switches the camera over to an orthographic projection.

Parameters:

orthoSize – vertical half-size of the view volume in world units

inline void setProjection(Projection projection)

Switches between perspective and orthographic projection, keeping the settings (fov / ortho-size) of both.

inline Projection getProjection() const

Public Members

P64::Camera camera = {}
Mode mode

Public Static Functions

static inline uint32_t getAllocSize(InitData *initData)
static void initDelete(Object &obj, Camera *data, InitData *initData)
static void update(Object &obj, Camera *data, float deltaTime)
static inline void draw(Object &obj, Camera *data, float deltaTime)

Public Static Attributes

static constexpr uint32_t ID = 3
struct InitData

Public Members

int vpOffset[2]
int vpSize[2]
float fov
float near
float far
float aspectRatio
float orthoSize
Mode mode
Projection projection