[EDIT] code style guide - toolbox & main
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "Toolbox.h"
|
||||
#include "math.h"
|
||||
|
||||
namespace toolbox
|
||||
{
|
||||
glm::mat4 createModelMatrix(glm::vec3 translation, glm::vec3 rotation, float scale)
|
||||
glm::mat4 CreateModelMatrix(glm::vec3 translation, glm::vec3 rotation, float scale)
|
||||
{
|
||||
glm::mat4 matrix(1.0f);
|
||||
matrix = glm::translate(matrix, translation);
|
||||
@@ -13,14 +13,14 @@ namespace toolbox
|
||||
return matrix;
|
||||
}
|
||||
|
||||
glm::mat4 createViewMatrix(entities::Camera& camera)
|
||||
glm::mat4 CreateViewMatrix(entities::Camera& camera)
|
||||
{
|
||||
glm::mat4 matrix(1.0f);
|
||||
matrix = glm::rotate(matrix, glm::radians(camera.getRotation().x), glm::vec3(1, 0, 0));
|
||||
matrix = glm::rotate(matrix, glm::radians(camera.getRotation().y), glm::vec3(0, 1, 0));
|
||||
matrix = glm::rotate(matrix, glm::radians(camera.getRotation().z), glm::vec3(0, 0, 1));
|
||||
const glm::vec3 negativeCamPos = glm::vec3(-camera.getPosition().x, -camera.getPosition().y, -camera.getPosition().z);
|
||||
matrix = glm::translate(matrix, negativeCamPos);
|
||||
const glm::vec3 negative_cam_pos = glm::vec3(-camera.getPosition().x, -camera.getPosition().y, -camera.getPosition().z);
|
||||
matrix = glm::translate(matrix, negative_cam_pos);
|
||||
return matrix;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace toolbox
|
||||
#define WINDOW_WIDTH 1400.0f
|
||||
#define WINDOW_HEIGT 800.0f
|
||||
|
||||
glm::mat4 createModelMatrix(glm::vec3 translation, glm::vec3 rotation, float scale);
|
||||
glm::mat4 CreateModelMatrix(glm::vec3 translation, glm::vec3 rotation, float scale);
|
||||
|
||||
glm::mat4 createViewMatrix(entities::Camera& camera);
|
||||
glm::mat4 CreateViewMatrix(entities::Camera& camera);
|
||||
}
|
||||
Reference in New Issue
Block a user