Emergency 2017 Dokumentation  v3.0.1
em5::AiCollisionDetectedFunctor Class Reference

Example on collision detected functor for EMERGENCY 5. Currently ignores collisions. More...

#include <AiCollisionDetectedFunctor.h>

Public Member Functions

virtual Reaction onEntityCollided (qsf::Entity &entity, qsf::Entity &other) override
 Allows a game specific reaction on the collision of BulletCollisionComponents Might trigger health drops or explosions in game, as well as return Reaction::IGNORE to ignore collision in steering up to Reaction::STOP_IMMEDIATELY to stop immediately in place. Detail: will only be called if the map features a PhysicsWorldComponent. More...
 
virtual bool shouldPotentialCollisionBeConsidered (qsf::Entity &entity, qsf::Entity &other, qsf::Time when) override
 Allows a game specific reaction to a potential projected collision between entities. The default behavior in this case is defined by the collision avoidance measures set in the navigation component. If this allows either stopping or evading (which is the regular configuration) the collision won't happen normally. Instead the entities will do their best to avoid a collision given their respective settings. The time parameter is an absolute time stamp when the entities would collide if both wouldn't react at all and keep moving straight along their current orientation and there would not be any other collision earlier. It is therefore only an indication but it doesn't mean in general that the entities will actually collide after that time span. Returns whether the entity should potentially react to this collision or ignore it. More...
 
virtual bool shouldReactToCollision (qsf::Entity &entity, qsf::Entity &other, qsf::Time when) override
 Allows a game specific reaction to a projected collision between entities. The main difference to shouldPotentialCollisionBeConsidered is that this is the most critical actual collision that the entity will react to. The default behavior in this case is defined by the collision avoidance measures set in the navigation component. If this allows either stopping or evading (which is the regular configuration) the collision won't happen normally. Instead the entities will do their best to avoid a collision given their respective settings. The time parameter is an absolute time stamp when the entities would collide if both wouldn't react at all and keep moving straight along their current orientation. It is therefore only an indication but it doesn't mean in general that the entities will actually collide after that time. Returns whether the entity should react to this collision or ignore it. More...
 
- Public Member Functions inherited from qsf::ai::CollisionCallback
virtual ~CollisionCallback ()
 

Additional Inherited Members

- Public Types inherited from qsf::ai::CollisionCallback
enum  Reaction { IGNORE, HANDLE_BY_STEERING, COME_TO_HALT, STOP_IMMEDIATELY }
 

Detailed Description

Example on collision detected functor for EMERGENCY 5. Currently ignores collisions.

Todo:
  • TODO(bs) This is an implementation stub, e.g. game reactions still need to be triggered.

Definition at line 33 of file AiCollisionDetectedFunctor.h.

Member Function Documentation

qsf::ai::CollisionCallback::Reaction em5::AiCollisionDetectedFunctor::onEntityCollided ( qsf::Entity entity,
qsf::Entity other 
)
inlineoverridevirtual

Allows a game specific reaction on the collision of BulletCollisionComponents Might trigger health drops or explosions in game, as well as return Reaction::IGNORE to ignore collision in steering up to Reaction::STOP_IMMEDIATELY to stop immediately in place. Detail: will only be called if the map features a PhysicsWorldComponent.

Implements qsf::ai::CollisionCallback.

Definition at line 20 of file AiCollisionDetectedFunctor-inl.h.

virtual bool em5::AiCollisionDetectedFunctor::shouldPotentialCollisionBeConsidered ( qsf::Entity entity,
qsf::Entity other,
qsf::Time  when 
)
overridevirtual

Allows a game specific reaction to a potential projected collision between entities. The default behavior in this case is defined by the collision avoidance measures set in the navigation component. If this allows either stopping or evading (which is the regular configuration) the collision won't happen normally. Instead the entities will do their best to avoid a collision given their respective settings. The time parameter is an absolute time stamp when the entities would collide if both wouldn't react at all and keep moving straight along their current orientation and there would not be any other collision earlier. It is therefore only an indication but it doesn't mean in general that the entities will actually collide after that time span. Returns whether the entity should potentially react to this collision or ignore it.

Implements qsf::ai::CollisionCallback.

virtual bool em5::AiCollisionDetectedFunctor::shouldReactToCollision ( qsf::Entity entity,
qsf::Entity other,
qsf::Time  when 
)
overridevirtual

Allows a game specific reaction to a projected collision between entities. The main difference to shouldPotentialCollisionBeConsidered is that this is the most critical actual collision that the entity will react to. The default behavior in this case is defined by the collision avoidance measures set in the navigation component. If this allows either stopping or evading (which is the regular configuration) the collision won't happen normally. Instead the entities will do their best to avoid a collision given their respective settings. The time parameter is an absolute time stamp when the entities would collide if both wouldn't react at all and keep moving straight along their current orientation. It is therefore only an indication but it doesn't mean in general that the entities will actually collide after that time. Returns whether the entity should react to this collision or ignore it.

Implements qsf::ai::CollisionCallback.


The documentation for this class was generated from the following files: