Index: vulkan-game.hpp
===================================================================
--- vulkan-game.hpp	(revision c1ec4f63156230af7a921799acc46120ccc4b110)
+++ vulkan-game.hpp	(revision 6486ba8f42f8ee2b61912e3a96ac6921ee30292b)
@@ -109,9 +109,8 @@
 // TODO: Create a typedef for index type so I can easily change uin16_t to something else later
 // TODO: Maybe create a typedef for each of the templated SceneObject types
-template<class VertexType, class SSBOType>
+template<class VertexType>
 struct SceneObject {
    vector<VertexType> vertices;
    vector<uint16_t> indices;
-   SSBOType ssbo;
 
    mat4 model_base;
@@ -125,8 +124,8 @@
    // Move the targetAsteroid stuff out of this class since it is very specific to lasers
    // and makes moving SceneObject into its own header file more problematic
-   SceneObject<ModelVertex, SSBO_Asteroid>* targetAsteroid; // currently only used for lasers
-};
-
-// TODO: Have to figure out how to include an optional ssbo parameter for each object
+   SceneObject<ModelVertex>* targetAsteroid; // currently only used for lasers
+};
+
+// TODO: Figure out how to include an optional ssbo parameter for each object
 // Could probably use the same approach to make indices optional
 // Figure out if there are sufficient use cases to make either of these optional or is it fine to make
@@ -149,9 +148,15 @@
 };
 
-template<class VertexType, class SSBOType>
+// TODO: Move this into its own hpp and cpp files
+// TODO: Actually, since this is only used to make lasers deal damage to asteroids, review the logic
+// and see if there is a more straightforward way of implementing this.
+// If there is a simple and straightforward way to implement this in updateScene(), I should just do that instead of
+// using this class. A general feature like this is useful, but, depending on the actual game, it might not be used
+// that often, and using this class might actually make things more complicated if it doesn't quite implement the
+// desired features
+template<class SSBOType>
 struct EffectOverTime : public BaseEffectOverTime {
-   GraphicsPipeline_Vulkan<VertexType>& pipeline;
-   vector<SceneObject<VertexType, SSBOType>>& objects;
-   unsigned int objectIndex;
+   VulkanBuffer<SSBOType> &buffer;
+   uint32_t objectIndex;
    size_t effectedFieldOffset;
    float startValue;
@@ -159,32 +164,25 @@
    float changePerSecond;
 
-   EffectOverTime(GraphicsPipeline_Vulkan<VertexType>& pipeline, vector<SceneObject<VertexType, SSBOType>>& objects,
-                  unsigned int objectIndex, size_t effectedFieldOffset, float startTime, float changePerSecond)
-               : pipeline(pipeline)
-               , objects(objects)
+   EffectOverTime(VulkanBuffer<SSBOType> &buffer, uint32_t objectIndex, size_t effectedFieldOffset, float startTime,
+                  float changePerSecond)
+               : buffer(buffer)
                , objectIndex(objectIndex)
                , effectedFieldOffset(effectedFieldOffset)
                , startTime(startTime)
                , changePerSecond(changePerSecond) {
-      size_t ssboOffset = offset_of(&SceneObject<VertexType, SSBOType>::ssbo);
-
-      unsigned char* effectedFieldPtr = reinterpret_cast<unsigned char*>(&objects[objectIndex]) +
-         ssboOffset + effectedFieldOffset;
-
-      startValue = *reinterpret_cast<float*>(effectedFieldPtr);
+      startValue = *reinterpret_cast<float*>(getEffectedFieldPtr());
+   }
+
+   unsigned char* getEffectedFieldPtr() {
+      return reinterpret_cast<unsigned char*>(&buffer.get(objectIndex)) + effectedFieldOffset;
    }
 
    void applyEffect(float curTime) {
-      if (objects[objectIndex].ssbo.deleted) {
-         this->deleted = true;
+      if (buffer.get(objectIndex).deleted) {
+         deleted = true;
          return;
       }
 
-      size_t ssboOffset = offset_of(&SceneObject<VertexType, SSBOType>::ssbo);
-
-      unsigned char* effectedFieldPtr = reinterpret_cast<unsigned char*>(&objects[objectIndex]) +
-         ssboOffset + effectedFieldOffset;
-
-      *reinterpret_cast<float*>(effectedFieldPtr) = startValue + (curTime - startTime) * changePerSecond;
+      *reinterpret_cast<float*>(getEffectedFieldPtr()) = startValue + (curTime - startTime) * changePerSecond;
    }
 };
@@ -341,21 +339,21 @@
       // if there is a need to add other uniform variables to one or more of the shaders
 
-      vector<SceneObject<ModelVertex, SSBO_ModelObject>> modelObjects;
+      vector<SceneObject<ModelVertex>> modelObjects;
 
       UBO_VP_mats object_VP_mats;
 
-      vector<SceneObject<ModelVertex, SSBO_ModelObject>> shipObjects;
+      vector<SceneObject<ModelVertex>> shipObjects;
 
       UBO_VP_mats ship_VP_mats;
 
-      vector<SceneObject<ModelVertex, SSBO_Asteroid>> asteroidObjects;
+      vector<SceneObject<ModelVertex>> asteroidObjects;
 
       UBO_VP_mats asteroid_VP_mats;
 
-      vector<SceneObject<LaserVertex, SSBO_Laser>> laserObjects;
+      vector<SceneObject<LaserVertex>> laserObjects;
 
       UBO_VP_mats laser_VP_mats;
 
-      vector<SceneObject<ExplosionVertex, SSBO_Explosion>> explosionObjects;
+      vector<SceneObject<ExplosionVertex>> explosionObjects;
 
       UBO_Explosion explosion_UBO;
@@ -370,8 +368,8 @@
 
       unsigned int leftLaserIdx = -1;
-      EffectOverTime<ModelVertex, SSBO_Asteroid>* leftLaserEffect = nullptr;
+      EffectOverTime<SSBO_Asteroid>* leftLaserEffect = nullptr;
 
       unsigned int rightLaserIdx = -1;
-      EffectOverTime<ModelVertex, SSBO_Asteroid>* rightLaserEffect = nullptr;
+      EffectOverTime<SSBO_Asteroid>* rightLaserEffect = nullptr;
 
       /*** High-level vars ***/
@@ -440,8 +438,8 @@
       // stop using objects.back() to access the object that was just created
       template<class VertexType, class SSBOType>
-      SceneObject<VertexType, SSBOType>& addObject(vector<SceneObject<VertexType, SSBOType>>& objects,
-                                                   GraphicsPipeline_Vulkan<VertexType>& pipeline,
-                                                   const vector<VertexType>& vertices, vector<uint16_t> indices,
-                                                   VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo);
+      SceneObject<VertexType>& addObject(vector<SceneObject<VertexType>>& objects,
+                                         GraphicsPipeline_Vulkan<VertexType>& pipeline,
+                                         const vector<VertexType>& vertices, vector<uint16_t> indices,
+                                         VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo);
 
       template<class VertexType>
@@ -451,16 +449,16 @@
       vector<VertexType> addVertexNormals(vector<VertexType> vertices);
 
-      template<class VertexType, class SSBOType>
-      void centerObject(SceneObject<VertexType, SSBOType>& object);
-
-      template<class VertexType, class SSBOType>
-      void updateObjectVertices(GraphicsPipeline_Vulkan<VertexType>& pipeline,
-            SceneObject<VertexType, SSBOType>& obj, size_t index);
+      template<class VertexType>
+      void centerObject(SceneObject<VertexType>& object);
+
+      template<class VertexType>
+      void updateObjectVertices(GraphicsPipeline_Vulkan<VertexType>& pipeline, SceneObject<VertexType>& obj,
+                                size_t index);
 
       void addLaser(vec3 start, vec3 end, vec3 color, float width);
       void translateLaser(size_t index, const vec3& translation);
       void updateLaserTarget(size_t index);
-      bool getLaserAndAsteroidIntersection(SceneObject<ModelVertex, SSBO_Asteroid>& asteroid,
-            vec3& start, vec3& end, vec3& intersection);
+      bool getLaserAndAsteroidIntersection(SceneObject<ModelVertex>& asteroid, vec3& start, vec3& end,
+                                           vec3& intersection);
 
       void addExplosion(mat4 model_mat, float duration, float cur_time);
@@ -488,5 +486,5 @@
 
 template<>
-inline void VulkanGame::centerObject(SceneObject<ExplosionVertex, SSBO_Explosion>& object) {
+inline void VulkanGame::centerObject(SceneObject<ExplosionVertex>& object) {
 }
 
@@ -505,8 +503,8 @@
 // Figure out a better way to allow the model matrix to be set during object creation
 template<class VertexType, class SSBOType>
-SceneObject<VertexType, SSBOType>& VulkanGame::addObject(vector<SceneObject<VertexType, SSBOType>>& objects,
-                                                         GraphicsPipeline_Vulkan<VertexType>& pipeline,
-                                                         const vector<VertexType>& vertices, vector<uint16_t> indices,
-                                                         VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo) {
+SceneObject<VertexType>& VulkanGame::addObject(vector<SceneObject<VertexType>>& objects,
+                                               GraphicsPipeline_Vulkan<VertexType>& pipeline,
+                                               const vector<VertexType>& vertices, vector<uint16_t> indices,
+                                               VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo) {
    // TODO: Use the model field of ssbo to set the object's model_base
    // currently, the passed-in model is useless since it gets overridden when ssbo.model is recalculated
@@ -517,8 +515,8 @@
    }
 
-   objects.push_back({ vertices, indices, ssbo, mat4(1.0f), mat4(1.0f) });
+   objects.push_back({ vertices, indices, mat4(1.0f), mat4(1.0f) });
    objectBuffer.add(ssbo);
 
-   SceneObject<VertexType, SSBOType>& obj = objects.back();
+   SceneObject<VertexType>& obj = objects.back();
 
    // TODO: Specify whether to center the object outside of this function or, worst case, maybe
@@ -571,6 +569,6 @@
 }
 
-template<class VertexType, class SSBOType>
-void VulkanGame::centerObject(SceneObject<VertexType, SSBOType>& object) {
+template<class VertexType>
+void VulkanGame::centerObject(SceneObject<VertexType>& object) {
    vector<VertexType>& vertices = object.vertices;
 
@@ -617,7 +615,7 @@
 }
 
-template<class VertexType, class SSBOType>
-void VulkanGame::updateObjectVertices(GraphicsPipeline_Vulkan<VertexType>& pipeline,
-      SceneObject<VertexType, SSBOType>& obj, size_t index) {
+template<class VertexType>
+void VulkanGame::updateObjectVertices(GraphicsPipeline_Vulkan<VertexType>& pipeline, SceneObject<VertexType>& obj,
+                                      size_t index) {
    pipeline.updateObjectVertices(index, obj.vertices, resourceCommandPool, graphicsQueue);
 }
