Transformation matricies were being multiplied backwards
This commit is contained in:
parent
fd1a97507b
commit
ff7e296d92
1 changed files with 6 additions and 6 deletions
|
@ -100,10 +100,10 @@ void Render::pop_matrix() {
|
|||
void Render::translate(Vector2<float> trans) {
|
||||
switch(m_matrix_mode) {
|
||||
case MODEL:
|
||||
m_matrix *= translation_matrix(trans);
|
||||
m_matrix = translation_matrix(trans) * m_matrix;
|
||||
break;
|
||||
case PROJECTION:
|
||||
m_view_matrix *= translation_matrix(trans);
|
||||
m_view_matrix = translation_matrix(trans) * m_view_matrix;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -111,10 +111,10 @@ void Render::translate(Vector2<float> trans) {
|
|||
void Render::rotate(float theta) {
|
||||
switch(m_matrix_mode) {
|
||||
case MODEL:
|
||||
m_matrix *= rotation_matrix(theta);
|
||||
m_matrix = rotation_matrix(theta) * m_matrix;
|
||||
break;
|
||||
case PROJECTION:
|
||||
m_view_matrix *= rotation_matrix(theta);
|
||||
m_view_matrix = rotation_matrix(theta) * m_view_matrix;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -122,10 +122,10 @@ void Render::rotate(float theta) {
|
|||
void Render::scale(Vector2<float> scale) {
|
||||
switch(m_matrix_mode) {
|
||||
case MODEL:
|
||||
m_matrix *= scale_matrix(scale);
|
||||
m_matrix = scale_matrix(scale) * m_matrix;
|
||||
break;
|
||||
case PROJECTION:
|
||||
m_view_matrix *= scale_matrix(scale);
|
||||
m_view_matrix = scale_matrix(scale) * m_view_matrix;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue