File tree Expand file tree Collapse file tree 3 files changed +1
-8
lines changed
Expand file tree Collapse file tree 3 files changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,7 @@ Lighthouse::Lighthouse(gsl::not_null<le::ServiceLocator const*> services) : m_se
1212
1313void Lighthouse::rotate_towards_cursor (glm::vec2 cursor_pos) {
1414 auto const dist_sq = glm::length2 ((cursor_pos));
15- if (dist_sq > 0 .1f ) {
16- auto const dist = std::sqrt (dist_sq);
17- auto const normalized = cursor_pos / dist;
18- static constexpr auto up_v = glm::vec2 (0 .0f , 1 .0f );
19- auto const dot = glm::dot (normalized, up_v);
20- auto const angle = glm::degrees (std::acos (dot));
21- m_sprite.transform .orientation = cursor_pos.x > 0 .0f ? -angle : angle;
22- }
15+ if (dist_sq > 0 .1f ) { m_sprite.transform .orientation = cursor_pos; }
2316}
2417
2518void Lighthouse::check_visibility_range (Enemy& enemy) {
You can’t perform that action at this time.
0 commit comments