Tidy up
[opengl.git] / main.cpp
index f7b2f85a4644f12ba6df69a5f02363926686afe7..31046454ca325d37a6815dff6c654639ac843900 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -29,7 +29,7 @@ glm::vec3 camUp    = glm::vec3(0.0f, 1.0f,  0.0f);
 float yaw = 1.57, pitch = 0;
 bool doScale, doRotate, doTranslate;
 Model *monkeyHead, *chest;
-glm::vec3 chestPos(0);
+glm::vec3 lightPos(0);
 
 const int WIDTH = 800, HEIGHT = 600;
 const float ASPECT = (float)WIDTH / (float)HEIGHT;
@@ -157,7 +157,7 @@ void display() {
        float d = (float)glutGet(GLUT_ELAPSED_TIME) * 0.001f;
 
        /* glm::vec3 lightPos = glm::vec3(sin(d / 10.f) * 10, 0, cos(d / 10.f) * 10); */
-       glm::vec3 lightPos = chestPos;
+       glm::vec3 lightPos = lightPos;
        glm::vec4 lightColor(1, 1, 1, 1);
 
        drawLight(d, lightPos, lightColor);
@@ -182,7 +182,7 @@ void display() {
        /* Model::Node *key = chest->find("key"); */
        /* key->model = glm::translate(glm::mat4(1), glm::vec3(0, 0, sin(d))); */
        
-       /* chest->getRoot()->model = glm::translate(glm::mat4(1), chestPos); */
+       /* chest->getRoot()->model = glm::translate(glm::mat4(1), lightPos); */
        chest->draw();
 
        glutSwapBuffers();
@@ -523,12 +523,12 @@ void timer(int _) {
        if (keyStates['e'])
                ySpeed = -0.1f;
 
-       if (keyStates['j']) chestPos.z += 0.1f;
-       if (keyStates['k']) chestPos.z -= 0.1f;
-       if (keyStates['h']) chestPos.x -= 0.1f;
-       if (keyStates['l']) chestPos.x += 0.1f;
-       if (keyStates['m']) chestPos.y -= 0.1f;
-       if (keyStates['n']) chestPos.y += 0.1f;
+       if (keyStates['j']) lightPos.z += 0.1f;
+       if (keyStates['k']) lightPos.z -= 0.1f;
+       if (keyStates['h']) lightPos.x -= 0.1f;
+       if (keyStates['l']) lightPos.x += 0.1f;
+       if (keyStates['m']) lightPos.y -= 0.1f;
+       if (keyStates['n']) lightPos.y += 0.1f;
 
        camPos.x += xSpeed * sin(yaw) + zSpeed * cos(yaw);
        camPos.y += ySpeed;