Emergency 20 Dokumentation  4.2.0
AiCollisionDetectedFunctor.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 
16 //[-------------------------------------------------------]
17 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public virtual qsf::ai::CollisionCallback methods ]
39  //[-------------------------------------------------------]
40  public:
41  virtual Reaction onEntityCollided(qsf::Entity& entity, qsf::Entity& other) override;
42 
43  virtual bool shouldPotentialCollisionBeConsidered(qsf::Entity& entity, qsf::Entity& other, qsf::Time when) override;
44  virtual bool shouldReactToCollision(qsf::Entity& entity, qsf::Entity& other, qsf::Time when) override;
45 
46  };
47 
48 
49 //[-------------------------------------------------------]
50 //[ Namespace ]
51 //[-------------------------------------------------------]
52 } // em5
53 
54 
55 //[-------------------------------------------------------]
56 //[ Implementation ]
57 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
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.
Entity class.
Definition: Entity.h:46
Reaction
Definition: CollisionCallback.h:30
virtual Reaction onEntityCollided(qsf::Entity &entity, qsf::Entity &other) override
Allows a game specific reaction on the collision of BulletCollisionComponents Might trigger health dr...
Definition: AiCollisionDetectedFunctor-inl.h:20
Example on collision detected functor for EMERGENCY 5. Currently ignores collisions.
Definition: AiCollisionDetectedFunctor.h:33
Definition: CollisionCallback.h:26
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 sho...
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32