+ /** Get Direction from String. */
+ Direction str2dir( std::string dir_str );
+
+ /** Update on_ground_flag judging by solid collision @c hit. This
+ gets called from the base implementation of collision_solid, so
+ call this when overriding collision_solid's default
+ behaviour. */
+ void update_on_ground_flag(const CollisionHit& hit);
+
+ /** Returns true if we touched ground in the past frame This only
+ works if update_on_ground_flag() gets called in
+ collision_solid. */
+ bool on_ground();
+
+ /** Returns floor normal stored the last time when
+ update_on_ground_flag was called and we touched something solid
+ from above. */
+ Vector get_floor_normal();
+
+ /** Returns true if we were in STATE_ACTIVE at the beginning of the
+ last call to update() */
+ bool is_active();
+
+ /** changes colgroup_active. Also calls set_group when badguy is in STATE_ACTIVE */
+ void set_colgroup_active(CollisionGroup group);
+
+private:
+ void try_activate();
+
+protected:
+ Physic physic;
+
+public:
+ /** Count this badguy to the statistics? This value should not be
+ changed during runtime. */
+ bool countMe;
+
+protected:
+ /** true if initialize() has already been called */
+ bool is_initialized;
+