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>2008-05-01 21:08:40 +0000
committerStijn Buys <ingar@osirion.org>2008-05-01 21:08:40 +0000
commit36ce28a7557c4b2b73316621471558354024ca54 (patch)
tree3aeb4502b3a4f91a54df5d25bedfd262e61d1cec /src/core/entity.cc
parenta22542f273de28d06ecaf2bd6fd741821e98512b (diff)
roll control
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index ea5b9bc..d05bef2 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -262,6 +262,7 @@ EntityControlable::EntityControlable(Player *player, unsigned int flags) :
target_direction = 0.0f;
target_thrust = 0.0f;
target_pitch = 0.0f;
+ target_roll = 0.0f;
}
EntityControlable::EntityControlable(std::istream & is) :
@@ -296,6 +297,7 @@ void EntityControlable::serialize_client_update(std::ostream & os) const
os << " " << target_direction;
os << " " << target_pitch;
os << " " << target_thrust;
+ os << " " << target_roll;
}
@@ -305,6 +307,7 @@ void EntityControlable::recieve_client_update(std::istream &is)
is >> target_direction;
is >> target_pitch;
is >> target_thrust;
+ is >> target_roll;
}
void EntityControlable::serialize_server_update(std::ostream & os) const
@@ -360,6 +363,16 @@ void EntityControlable::set_pitch(float pitch)
}
}
+void EntityControlable::set_roll(float roll)
+{
+ if ((flags() & Static) == Static)
+ return;
+
+ if (target_roll != roll) {
+ target_roll = roll;
+ entity_dirty = true;
+ }
+}
/*----- EntityGlobe ------------------------------------------------ */