MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / createViewMatrix

Function createViewMatrix

Source/Maths/Matrix_Maths.cpp:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace Maths
9{
10 Matrix4 createViewMatrix(const Camera& camera)
11 {
12 Matrix4 matrix;
13
14 matrix = glm::rotate(matrix, glm::radians(camera.rotation.x), {1, 0, 0});
15 matrix = glm::rotate(matrix, glm::radians(camera.rotation.y), {0, 1, 0});
16 matrix = glm::rotate(matrix, glm::radians(camera.rotation.z), {0, 0, 1});
17
18 matrix = glm::translate(matrix, -camera.position);
19
20 return matrix;
21 }
22
23 Matrix4 createModelMatrix(const Entity& entity)
24 {

Callers 1

updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected