-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the UI to display some camera settings
- Loading branch information
Showing
5 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
#pragma once | ||
|
||
#define GLM_FORCE_RADIANS | ||
#define GLM_FORCE_DEPTH_ZERO_TO_ONE | ||
#include <glm/glm.hpp> | ||
#include <glm/gtc/matrix_transform.hpp> | ||
|
||
struct Camera { | ||
glm::mat4 model; | ||
glm::mat4 view; | ||
glm::mat4 proj; | ||
Camera() = default; | ||
|
||
explicit Camera(float aspectRatio) { | ||
model = glm::mat4(1.0f); | ||
view = glm::lookAt(glm::vec3(2.0f, 2.0f, 2.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f)); | ||
proj = glm::perspective(glm::radians(60.0f), aspectRatio, 0.1f, 10.0f); | ||
proj[1][1] *= -1; | ||
} | ||
|
||
glm::mat4 model = {}; | ||
glm::mat4 view = {}; | ||
glm::mat4 proj = {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters