Skip to content
Snippets Groups Projects
Commit c272b404 authored by JonShard's avatar JonShard
Browse files

Added chaning of daytime with 6->9 #16

parent ce3382a7
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ namespace overkill
return model;
}
#define DEBUG 0
#define DEBUG 1
void EntityDirectionalLight::update(float dt, glm::mat4 parentMatrix)
{
......
......@@ -91,19 +91,39 @@ namespace overkill
// PRESS 6 TO change daytime to morning.
else if(keyCode == GLFW_KEY_6) {
Entity* sun = Scene::getEntityByTag("distantSunLight");
if (sun == nullptr)
{
LOG_ERROR("No Sun in scene by tag distantSunLight"); // Terminates app.
}
sun-> setRotation(glm::vec3(0,-180,0));
}
// PRESS 7 TO change daytime to noon
else if(keyCode == GLFW_KEY_7) {
Entity* sun = Scene::getEntityByTag("distantSunLight");
if (sun == nullptr)
{
LOG_ERROR("No Sun in scene by tag distantSunLight"); // Terminates app.
}
sun-> setRotation(glm::vec3(0,-90,0));
}
// PRESS 8 TO change daytime to afternoon
else if(keyCode == GLFW_KEY_8) {
Entity* sun = Scene::getEntityByTag("distantSunLight");
if (sun == nullptr)
{
LOG_ERROR("No Sun in scene by tag distantSunLight"); // Terminates app.
}
sun-> setRotation(glm::vec3(0,-45,0));
}
// PRESS 9 TO change daytime to night
else if(keyCode == GLFW_KEY_9) {
Entity* sun = Scene::getEntityByTag("distantSunLight");
if (sun == nullptr)
{
LOG_ERROR("No Sun in scene by tag distantSunLight"); // Terminates app.
}
sun-> setRotation(glm::vec3(0,0,0));
}
// PRESS 0 TO toggle daytime changing.
else if(keyCode == GLFW_KEY_0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment