Zen
0.3.0
Loading...
Searching...
No Matches
ZEN_CameraController.h
1
#pragma once
2
3
#include <zen/camera/ZEN_Camera.h>
4
#include <zen/events/ZEN_Event.h>
5
#include <zen/inputs/ZEN_Input.h>
6
#include <zen/time/ZEN_DeltaTime.h>
7
#include <zen/zen_pch.h>
8
9
namespace
Zen {
10
class
CameraController {
11
public
:
12
CameraController(
Camera
&camera);
13
void
onUpdate(
DeltaTime
deltaTime);
14
bool
onEvent(
const
ZenEvent
&event);
15
16
bool
onMouseScrolled(
const
ZenEvent
&event);
17
bool
onWindowResize(
const
ZenEvent
&event);
18
19
void
setWorldBounds(
float
left,
float
right,
float
bottom,
float
top);
20
void
enableWorldBounds(
bool
enabled);
21
22
private
:
23
void
updateCameraProjection();
24
void
clampCameraToWorld();
25
void
getViewDimensions(
float
&outWidth,
float
&outHeight)
const
;
26
27
Camera
&m_camera;
28
float
m_aspectRatio;
29
float
m_zoomLevel = 1.0f;
30
31
glm::vec3 m_cameraPosition = {0.0f, 0.0f, 0.0f};
32
33
bool
m_worldBoundsEnabled =
false
;
34
float
m_worldLeft = -10.0f;
35
float
m_worldRight = 10.0f;
36
float
m_worldBottom = -5.625f;
37
float
m_worldTop = 5.625f;
38
39
float
m_worldWidth = 20.0f;
40
float
m_worldHeight = 11.25f;
41
float
m_worldAspectRatio = 16.0f / 9.0f;
42
};
43
}
// namespace Zen
Zen::Camera
Definition
ZEN_Camera.h:11
Zen::DeltaTime
Definition
ZEN_DeltaTime.h:4
Zen::ZenEvent
Definition
ZEN_Event.h:87
engine
zen
camera
ZEN_CameraController.h
Generated by
1.14.0