From 1032161366da1b2153de8d804465061e6bcc4fce Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 17 Oct 2010 21:25:27 +0000 Subject: moved bullet objets to core::Entity, moved docking functions to game.cc and removed entity->dock(), enabled depth testing for bullet debug draw --- src/core/entity.h | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index 2719040..e51dac3 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -166,11 +166,16 @@ public: return entity_body; } - /// collision shape + /// physics collision shape inline btCollisionShape *collision_shape() { return entity_collision_shape; } + /// physics motion info + inline btMotionState *motionstate() { + return entity_motionstate; + } + /// indicates a server-side entity inline const bool serverside() const { return entity_serverside; @@ -277,10 +282,6 @@ public: /* ---- actors ---------------------------------------------------- */ - /// called when the entity received a docking request - // FIXME move docking functions to game - virtual void dock(Entity *entity); - /// set flags inline void set_flag(Flags flag) { entity_flags |= flag; @@ -419,8 +420,10 @@ public: float entity_servertimestamp; protected: - btRigidBody *entity_body; - btCollisionShape *entity_collision_shape; + btRigidBody *entity_body; + btRigidBody::btRigidBodyConstructionInfo *entity_body_info; + btCollisionShape *entity_collision_shape; + btMotionState *entity_motionstate; private: unsigned int entity_id; @@ -489,11 +492,7 @@ public: return entity_timer; } - inline btMotionState *motionstate() { - return entity_motionstate; - } - - /*----- mutators -------------------------------------------------- */ +/*----- mutators -------------------------------------------------- */ /// mass of the entity inline void set_mass(const float mass) { @@ -505,11 +504,6 @@ public: entity_speed = speed; } - /** - * @brief reset the physics state - */ - virtual void reset(); - /*----- serializers ----------------------------------------------- */ /// serialize the entity to a stream @@ -542,13 +536,14 @@ public: */ virtual void frame(float seconds); + /** + * @brief reset the physics state + */ + virtual void reset(); + protected: float entity_timer; int entity_state; - - btMotionState *entity_motionstate; - - }; /// an entity that can be controlled by a player -- cgit v1.2.3