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>2009-07-07 09:29:17 +0000
committerStijn Buys <ingar@osirion.org>2009-07-07 09:29:17 +0000
commite66f56ea71f466cc2b261e04d7348e36baff71e1 (patch)
tree6a08eb3e808ae02b2eeeb1a614952cefd2274e70
parent0332ac950765e7609604f14e459d24d6b917d9d7 (diff)
moved speed() property from core:EntityDynamic to core::Entity
-rw-r--r--src/core/entity.cc5
-rw-r--r--src/core/entity.h14
2 files changed, 10 insertions, 9 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 24451e6..2b3c482 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -95,6 +95,8 @@ Entity::Entity(unsigned int flags) :
entity_id = 0;
entity_flags = flags;
entity_moduletypeid = 0;
+
+ entity_speed = 0.0f;
entity_radius = 0.5f;
entity_shape = Diamond;
@@ -127,6 +129,7 @@ Entity::Entity(std::istream & is)
entity_visible = true;
entity_model = 0;
+ entity_speed = 0.0f;
entity_created = true;
entity_destroyed = false;
@@ -388,7 +391,6 @@ void Entity::remove_menu(std::string const &label)
EntityDynamic::EntityDynamic(unsigned int flags) :
Entity(flags)
{
- entity_speed = 0.0f;
entity_state = Normal;
entity_timer = 0;
}
@@ -396,7 +398,6 @@ EntityDynamic::EntityDynamic(unsigned int flags) :
EntityDynamic::EntityDynamic(std::istream & is) :
Entity(is)
{
- entity_speed = 0.0f;
entity_state = Normal;
entity_timer = 0;
}
diff --git a/src/core/entity.h b/src/core/entity.h
index b9ee6bd..da58d86 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -118,6 +118,9 @@ public:
/// base radius of the entity
inline float radius() const { return entity_radius; }
+ /// current speed of the entity in game units per second
+ inline const float speed() const { return entity_speed; }
+
/// indicates a server-side entity
inline bool serverside() const { return entity_serverside; }
@@ -249,6 +252,10 @@ public:
math::Vector3f entity_location;
math::Axis entity_axis;
+ /// speed of the entity
+ float entity_speed;
+
+
float entity_radius;
Shape entity_shape;
math::Color entity_color;
@@ -308,9 +315,6 @@ public:
/// core type id
virtual inline const unsigned int type() const { return Entity::Dynamic; }
- /// current speed of the entity in game units per second
- inline const float speed() const { return entity_speed; }
-
/// event state
inline const int state() const { return entity_state; }
@@ -349,10 +353,6 @@ public:
*/
virtual void frame(float seconds);
- /// speed of the entity
- float entity_speed;
-
-
protected:
float entity_timer;
int entity_state;