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-11-01 13:33:18 +0000
committerStijn Buys <ingar@osirion.org>2008-11-01 13:33:18 +0000
commit83d6c17799c4d448a67ab5cdad02954282fa5c94 (patch)
tree2d76abb9bb501491f78e07822ed52e8302fdd247 /src/core/entity.h
parenta6bceed80f1b4315f23656efeceb6fe02cc7641c (diff)
server-side model loading, initial @dock function
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/core/entity.h b/src/core/entity.h
index 2c4814e..149419b 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -35,10 +35,7 @@ class Entity
{
public:
/// Entity flags
- /**
- * entities with the Static flag set will not get client-side interpolation
- */
- enum Flags {Static=1, Solid=2, Bright=4};
+ enum Flags {Static=1, Solid=2, Bright=4, Dock=8};
/// Entity type constants
enum Type {Default=0, Dynamic=1, Controlable=2, Globe=3};
@@ -78,15 +75,15 @@ public:
/// entity name (can not contain double qoutes ")
inline std::string const & name() { return entity_name; }
- /// entity model name
- inline std::string const & modelname() { return entity_modelname; }
-
/// entity client render state
inline ClientState * state() { return entity_clientstate; }
/// pointer to the model, is used client-side
inline model::Model * model() { return entity_model; }
+ /// modelname
+ inline const std::string & modelname() const { return entity_modelname; }
+
/// pointer to the zone the entity belongs to
inline Zone *zone() const { return entity_zone; }
@@ -176,12 +173,24 @@ public:
/// set visibility
void set_visible(bool visible = true);
+ /// set the model name and load the model
+ void set_modelname(const std:: string &model);
+
+ /// set the model
+ void set_model(model::Model *model);
+
/// show the entity, make it visible
virtual void show();
/// hide the entity, make it invisible
virtual void hide();
+ /// set a flag
+ void set_flag(Flags flag);
+
+ /// unset a flag
+ void unset_flag(Flags flag);
+
/// clear all update flags
virtual void clear_updates();
@@ -210,13 +219,10 @@ public:
math::Axis entity_axis;
float entity_radius;
- std::string entity_modelname;
- model::Model *entity_model;
Shape entity_shape;
math::Color entity_color;
math::Color entity_color_second;
unsigned int entity_moduletypeid;
- unsigned int entity_flags;
bool entity_dirty;
bool entity_created;
@@ -236,19 +242,20 @@ protected:
bool entity_visible;
bool entity_serverside;
+private:
+ unsigned int entity_id;
+ unsigned int entity_flags;
+
std::string entity_name;
std::string entity_label;
-private:
- // add an entity to the registry
- static void add(Entity *ent);
-
- // the id is set by add()
- unsigned int entity_id;
+ model::Model *entity_model;
+ std::string entity_modelname;
- // the entity registry
static Registry entity_registry;
static size_t entity_nextid;
+
+ static void add(Entity *ent);
};