From 36ce28a7557c4b2b73316621471558354024ca54 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 1 May 2008 21:08:40 +0000 Subject: roll control --- src/core/entity.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/entity.cc') 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 ------------------------------------------------ */ -- cgit v1.2.3