Emergency 20 Dokumentation  4.2.0
em5::AiSpeedLimitFunctor Class Reference

Speed limit functor for EMERGENCY 5. More...

#include <AiSpeedLimitFunctor.h>

Inheritance diagram for em5::AiSpeedLimitFunctor:
qsf::ai::SpeedLimitFunctor

Public Member Functions

 AiSpeedLimitFunctor ()
 Default constructor. More...
 
virtual qsf::UnsignedFloat getSpeedFor (const qsf::ai::NavigationComponent &navi, qsf::UnsignedFloat speedLimit) const override
 Speed Limit functor main method - shall return maximum speed (in world units per second) for the navigation component passed. The speed that would be applied by default is passed as second parameter. This already contains the impact of the ground type (via the edited area type). Might take map region, weather, health status, NPC type etc into account. For no further limitation, return the value passed as current default. More...
 
virtual qsf::UnsignedFloat getHaltingDistanceBefore (const qsf::ai::NavigationComponent &navi, qsf::Entity &other, qsf::UnsignedFloat defaultDistance) const override
 Speed Limit functor auxiliary method - shall return the distance to keep between the active navigation component and the other entity. The default distance this navi keeps ahead is given in the field defaultDistance This can usually be returned. However, if a special distance should be held - like a smaller one (between damaged vehicle and tow truck while towing, for example) or a larger one (before emergency vehicles or burning vehicles) that modified distance can be returned. BEWARE! the distance includes the diagonal of the navigating vehicle, i.e., indicates the distance from the midpoint to the collision point. More...
 
- Public Member Functions inherited from qsf::ai::SpeedLimitFunctor
virtual ~SpeedLimitFunctor ()
 

Detailed Description

Speed limit functor for EMERGENCY 5.

Remarks
Can be used to finetune the speed entities currently used in case this depends on things like weather that are not easily available to the AI. Another usecase is speed variation that changes over the course of one action dynamically as the movement modes only allow a static functor / limit.

Constructor & Destructor Documentation

em5::AiSpeedLimitFunctor::AiSpeedLimitFunctor ( )

Default constructor.

Member Function Documentation

virtual qsf::UnsignedFloat em5::AiSpeedLimitFunctor::getHaltingDistanceBefore ( const qsf::ai::NavigationComponent navi,
qsf::Entity other,
qsf::UnsignedFloat  defaultDistance 
) const
overridevirtual

Speed Limit functor auxiliary method - shall return the distance to keep between the active navigation component and the other entity. The default distance this navi keeps ahead is given in the field defaultDistance This can usually be returned. However, if a special distance should be held - like a smaller one (between damaged vehicle and tow truck while towing, for example) or a larger one (before emergency vehicles or burning vehicles) that modified distance can be returned. BEWARE! the distance includes the diagonal of the navigating vehicle, i.e., indicates the distance from the midpoint to the collision point.

Implements qsf::ai::SpeedLimitFunctor.

virtual qsf::UnsignedFloat em5::AiSpeedLimitFunctor::getSpeedFor ( const qsf::ai::NavigationComponent navi,
qsf::UnsignedFloat  speedLimit 
) const
overridevirtual

Speed Limit functor main method - shall return maximum speed (in world units per second) for the navigation component passed. The speed that would be applied by default is passed as second parameter. This already contains the impact of the ground type (via the edited area type). Might take map region, weather, health status, NPC type etc into account. For no further limitation, return the value passed as current default.

Implements qsf::ai::SpeedLimitFunctor.


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