File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
src/features/player/systems Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,14 @@ namespace features::player::systems
3535
3636 dir = normalize (dir);
3737
38- sf::Vector2f mousePos = static_cast <sf::Vector2f> (sf::Mouse::getPosition (window));
38+ auto mousePos = window. mapPixelToCoords (sf::Mouse::getPosition (window));
3939
4040 auto view = registry.view <features::player::components::playerControlled, common::components::position>();
4141 for (auto [entityUnit, playerControlled, pos] : view.each ())
4242 {
4343 sf::Vector2f dirVec = {mousePos.x - pos.x , mousePos.y - pos.y };
4444 dirVec = normalize (dirVec);
4545
46- std::cout << " mousePos: " << mousePos.x << " " << mousePos.y << std::endl;
47- std::cout << " pos: " << pos.x << " " << pos.y << std::endl;
48- std::cout << " dirVec: " << dirVec.x << " " << dirVec.y << std::endl;
49-
5046 registry.replace <common::components::direction>(entityUnit, dir.x , dir.y );
5147 registry.emplace_or_replace <common::components::lookDirection>(entityUnit, dirVec.x , dirVec.y );
5248
You can’t perform that action at this time.
0 commit comments