Skip to content

Commit

Permalink
fix movement direction when rotated. #40
Browse files Browse the repository at this point in the history
  • Loading branch information
lanice committed Dec 21, 2013
1 parent d08fc23 commit 2dcc942
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/navigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ void Navigation::apply()
}

void Navigation::move(const glm::vec3 & direction)
{
m_center += glm::vec3(direction.x, 0, direction.z);
{
glm::vec3 playerDirection = m_rotation * direction;

m_center += glm::vec3(playerDirection.x, 0, playerDirection.z);
}

void Navigation::rotate(const float & angle)
Expand Down

0 comments on commit 2dcc942

Please sign in to comment.