Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-04-06 14:45:46 +0000
committerStijn Buys <ingar@osirion.org>2008-04-06 14:45:46 +0000
commitf36e9bd8190c377836463bdeaf553671d34e8e98 (patch)
tree69dbd90d9a2b779780478bd471e2c44efde45eb8 /src/game
parent7b5a6b820d5acef36d402bd5a52d783ec68d33c7 (diff)
new target_direction model
Diffstat (limited to 'src/game')
-rw-r--r--src/game/ship.cc11
-rw-r--r--src/game/shipmodel.cc6
2 files changed, 11 insertions, 6 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc
index b82b7a8..7c3d21d 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -43,9 +43,14 @@ void Ship::frame(float seconds)
entity_thrust = 1.0f;
// update direction
- float direction_offset = degrees180f(target_direction - entity_direction);
- float d = ship_shipmodel->turnspeed() * seconds * direction_offset;
- entity_direction = degrees360f(entity_direction + d);
+ if (target_direction > 1.0f)
+ target_direction = 1.0f;
+ else if (target_direction < -1.0f)
+ target_direction = -1.0f;
+
+ // turnspeed is rotations per second
+ float direction_offset = 360.0f * ship_shipmodel->turnspeed() * seconds * target_direction;
+ entity_direction = degrees360f(entity_direction + direction_offset);
// update speed
if (entity_speed < entity_thrust * ship_shipmodel->maxspeed()) {
diff --git a/src/game/shipmodel.cc b/src/game/shipmodel.cc
index f37e5b2..8e97970 100644
--- a/src/game/shipmodel.cc
+++ b/src/game/shipmodel.cc
@@ -15,9 +15,9 @@ std::list<ShipModel *> ShipModel::registry;
ShipModel::ShipModel()
{
//default specifications
- shipmodel_acceleration = 1.5f;
- shipmodel_maxspeed = 4.0f;
- shipmodel_turnspeed = 0.5f;
+ shipmodel_acceleration = 1.0f;
+ shipmodel_maxspeed = 3.0f;
+ shipmodel_turnspeed = 0.1f;
add(this);
}