Use glm::radians instead of deg_to_rad (Fixes #37)
This commit is contained in:
parent
575cbdc341
commit
e77884d5bb
25 changed files with 129 additions and 131 deletions
|
|
@ -796,16 +796,16 @@ public:
|
|||
void updateUniformBuffers()
|
||||
{
|
||||
// Vertex shader
|
||||
uboVS.projection = glm::perspective(deg_to_rad(60.0f), (float)width / (float)height, 0.1f, 256.0f);
|
||||
uboVS.projection = glm::perspective(glm::radians(60.0f), (float)width / (float)height, 0.1f, 256.0f);
|
||||
|
||||
glm::mat4 viewMatrix = glm::translate(glm::mat4(), glm::vec3(0.0f, 0.0f, zoom));
|
||||
viewMatrix = glm::rotate(viewMatrix, deg_to_rad(90), glm::vec3(1.0f, 0.0f, 0.0f));
|
||||
viewMatrix = glm::rotate(viewMatrix, glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f));
|
||||
|
||||
uboVS.model = glm::mat4();
|
||||
uboVS.model = viewMatrix * glm::translate(uboVS.model, glm::vec3(0.0f, 0.0f, -3.5f));
|
||||
uboVS.model = glm::rotate(uboVS.model, deg_to_rad(rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
|
||||
uboVS.model = glm::rotate(uboVS.model, deg_to_rad(rotation.z), glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
uboVS.model = glm::rotate(uboVS.model, deg_to_rad(-rotation.y), glm::vec3(0.0f, 0.0f, 1.0f));
|
||||
uboVS.model = glm::rotate(uboVS.model, glm::radians(rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
|
||||
uboVS.model = glm::rotate(uboVS.model, glm::radians(rotation.z), glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
uboVS.model = glm::rotate(uboVS.model, glm::radians(-rotation.y), glm::vec3(0.0f, 0.0f, 1.0f));
|
||||
|
||||
// Update bones
|
||||
std::vector<aiMatrix4x4> boneTransforms;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue