Emergency 20 Dokumentation  4.2.0
qsf::ai::AreaType Class Reference

#include <AreaType.h>


class  SpeedImpact

Public Member Functions

 AreaType (unsigned int id=getUninitialized< unsigned int >())
unsigned int getId () const
bool isValid () const
const std::string & getName () const
void setName (const std::string &name)
void addCostFactor (unsigned int moverType, bool facingEndNode, UnsignedFloat factor)
void addSpeedFactor (unsigned int moverType, UnsignedFloat factor)
void addSpeedLimit (unsigned int moverType, UnsignedFloat limit)
const UnsignedFloattryGetCostFactorFor (unsigned int moverType, bool facingEndNode) const
bool canBeUsedAtAll (unsigned int moverType) const
const SpeedImpacttryGetSpeedImpactFor (unsigned int moverType) const
bool isAreaTypeCompatible (unsigned int areaType) const
void addCompatibleType (unsigned int areaType)

Detailed Description

An Area type defines the rules for how entities may move along a type of area used inside AI navigation maps. Currently it allows fine tuning a cost factor to apply during path planning and a speed factor to apply during path execution. It also tracks which other types are possible candidates to automatically connect to. These are the compatible types and define the legal options when using the auto connect feature. These are ignored when explicitly connecting nodes inside a street crossing because the user has full control here. But when using the auto connect feature, the intersected lane is determined by proximity and we need to be able to exclude unwanted connections.

Constructor & Destructor Documentation

qsf::ai::AreaType::AreaType ( unsigned int  id = getUninitialized<unsigned int>())

Member Function Documentation

void qsf::ai::AreaType::addCompatibleType ( unsigned int  areaType)
void qsf::ai::AreaType::addCostFactor ( unsigned int  moverType,
bool  facingEndNode,
UnsignedFloat  factor 
void qsf::ai::AreaType::addSpeedFactor ( unsigned int  moverType,
UnsignedFloat  factor 
void qsf::ai::AreaType::addSpeedLimit ( unsigned int  moverType,
UnsignedFloat  limit 
bool qsf::ai::AreaType::canBeUsedAtAll ( unsigned int  moverType) const

Returns whether users of the given type may move here at all in either direction.

unsigned int qsf::ai::AreaType::getId ( ) const
const std::string & qsf::ai::AreaType::getName ( ) const
bool qsf::ai::AreaType::isAreaTypeCompatible ( unsigned int  areaType) const
bool qsf::ai::AreaType::isValid ( ) const
void qsf::ai::AreaType::setName ( const std::string &  name)
const UnsignedFloat * qsf::ai::AreaType::tryGetCostFactorFor ( unsigned int  moverType,
bool  facingEndNode 
) const

Returns a cost multiplier applied during path search for when an entity of type moverType is going through an area of this type in the indicated facing. No return value means the entity can't use this area during planning.

const AreaType::SpeedImpact * qsf::ai::AreaType::tryGetSpeedImpactFor ( unsigned int  moverType) const

Returns a cost multiplier applied during path execution for when an entity of type moverType is going through an area of this type in the indicated direction. No return value means no speed adaptation.

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