Normalizing direction vector
This commit is contained in:
parent
84c7e9e3b3
commit
160a1afd7e
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <map>
|
||||
#include "direction.h"
|
||||
#include "../../utilities/vector_utils.hpp"
|
||||
|
||||
InputDirection Direction::getDirection(sf::Keyboard::Key key)
|
||||
{
|
||||
|
@ -46,5 +47,5 @@ sf::Vector2f Direction::getVector(InputDirection direction)
|
|||
vector.x += 1;
|
||||
}
|
||||
|
||||
return vector;
|
||||
return normalize(vector);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue