Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision 20e00202b2e4c748de424a4416122a030223f4d6)
+++ new-game.cpp	(revision 885f0bb96794f188afe69920855b3a71fbcab3a1)
@@ -63,5 +63,5 @@
 
 #define NUM_KEYS (512)
-#define ONE_DEG_IN_RAD (2.0 * M_PI) / 360.0 // 0.017444444 (maybe make this a const instead)
+#define ONE_DEG_IN_RAD ((2.0f * M_PI) / 360.0f) // 0.017444444 (maybe make this a const instead)
 
 const int KEY_STATE_UNCHANGED = -1;
@@ -139,4 +139,6 @@
                   map<GLuint, unsigned int>& curShaderBase);
 void renderSceneGui();
+
+void spawnAsteroid(vec3 pos, GLuint shader);
 
 int main(int argc, char* argv[]) {
@@ -289,4 +291,5 @@
    mat4 T_model, R_model;
 
+   /*
    // triangle
    obj = SceneObject();
@@ -372,4 +375,5 @@
 
    addObjectToScene(obj);
+   */
 
    // player ship
@@ -609,39 +613,39 @@
       0.0f, 0.0f, 0.3f,
 
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
-      0.0f, 0.0f, 0.3f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
+      0.0f, 0.0f, 1.0f,
 
       0.0f, 0.0f, 0.3f,
@@ -741,186 +745,17 @@
       0.0f, 0.0f, 0.3f,
    };
-   obj.texcoords = {
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 0.0f,
-      1.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-   };
-   obj.selected_colors = {
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-   };
-
-   T_model = translate(mat4(), vec3(0.0f, -0.9f, 0.0f));
-   R_model = rotate(mat4(), 0.6f, vec3(1.0f, 0.0f, 0.0f));
-   obj.model_base = T_model * R_model * scale(mat4(), vec3(0.3f, 0.3f, 0.3f));;
+   obj.texcoords = { 0.0f };
+   obj.selected_colors = { 0.0f };
+
+   T_model = translate(mat4(), vec3(0.0f, -1.2f, 0.0f));
+   R_model = rotate(mat4(), 20.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 0.0f, 0.0f));
+   R_model = mat4();
+   obj.model_base = T_model * R_model * scale(mat4(), vec3(0.3f, 0.3f, 0.3f));
 
    addObjectToScene(obj);
+
+   spawnAsteroid(vec3(0.0f, -1.2f, -11.5f), color_sp);
+   spawnAsteroid(vec3(1.0f, -1.2f, -11.5f), color_sp);
+   spawnAsteroid(vec3(-0.5f, -0.7f, -10.8f), color_sp);
 
    vector<SceneObject>::iterator obj_it;
@@ -1078,5 +913,6 @@
       // reset the all key states to KEY_STATE_UNCHANGED (something the GLFW key callback can never return)
       // so that GLFW_PRESS and GLFW_RELEASE are only detected once
-      // TODO: Change this if we ever need to act on GLFW_REPEAT (which is when a key is held down continuously)
+      // TODO: Change this if we ever need to act on GLFW_REPEAT (which is when a key is held down
+      //  continuously for a period of time)
       fill(key_state, key_state + NUM_KEYS, KEY_STATE_UNCHANGED);
 
@@ -1099,4 +935,5 @@
 
       if (curState == STATE_GAME) {
+         /*
          if (clickedObject == &objects[0]) {
             selectedObject = &objects[0];
@@ -1105,4 +942,5 @@
             selectedObject = &objects[1];
          }
+         */
 
          /*
@@ -1117,4 +955,17 @@
          }
          */
+
+         if (key_pressed[GLFW_KEY_RIGHT]) {
+            transformObject(objects[0], translate(mat4(), vec3(0.01f, 0.0f, 0.0f)), ubo);
+         }
+         if (key_pressed[GLFW_KEY_LEFT]) {
+            transformObject(objects[0], translate(mat4(), vec3(-0.01f, 0.0f, 0.0f)), ubo);
+         }
+
+         if (key_pressed[GLFW_KEY_DOWN]) {
+            transformObject(objects[1], translate(mat4(), vec3(0.0f, 0.0f, 0.17f)), ubo);
+            transformObject(objects[2], translate(mat4(), vec3(0.0f, 0.0f, 0.06f)), ubo);
+            transformObject(objects[3], translate(mat4(), vec3(0.0f, 0.0f, 0.11f)), ubo);
+         }
       }
 
@@ -1171,4 +1022,5 @@
          cam_moved = true;
       }
+      /*
       if (glfwGetKey(window, GLFW_KEY_LEFT)) {
          cam_yaw += cam_yaw_speed * elapsed_seconds;
@@ -1187,4 +1039,5 @@
          cam_moved = true;
       }
+      */
       if (cam_moved) {
          T = translate(mat4(), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z));
@@ -1700,2 +1553,114 @@
    ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());
 }
+
+void spawnAsteroid(vec3 pos, GLuint shader) {
+   SceneObject obj = SceneObject();
+   obj.shader_program = shader;
+
+   obj.points = {
+      // front
+      1.0f,  1.0f,  1.0f,
+      -1.0f,  1.0f,  1.0f,
+      -1.0f, -1.0f,  1.0f,
+      1.0f,  1.0f,  1.0f,
+      -1.0f, -1.0f,  1.0f,
+      1.0f, -1.0f,  1.0f,
+
+      // top
+      1.0f,  1.0f, -1.0f,
+      -1.0f,  1.0f, -1.0f,
+      -1.0f,  1.0f,  1.0f,
+      1.0f,  1.0f, -1.0f,
+      -1.0f,  1.0f,  1.0f,
+      1.0f,  1.0f,  1.0f,
+
+      // bottom
+      1.0f, -1.0f,  1.0f,
+      -1.0f, -1.0f,  1.0f,
+      -1.0f, -1.0f, -1.0f,
+      1.0f, -1.0f,  1.0f,
+      -1.0f, -1.0f, -1.0f,
+      1.0f, -1.0f, -1.0f,
+
+      // back
+      1.0f,  1.0f, -1.0f,
+      -1.0f, -1.0f, -1.0f,
+      -1.0f,  1.0f, -1.0f,
+      1.0f,  1.0f, -1.0f,
+      1.0f, -1.0f, -1.0f,
+      -1.0f, -1.0f, -1.0f,
+
+      // right
+      1.0f,  1.0f, -1.0f,
+      1.0f,  1.0f,  1.0f,
+      1.0f, -1.0f,  1.0f,
+      1.0f,  1.0f, -1.0f,
+      1.0f, -1.0f,  1.0f,
+      1.0f, -1.0f, -1.0f,
+
+      // left
+      -1.0f,  1.0f,  1.0f,
+      -1.0f,  1.0f, -1.0f,
+      -1.0f, -1.0f, -1.0f,
+      -1.0f,  1.0f,  1.0f,
+      -1.0f, -1.0f, -1.0f,
+      -1.0f, -1.0f,  1.0f,
+   };
+   obj.colors = {
+      // front
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+
+      // top
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+
+      // bottom
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+
+      // back
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+
+      // right
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+
+      // left
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+      0.8f, 0.0f, 0.0f,
+   };
+   obj.texcoords = { 0.0f };
+   obj.selected_colors = { 0.0f };
+
+   mat4 T = translate(mat4(), pos);
+   mat4 R = rotate(mat4(), 60.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 1.0f, -1.0f));
+   obj.model_base = T * R * scale(mat4(), vec3(0.2f, 0.2f, 0.2f));
+
+   addObjectToScene(obj);
+}
