19 #define STEERING_FACTORY(SteeringName) \
21 class Factory: public ::ai::ISteeringFactory { \
23 ::ai::SteeringPtr create (const ::ai::SteeringFactoryContext *ctx) const override { \
24 return std::make_shared<SteeringName>(ctx->parameters); \
27 static const Factory& getFactory() { \
28 static Factory FACTORY; \
32 #define STEERING_FACTORY_SINGLETON \
34 class Factory: public ::ai::ISteeringFactory { \
35 ::ai::SteeringPtr create (const ::ai::SteeringFactoryContext *) const { \
39 static const Factory& getFactory() { \
40 static Factory FACTORY; \
64 glm::vec3 getSelectionTarget(
const AIPtr& entity, std::size_t index)
const {
65 const FilteredEntities& selection = entity->getFilteredEntities();
66 if (selection.empty() || selection.size() <= index) {
69 const Zone* zone = entity->getZone();
70 const CharacterId characterId = selection[index];
71 const AIPtr& ai = zone->getAI(characterId);
72 const ICharacterPtr character = ai->getCharacter();
73 return character->getPosition();
IFilter steering interface
Definition: Steering.h:62
Definition: MoveVector.h:10
Definition: MemoryAllocator.h:26
Steering interface.
Definition: Steering.h:47
virtual MoveVector execute(const AIPtr &ai, float speed) const =0
Calculates the MoveVector.