#include <OrthographicCameraController.h>
◆ OrthographicCameraController()
| Muto::OrthographicCameraController::OrthographicCameraController |
( |
float |
aspectRatio, |
|
|
bool |
rotation = false |
|
) |
| |
17 {
18
19 }
bool m_Rotation
Definition OrthographicCameraController.h:77
OrthographicCameraBounds m_Bounds
Definition OrthographicCameraController.h:75
float m_ZoomLevel
Definition OrthographicCameraController.h:73
float m_AspectRatio
Definition OrthographicCameraController.h:72
OrthographicCamera camera
Definition OrthographicCameraController.h:74
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51
References m_AspectRatio, m_Bounds, m_Rotation, m_ZoomLevel, and OrthographicCameraController().
Referenced by OrthographicCameraController().
◆ CalculateView()
| void Muto::OrthographicCameraController::CalculateView |
( |
| ) |
|
|
private |
96 {
99 }
void UpdateCameraBounds()
Definition OrthographicCameraController.cpp:81
void SetProjection(float left, float right, float bottom, float top)
Definition OrthographicCamera.cpp:15
float Left
Definition OrthographicCameraController.h:20
float Right
Definition OrthographicCameraController.h:20
float Top
Definition OrthographicCameraController.h:21
float Bottom
Definition OrthographicCameraController.h:21
References UpdateCameraBounds().
Referenced by OnMouseScrolled(), OnResize(), SetAspectRatio(), and SetZoomLevel().
◆ CanRotate()
| bool Muto::OrthographicCameraController::CanRotate |
( |
| ) |
const |
|
inline |
◆ GetAspectRatio()
| float Muto::OrthographicCameraController::GetAspectRatio |
( |
| ) |
const |
◆ GetBounds()
◆ GetCamera() [1/2]
◆ GetCamera() [2/2]
◆ GetMoveSpeed()
| float Muto::OrthographicCameraController::GetMoveSpeed |
( |
| ) |
const |
|
inline |
◆ GetPosition()
| glm::vec3 Muto::OrthographicCameraController::GetPosition |
( |
| ) |
const |
|
inline |
glm::vec3 m_CameraPosition
Definition OrthographicCameraController.h:78
◆ GetRotation()
| float Muto::OrthographicCameraController::GetRotation |
( |
| ) |
const |
|
inline |
◆ GetRotationSpeed()
| float Muto::OrthographicCameraController::GetRotationSpeed |
( |
| ) |
const |
|
inline |
◆ GetZoomLevel()
| float Muto::OrthographicCameraController::GetZoomLevel |
( |
| ) |
const |
|
inline |
◆ OnEvent()
| void Muto::OrthographicCameraController::OnEvent |
( |
Event & |
e | ) |
|
48 {
53
54 }
#define MU_BIND_EVENT_FN(fn)
Binds a member function as an event handler.
Definition Defines_Macros.h:17
#define MU_PROFILE_FUNCTION()
Definition Instrumentor.h:240
bool OnWindowResized(WindowResizeEvent &e)
Definition OrthographicCameraController.cpp:74
bool OnMouseScrolled(MouseScrolledEvent &e)
Definition OrthographicCameraController.cpp:65
References Muto::EventDispatcher::EventDispatcher(), OnMouseScrolled(), and OnWindowResized().
◆ OnImGuiRender()
| void Muto::OrthographicCameraController::OnImGuiRender |
( |
| ) |
|
TODO: move to an editor component that can be attached to any system (EditorAbstractionComp)
137 {
138
139
141 if (ImGui::DragFloat3(
"Cam Pos",
camPos, 0.1f)) {
143 }
145 if (ImGui::DragFloat(
"Cam Speed", &
camMoveSpeed, 0.1f)) {
147 }
148 ImGui::Separator();
150 if (ImGui::Checkbox(
"Rotate?", &
rotate)) {
152 }
153 ImGui::Separator();
155 if (ImGui::DragFloat(
"Cam Rotation", &
camRot, 0.1f)) {
157 }
159 if (ImGui::DragFloat(
"Cam Rot Speed", &
camRotSpeed, 1.0f)) {
161 }
162
163
164 }
glm::vec3 GetPosition() const
Definition OrthographicCameraController.h:42
float GetRotation() const
Definition OrthographicCameraController.h:49
float GetRotationSpeed() const
Definition OrthographicCameraController.h:52
void SetRotationSpeed(float speed)
Definition OrthographicCameraController.cpp:118
void SetPosition(float x, float y)
Definition OrthographicCameraController.cpp:101
void SetRotation(float rotation)
Definition OrthographicCameraController.cpp:112
float GetMoveSpeed() const
Definition OrthographicCameraController.h:46
void SetMoveSpeed(float speed)
Definition OrthographicCameraController.cpp:107
void SetCanRotate(bool canRotate)
Definition OrthographicCameraController.h:58
bool CanRotate() const
Definition OrthographicCameraController.h:57
References CanRotate(), GetMoveSpeed(), GetRotation(), GetRotationSpeed(), SetCanRotate(), SetMoveSpeed(), SetPosition(), SetRotation(), and SetRotationSpeed().
◆ OnMouseScrolled()
◆ OnResize()
| void Muto::OrthographicCameraController::OnResize |
( |
float |
width, |
|
|
float |
height |
|
) |
| |
◆ OnUpdate()
| void Muto::OrthographicCameraController::OnUpdate |
( |
Timestep |
ts | ) |
|
◆ OnUpdateBounds()
| void Muto::OrthographicCameraController::OnUpdateBounds |
( |
| ) |
|
|
private |
◆ OnWindowResized()
◆ SetAspectRatio()
| void Muto::OrthographicCameraController::SetAspectRatio |
( |
float |
aspectRatio | ) |
|
◆ SetCanRotate()
| void Muto::OrthographicCameraController::SetCanRotate |
( |
bool |
canRotate | ) |
|
|
inline |
◆ SetMoveSpeed()
| void Muto::OrthographicCameraController::SetMoveSpeed |
( |
float |
speed | ) |
|
◆ SetPosition()
| void Muto::OrthographicCameraController::SetPosition |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
◆ SetRotation()
| void Muto::OrthographicCameraController::SetRotation |
( |
float |
rotation | ) |
|
◆ SetRotationSpeed()
| void Muto::OrthographicCameraController::SetRotationSpeed |
( |
float |
speed | ) |
|
◆ SetZoomLevel()
| void Muto::OrthographicCameraController::SetZoomLevel |
( |
float |
level | ) |
|
|
inline |
◆ UpdateCameraBounds()
| void Muto::OrthographicCameraController::UpdateCameraBounds |
( |
| ) |
|
|
private |
◆ camera
◆ m_AspectRatio
| float Muto::OrthographicCameraController::m_AspectRatio |
|
private |
◆ m_Bounds
◆ m_CameraMoveSpeed
| float Muto::OrthographicCameraController::m_CameraMoveSpeed = 5.0f |
|
private |
◆ m_CameraPosition
| glm::vec3 Muto::OrthographicCameraController::m_CameraPosition = { 0.0f, 0.0f, 0.0f } |
|
private |
◆ m_CameraRotation
| float Muto::OrthographicCameraController::m_CameraRotation = 0.0f |
|
private |
◆ m_CameraRotationSpeed
| float Muto::OrthographicCameraController::m_CameraRotationSpeed = 180.0f |
|
private |
◆ m_Rotation
| bool Muto::OrthographicCameraController::m_Rotation = true |
|
private |
◆ m_ZoomLevel
| float Muto::OrthographicCameraController::m_ZoomLevel = 1.0f |
|
private |
The documentation for this class was generated from the following files: