Skip to content

Commit a964d6a

Browse files
committed
Update le2d to v0.3.0
- Fixup lighthouse sprite
1 parent 9158648 commit a964d6a

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

assets/images/lighthouse.png

-6.03 KB
Loading

ext/src.zip

4.04 KB
Binary file not shown.

src/lighthouse.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ Lighthouse::Lighthouse(gsl::not_null<le::ServiceLocator const*> services) : m_se
1212

1313
void 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

2518
void Lighthouse::check_visibility_range(Enemy& enemy) {

0 commit comments

Comments
 (0)