Skip to content

Commit

Permalink
removed some more code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacey committed May 30, 2023
1 parent dc436ef commit 2a2843b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/ngl/ShaderLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ class NGL_DLLEXPORT ShaderLib
static std::shared_ptr< ngl::Shader > getShader(std::string_view _shaderName) noexcept;
static bool setUniformBuffer(std::string_view _uniformBlockName, size_t _size, void *_data);



protected:
//----------------------------------------------------------------------------------------------------------------------
/// @brief get shader type from string (used for json parsing)
Expand Down
6 changes: 3 additions & 3 deletions src/Mat4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,21 +446,21 @@ Quaternion Mat4::asQuaternion() const noexcept
{
case 0:
{
auto S = static_cast< Real >(sqrtf(1.0f + m_openGL[0] - m_openGL[5] - m_openGL[10]) * 2.0f);
auto S = sqrtf(1.0f + m_openGL[0] - m_openGL[5] - m_openGL[10]) * 2.0f;

return Quaternion(
0.5f / S, (m_openGL[1] + m_openGL[4]) / S, (m_openGL[2] + m_openGL[8]) / S, (m_openGL[6] + m_openGL[9]) / S);
}
case 1:
{
auto S = static_cast< Real >(sqrtf(1.0f + m_openGL[5] - m_openGL[0] - m_openGL[10]) * 2.0f);
auto S = sqrtf(1.0f + m_openGL[5] - m_openGL[0] - m_openGL[10]) * 2.0f;

return Quaternion(
(m_openGL[1] + m_openGL[4]) / S, 0.5f / S, (m_openGL[6] + m_openGL[9]) / S, (m_openGL[2] + m_openGL[8]) / S);
}
case 2:
{
auto S = static_cast< Real >(sqrtf(1.0f + m_openGL[10] - m_openGL[0] - m_openGL[5]) * 2.0f);
auto S = sqrtf(1.0f + m_openGL[10] - m_openGL[0] - m_openGL[5]) * 2.0f;

return Quaternion(
(m_openGL[2] + m_openGL[8]) / S, (m_openGL[6] + m_openGL[9]) / S, 0.5f / S, (m_openGL[1] + m_openGL[4]) / S);
Expand Down

0 comments on commit 2a2843b

Please sign in to comment.