Write Up 13

General Controls: 

Press Escape to quit the application.

 

Pumpkin Controls:

Press the right arrow key to move the pumpkin towards the right.

 

Press the left arrow key to move the pumpkin towards the left.

 

Press the up arrow key to move the pumpkin up.

 

Press the down arrow key to move the pumpkin down.

 

Camera Controls:

 

Press the ‘A’ key to move the camera towards the left.

 

Press the ‘D’ key to move the camera towards the right.

 

Press the ‘W’ key to move the camera up.

 

Press the ‘S’ key to move the camera down.

 

Press the ‘Q’ key to move the camera backwards.

 

Press the ‘E’ key to move the camera forwards.

 

Press the ‘T’ key to rotate the camera counterclockwise along its local Y axis.

 

Press the ‘G’ key to rotate the camera clockwise along its local Y axis.

 

Press the ‘Y’ key to rotate the camera counterclockwise along its local X axis.

 

Press the ‘H’ key to rotate the camera clockwise along its local X axis.

The main objective of Assignment13 was to only build assets files such as shaders, textures and meshes if the asset was either not yet built or was outdated. In order to do this an AssetsToBuild.lua file was created to store tables of shaders, textures and meshes. The new code in AssetBuildFunctions.lua now determines if a target file is supposed to be copied from the source file. To do so, it verifies the two following conditions:

  • The target file does not exist.

  • The target file is older than the source file.

 

This allows the assets to be built only if the previous conditions are met. This new asset build system is better than the previous one because assets that have been built are not rebuilt, making asset editing more practical. If any change is made to an individual asset, only that asset is rebuilt and not the entirety of the assets.

 

The following is the content of the AssetsToBuild.lua file:

 

 return

{

       meshes =

       {

              "Meshes/MovableMesh.lua",

              "Meshes/StaticMesh.lua",

              "Meshes/SecondStaticMesh.lua",

              "Meshes/PumpkinMesh.lua",

       },

       shaders =

       {

              { path = "Shaders/Vertex/sprite.cgfx", arguments = { "vertex" } },

              { path = "Shaders/Vertex/mesh.cgfx", arguments = { "vertex" } },

              { path = "Shaders/Vertex/vertexInputLayout_geometrySprite.cgfx", arguments = { "vertex" } },

              { path = "Shaders/Vertex/vertexInputLayout_geometryMesh.cgfx", arguments = { "vertex" } },

              { path = "Shaders/Fragment/sprite1.cgfx", arguments = { "fragment" } },

              { path = "Shaders/Fragment/sprite2.cgfx", arguments = { "fragment" } },

              { path = "Shaders/Fragment/mesh.cgfx", arguments = { "fragment" } },

       },

       textures =

       {

              "Textures/texture1.png",

              "Textures/texture2.png",

              "Textures/texture3.png",

              "Textures/texture4.png",

              "Textures/texture5.png",

              "Textures/texture6.png",

              "Textures/Pumpkin.png",

       },

}

 

The time it took me to complete this assignment was 4 hours.