Skip to content

Commit

Permalink
warning messages fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
denizdiktas committed Jun 15, 2023
1 parent 2d7db03 commit ff0a29d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
28 changes: 22 additions & 6 deletions Arrangement_on_surface_2/demo/earth/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,33 @@ void Camera::rotate_around_x(float theta)
{
QMatrix4x4 rot;
rot.rotate(theta, m_ux);
m_pos = m_pos * rot;
m_uy = m_uy * rot;
m_uz = m_uz * rot;
auto pos = m_pos.toVector4D(); pos.setW(1);
auto uy = m_uy.toVector4D(); uy.setW(0);
auto uz = m_uz.toVector4D(); uz.setW(0);

pos = pos * rot;
uy = uy * rot;
uz = uz * rot;

m_pos = pos.toVector3D();
m_uy = uy.toVector3D();
m_uz = uz.toVector3D();
}
void Camera::rotate_around_y(float theta)
{
QMatrix4x4 rot;
rot.rotate(theta, m_uy);
m_pos = m_pos * rot;
m_ux = m_ux * rot;
m_uz = m_uz * rot;
auto pos = m_pos.toVector4D(); pos.setW(1);
auto ux = m_ux.toVector4D(); ux.setW(0);
auto uz = m_uz.toVector4D(); uz.setW(0);

pos = pos * rot;
ux = ux * rot;
uz = uz * rot;

m_pos = pos.toVector3D();
m_ux = ux.toVector3D();
m_uz = uz.toVector3D();
}
void Camera::rotate(float theta_around_x, float theta_around_y)
{
Expand Down
2 changes: 1 addition & 1 deletion Arrangement_on_surface_2/demo/earth/Shader_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Shader_program::add_shader(const char* shader_code, GLenum shader_type)
GLuint the_shader = glCreateShader(shader_type);

const GLchar* the_code[] = { shader_code };
GLint code_length[] = { strlen(shader_code) };
GLint code_length[] = { static_cast<GLint>(strlen(shader_code)) };

glShaderSource(the_shader, 1, the_code, code_length);
glCompileShader(the_shader);
Expand Down

0 comments on commit ff0a29d

Please sign in to comment.