Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision 5527206502829c29f53f8d93fccca370379e0da1)
+++ new-game.cpp	(revision dba67b2d6019f09a5a292b3b36444eaeae9dcb3c)
@@ -8,9 +8,4 @@
 
 #define _USE_MATH_DEFINES
-#define GLM_SWIZZLE
-
-// This is to fix a non-alignment issue when passing vec4 params.
-// Check if it got fixed in a later version of GLM
-#define GLM_FORCE_PURE
 
 #include <glm/mat4x4.hpp>
@@ -378,6 +373,6 @@
    };
 
-   T_model = translate(mat4(), vec3(0.45f, -1.5f, 0.0f));
-   R_model = rotate(mat4(), 0.0f, vec3(0.0f, 1.0f, 0.0f));
+   T_model = translate(mat4(1.0f), vec3(0.45f, -1.5f, 0.0f));
+   R_model = rotate(mat4(1.0f), 0.0f, vec3(0.0f, 1.0f, 0.0f));
    obj.model_base = T_model*R_model;
 
@@ -413,6 +408,6 @@
    };
 
-   T_model = translate(mat4(), vec3(-0.5f, -1.5f, -1.00f));
-   R_model = rotate(mat4(), 0.5f, vec3(0.0f, 1.0f, 0.0f));
+   T_model = translate(mat4(1.0f), vec3(-0.5f, -1.5f, -1.00f));
+   R_model = rotate(mat4(1.0f), 0.5f, vec3(0.0f, 1.0f, 0.0f));
    obj.model_base = T_model*R_model;
 
@@ -791,8 +786,8 @@
    obj.selected_colors = { 0.0f };
 
-   T_model = translate(mat4(), vec3(0.0f, -1.2f, 1.8f));
-   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.1f, 0.1f, 0.1f));
+   T_model = translate(mat4(1.0f), vec3(0.0f, -1.2f, 1.8f));
+   R_model = rotate(mat4(1.0f), 20.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 0.0f, 0.0f));
+   R_model = mat4(1.0f);
+   obj.model_base = T_model * R_model * scale(mat4(1.0f), vec3(0.1f, 0.1f, 0.1f));
 
    addObjectToSceneDuringInit(obj);
@@ -921,7 +916,7 @@
    float cam_pitch = -50.0f * 2.0f * 3.14159f / 360.0f;
 
-   mat4 T = translate(mat4(), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z));
-   mat4 yaw_mat = rotate(mat4(), -cam_yaw, vec3(0.0f, 1.0f, 0.0f));
-   mat4 pitch_mat = rotate(mat4(), -cam_pitch, vec3(1.0f, 0.0f, 0.0f));
+   mat4 T = translate(mat4(1.0f), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z));
+   mat4 yaw_mat = rotate(mat4(1.0f), -cam_yaw, vec3(0.0f, 1.0f, 0.0f));
+   mat4 pitch_mat = rotate(mat4(1.0f), -cam_pitch, vec3(1.0f, 0.0f, 0.0f));
    mat4 R = pitch_mat * yaw_mat;
    view_mat = R*T;
@@ -1056,24 +1051,24 @@
          /*
          if (key_state[GLFW_KEY_SPACE] == GLFW_PRESS) {
-            transformObject(objects[1], translate(mat4(), vec3(0.3f, 0.0f, 0.0f)), ubo);
+            transformObject(objects[1], translate(mat4(1.0f), vec3(0.3f, 0.0f, 0.0f)), ubo);
          }
          if (key_pressed[GLFW_KEY_RIGHT]) {
-            transformObject(objects[2], translate(mat4(), vec3(0.01f, 0.0f, 0.0f)), ubo);
+            transformObject(objects[2], translate(mat4(1.0f), vec3(0.01f, 0.0f, 0.0f)), ubo);
          }
          if (key_pressed[GLFW_KEY_LEFT]) {
-            transformObject(objects[2], translate(mat4(), vec3(-0.01f, 0.0f, 0.0f)), ubo);
+            transformObject(objects[2], translate(mat4(1.0f), vec3(-0.01f, 0.0f, 0.0f)), ubo);
          }
          */
 
          if (key_pressed[GLFW_KEY_RIGHT]) {
-            transformObject(objects[0], translate(mat4(), vec3(0.01f, 0.0f, 0.0f)), ubo);
+            transformObject(objects[0], translate(mat4(1.0f), 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);
+            transformObject(objects[0], translate(mat4(1.0f), vec3(-0.01f, 0.0f, 0.0f)), ubo);
          }
 
          for (int i = 1; i < objects.size(); i++) {
             if (!objects[i].deleted) {
-               transformObject(objects[i], translate(mat4(), vec3(0.0f, 0.0f, 0.04f)), ubo);
+               transformObject(objects[i], translate(mat4(1.0f), vec3(0.0f, 0.0f, 0.04f)), ubo);
             }
          }
@@ -1090,5 +1085,5 @@
       float dist = cam_speed * elapsed_seconds;
       if (key_pressed[GLFW_KEY_A]) {
-         vec3 dir = (inverse(R) * vec4(-1.0f, 0.0f, 0.0f, 1.0f)).xyz();
+         vec3 dir = vec3(inverse(R) * vec4(-1.0f, 0.0f, 0.0f, 1.0f));
          cam_pos += dir * dist;
 
@@ -1096,5 +1091,5 @@
       }
       if (key_pressed[GLFW_KEY_D]) {
-         vec3 dir = (inverse(R) * vec4(1.0f, 0.0f, 0.0f, 1.0f)).xyz();
+         vec3 dir = vec3(inverse(R) * vec4(1.0f, 0.0f, 0.0f, 1.0f));
          cam_pos += dir * dist;
 
@@ -1102,5 +1097,5 @@
       }
       if (key_pressed[GLFW_KEY_W]) {
-         vec3 dir = (inverse(R) * vec4(0.0f, 0.0f, -1.0f, 1.0f)).xyz();
+         vec3 dir = vec3(inverse(R) * vec4(0.0f, 0.0f, -1.0f, 1.0f));
          cam_pos += dir * dist;
 
@@ -1108,5 +1103,5 @@
       }
       if (key_pressed[GLFW_KEY_S]) {
-         vec3 dir = (inverse(R) * vec4(0.0f, 0.0f, 1.0f, 1.0f)).xyz();
+         vec3 dir = vec3(inverse(R) * vec4(0.0f, 0.0f, 1.0f, 1.0f));
          cam_pos += dir * dist;
 
@@ -1132,8 +1127,8 @@
       */
       if (cam_moved) {
-         T = translate(mat4(), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z));
-
-         mat4 yaw_mat = rotate(mat4(), -cam_yaw, vec3(0.0f, 1.0f, 0.0f));
-         mat4 pitch_mat = rotate(mat4(), -cam_pitch, vec3(1.0f, 0.0f, 0.0f));
+         T = translate(mat4(1.0f), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z));
+
+         mat4 yaw_mat = rotate(mat4(1.0f), -cam_yaw, vec3(0.0f, 1.0f, 0.0f));
+         mat4 pitch_mat = rotate(mat4(1.0f), -cam_pitch, vec3(1.0f, 0.0f, 0.0f));
          R = pitch_mat * yaw_mat;
 
@@ -1203,5 +1198,5 @@
       vec4 ray_clip = vec4(x, y, -1.0f, 1.0f);
       vec4 ray_eye = inverse(proj_mat) * ray_clip;
-      ray_eye = vec4(ray_eye.xy(), -1.0f, 1.0f);
+      ray_eye = vec4(vec2(ray_eye), -1.0f, 1.0f);
       vec4 ray_world = inverse(view_mat) * ray_eye;
 
@@ -1225,5 +1220,5 @@
 
                if (-NEAR_CLIP >= click_point.z && click_point.z > -FAR_CLIP && click_point.z > closest_point.z) {
-                  closest_point = click_point.xyz();
+                  closest_point = vec3(click_point);
                   closest_object = &*it;
                }
@@ -1340,6 +1335,6 @@
    vec3 normal = vec3(v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x);
 
-   vec3 local_ray = (inverse(obj->model_mat) * world_ray).xyz();
-   vec3 local_cam = (inverse(obj->model_mat) * cam).xyz();
+   vec3 local_ray = vec3(inverse(obj->model_mat) * world_ray);
+   vec3 local_cam = vec3(inverse(obj->model_mat) * cam);
 
    local_ray = local_ray - local_cam;
@@ -1380,5 +1375,5 @@
    obj.id = objects.size(); // currently unused
    obj.num_points = obj.points.size() / 3;
-   obj.model_transform = mat4();
+   obj.model_transform = mat4(1.0f);
    obj.deleted = false;
 
@@ -1445,5 +1440,5 @@
       // Move the object outside the render bounds of the scene so it doesn't get rendered
       // TODO: Find a better way of hiding the object until the next time buffers are repopulated
-      transformObject(obj, translate(mat4(), vec3(0.0f, 0.0f, FAR_CLIP * 1000.0f)), ubo);
+      transformObject(obj, translate(mat4(1.0f), vec3(0.0f, 0.0f, FAR_CLIP * 1000.0f)), ubo);
       obj.deleted = true;
    }
@@ -1880,7 +1875,7 @@
    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.1f, 0.1f, 0.1f));
+   mat4 T = translate(mat4(1.0f), pos);
+   mat4 R = rotate(mat4(1.0f), 60.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 1.0f, -1.0f));
+   obj.model_base = T * R * scale(mat4(1.0f), vec3(0.1f, 0.1f, 0.1f));
 
    addObjectToScene(obj, shaderBufferInfo,
