[EDIT] code style guide finished
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "math.h"
|
||||
#include "toolbox.h"
|
||||
|
||||
namespace toolbox
|
||||
{
|
||||
@@ -16,10 +16,10 @@ namespace toolbox
|
||||
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 negative_cam_pos = glm::vec3(-camera.getPosition().x, -camera.getPosition().y, -camera.getPosition().z);
|
||||
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 negative_cam_pos = glm::vec3(-camera.GetPosition().x, -camera.GetPosition().y, -camera.GetPosition().z);
|
||||
matrix = glm::translate(matrix, negative_cam_pos);
|
||||
return matrix;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../entities/Camera.h"
|
||||
#include "../entities/camera.h"
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
namespace toolbox
|
||||
Reference in New Issue
Block a user