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>2010-10-17 21:25:27 +0000
committerStijn Buys <ingar@osirion.org>2010-10-17 21:25:27 +0000
commit1032161366da1b2153de8d804465061e6bcc4fce (patch)
treed9163c92c79791c9495e6d5f2944aea27c24e77f /src/core/entity.h
parent31c4ff4ff080ea34389c60ba4edd268dc7f3c08a (diff)
moved bullet objets to core::Entity,
moved docking functions to game.cc and removed entity->dock(), enabled depth testing for bullet debug draw
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h37
1 files changed, 16 insertions, 21 deletions
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