MCPcopy Create free account
hub / github.com/Hopson97/MineCraft-One-Week-Challenge / makeModelMatrix

Function makeModelMatrix

Source/Maths/Matrix.cpp:8–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "../Config.h"
7
8glm::mat4 makeModelMatrix(const Entity &entity)
9{
10 glm::mat4 matrix;
11
12 matrix = glm::rotate(matrix, glm::radians(entity.rotation.x), {1, 0, 0});
13 matrix = glm::rotate(matrix, glm::radians(entity.rotation.y), {0, 1, 0});
14 matrix = glm::rotate(matrix, glm::radians(entity.rotation.z), {0, 0, 1});
15
16 matrix = glm::translate(matrix, entity.position);
17
18 return matrix;
19}
20
21glm::mat4 makeViewMatrix(const Camera &camera)
22{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected