Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-01-19 21:41:27 +0000
committerStijn Buys <ingar@osirion.org>2013-01-19 21:41:27 +0000
commit5fff70c38cdcac94480a786141b1a86b8a215ace (patch)
tree9679ae2d962c4ac5a5e7271738e502e5a4de665f /src/game/base/ship.cc
parent8b77c470ee2524892a31c4c29a1dc67c9c2a1e23 (diff)
Convert slot cone angle to radians.
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r--src/game/base/ship.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index e5a5a15..f12700d 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -941,13 +941,13 @@ void Ship::frame(const unsigned long elapsed)
// fire a projectile if the angle between the aim direction and the slot's forward direction is small enough
// we only need half the cone angle for the cosine calculation
- float conecos = cosf( slot->cone() / 360.0f * M_PI);
+ float conecos = cosf(slot->cone());
if (cosa >= conecos) {
// aim
math::Vector3f normal(math::crossproduct(projectile_direction, projectile_axis.forward()));
if (normal.length() > MIN_DELTA) {
- float sina = sqrt(1 - cosa * cosa);
+ float sina = sqrt(1.0f - cosa * cosa);
normal.normalize();
projectile_axis.rotate(normal, cosa, sina);