Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h52
1 files changed, 37 insertions, 15 deletions
diff --git a/src/core/entity.h b/src/core/entity.h
index da58d86..41c56b4 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -101,37 +101,37 @@ public:
inline bool dirty() const { return entity_dirty; }
/// entity location
- inline math::Vector3f & location() { return entity_location; }
+ inline const math::Vector3f& location() const { return entity_location; }
/// local coordinate system of the entity
- inline math::Axis & axis() { return entity_axis; }
+ inline const math::Axis& axis() const { return entity_axis; }
/// primary color of the entity
- inline math::Color const & color() const { return entity_color; }
+ inline const math::Color& color() const { return entity_color; }
/// secondary
- inline math::Color const & color_second() const { return entity_color_second; }
+ inline const math::Color& color_second() const { return entity_color_second; }
/// base shape of the entity
- inline Shape shape() const { return entity_shape; }
+ inline const Shape shape() const { return entity_shape; }
/// base radius of the entity
- inline float radius() const { return entity_radius; }
+ inline const 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; }
+ inline const bool serverside() const { return entity_serverside; }
/// general visibility
- inline bool visible() const { return entity_visible; }
+ inline const bool visible() const { return entity_visible; }
/// entity menus
inline Menus &menus() { return entity_menus; }
/// extensions
- inline Extension *extension(size_t type) { return entity_extension[type]; }
+ inline Extension *extension(size_t type) const { return entity_extension[type]; }
/// find a menu
MenuDescription *find_menu(std::string const &label);
@@ -228,6 +228,29 @@ public:
/// clear all update flags
virtual void clear_updates();
+/*----- actors ---------------------------------------------------- */
+
+ /**
+ * @brief mutable reference to the location
+ */
+ inline math::Vector3f& get_location() { return entity_location; }
+
+ /**
+ * @brief mutable reference to the axis
+ */
+ inline math::Axis& get_axis() { return entity_axis; }
+
+ /**
+ * @brief mutable reference to the primary color
+ */
+ inline math::Color& get_color() { return entity_color; }
+
+ /**
+ * @brief mutable reference to the secondary color
+ */
+
+ inline math::Color& get_color_second() { return entity_color_second; }
+
/*----- static ---------------------------------------------------- */
/// type definition for the entity registry
@@ -249,17 +272,11 @@ public:
static inline Registry & registry() { return entity_registry; }
/* entity_ variables can be set by the module */
- 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;
- math::Color entity_color_second;
unsigned int entity_moduletypeid;
bool entity_dirty;
@@ -278,6 +295,11 @@ protected:
bool entity_visible;
bool entity_serverside;
+ math::Vector3f entity_location;
+ math::Axis entity_axis;
+ math::Color entity_color;
+ math::Color entity_color_second;
+
private:
unsigned int entity_id;
unsigned int entity_flags;