1 #ifndef GAME_MWMECHANICS_AIWANDER_H
2 #define GAME_MWMECHANICS_AIWANDER_H
8 #include "../mwworld/timestamp.hpp"
110 AiWander(
int distance,
int duration,
int timeOfDay,
const std::vector<unsigned char>& idle,
bool repeat);
bool mHasDestination
Definition: aiwander.hpp:165
void setState(const WanderState wanderState, const bool isManualWander=false)
Definition: aiwander.hpp:93
base class for the temporary storage of AiPackages.
Definition: aistate.hpp:90
bool mRepeat
Definition: aiwander.hpp:160
virtual void fastForward(const MWWorld::Ptr &actor, AiState &state)
Simulates the passing of time.
Definition: aiwander.cpp:715
std::vector< unsigned char > mIdle
Definition: aiwander.hpp:159
void trimAllowedNodes(std::vector< ESM::Pathgrid::Point > &nodes, const PathFinder &pathfinder)
Definition: aiwander.cpp:626
ESM::Pathgrid::Point mCurrentNode
Definition: aiwander.hpp:68
osg::Vec3f mDestination
Definition: aiwander.hpp:166
osg::Vec3f getDestination(const MWWorld::Ptr &actor) const
Get the destination point of the AI package (not applicable to all AI packages, default return (0...
Definition: aiwander.cpp:266
bool isPackageCompleted(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:276
void AddNonPathGridAllowedPoints(osg::Vec3f npcPos, const ESM::Pathgrid *pathGrid, int pointIndex, AiWanderStorage &storage)
Definition: aiwander.cpp:868
void playIdleDialogueRandomly(const MWWorld::Ptr &actor)
Definition: aiwander.cpp:488
std::vector< Point > PointList
Definition: loadpgrd.hpp:53
osg::Vec3f mInitialActorPosition
Definition: aiwander.hpp:163
bool mTurnActorGivingGreetingToFacePlayer
Definition: aiwander.hpp:31
bool mCanWanderAlongPathGrid
Definition: aiwander.hpp:56
bool checkIdle(const MWWorld::Ptr &actor, unsigned short idleSelect)
Definition: aiwander.cpp:681
AiWanderStorage()
Definition: aiwander.hpp:74
void ToWorldCoordinates(ESM::Pathgrid::Point &point, const ESM::Cell *cell)
convert point from local (i.e. cell) to world coordinates
Definition: aiwander.cpp:621
Definition: pathfinding.hpp:35
void init()
Definition: aiwander.cpp:59
void playGreetingIfPlayerGetsTooClose(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:518
This class holds the variables AiWander needs which are deleted if the package becomes inactive...
Definition: aiwander.hpp:26
static int OffsetToPreventOvercrowding()
Base class for AI packages.
Definition: aipackage.hpp:33
void onWalkingStatePerFrameActions(const MWWorld::Ptr &actor, float duration, AiWanderStorage &storage, ESM::Position &pos)
Definition: aiwander.cpp:416
Definition: aiwander.hpp:37
short unsigned getRandomIdle()
Definition: aiwander.cpp:694
void stopWalking(const MWWorld::Ptr &actor, AiWanderStorage &storage, bool clearPath=true)
Definition: aiwander.cpp:657
void getAllowedNodes(const MWWorld::Ptr &actor, const ESM::Cell *cell, AiWanderStorage &storage)
Definition: aiwander.cpp:807
float mReaction
Definition: aiwander.hpp:32
float mTargetAngleRadians
Definition: aiwander.hpp:30
void wanderNearStart(const MWWorld::Ptr &actor, AiWanderStorage &storage, int wanderDistance)
Definition: aiwander.cpp:294
int mDuration
Definition: aiwander.hpp:156
Definition: character.hpp:154
virtual bool execute(const MWWorld::Ptr &actor, CharacterController &characterController, AiState &state, float duration)
Definition: aiwander.cpp:124
Definition: aiwander.hpp:177
void SetCurrentNodeToClosestAllowedNode(const osg::Vec3f &npcPos, AiWanderStorage &storage)
Definition: aiwander.cpp:895
Definition: aisequence.hpp:66
Definition: aiwander.hpp:36
WanderState mState
Definition: aiwander.hpp:53
int mStuckCount
Definition: aiwander.hpp:72
Definition: aiwander.hpp:178
void setPathToAnAllowedNode(const MWWorld::Ptr &actor, AiWanderStorage &storage, const ESM::Position &actorPos)
Definition: aiwander.cpp:587
bool mPopulateAvailableNodes
Definition: aiwander.hpp:62
bool reactionTimeActions(const MWWorld::Ptr &actor, AiWanderStorage &storage, const MWWorld::CellStore *¤tCell, bool cellChange, ESM::Position &pos, float duration)
Definition: aiwander.cpp:178
void turnActorToFacePlayer(const osg::Vec3f &actorPosition, const osg::Vec3f &playerPosition, AiWanderStorage &storage)
Definition: aiwander.cpp:578
void completeManualWalking(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:345
Definition: aiwander.hpp:49
std::vector< ESM::Pathgrid::Point > mAllowedNodes
Definition: aiwander.hpp:66
Mutable state of a cell.
Definition: cellstore.hpp:51
bool mIsWanderingManually
Definition: aiwander.hpp:55
const MWWorld::CellStore * mCell
Definition: aiwander.hpp:43
int mDistance
Definition: aiwander.hpp:155
bool destinationIsAtWater(const MWWorld::Ptr &actor, const osg::Vec3f &destination)
Definition: aiwander.cpp:330
Definition: aiwander.hpp:50
GroupIndex
Definition: aiwander.hpp:175
virtual AiPackage * clone() const
Clones the package.
Definition: aiwander.cpp:69
int mTimeOfDay
Definition: aiwander.hpp:158
bool mStoredInitialActorPosition
Definition: aiwander.hpp:162
void onIdleStatePerFrameActions(const MWWorld::Ptr &actor, float duration, AiWanderStorage &storage)
Definition: aiwander.cpp:377
void evadeObstacles(const MWWorld::Ptr &actor, AiWanderStorage &storage, float duration, ESM::Position &pos)
Definition: aiwander.cpp:459
float distance(const ESM::Pathgrid::Point &point, float x, float y, float z)
Definition: pathfinding.cpp:69
Definition: loadpgrd.hpp:16
Definition: loadcell.hpp:64
int mGreetingTimer
Definition: aiwander.hpp:41
void AddPointBetweenPathGridPoints(const ESM::Pathgrid::Point &start, const ESM::Pathgrid::Point &end, AiWanderStorage &storage)
Definition: aiwander.cpp:880
void onChooseActionStatePerFrameActions(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:432
unsigned short mIdleAnimation
Definition: aiwander.hpp:58
GreetingState mSaidGreeting
Definition: aiwander.hpp:40
Definition: aisequence.hpp:151
static const std::string sIdleSelectToGroupName[GroupIndex_MaxIdle-GroupIndex_MinIdle+1]
lookup table for converting idleSelect value to groupName
Definition: aiwander.hpp:191
virtual int getTypeId() const
Definition: aiwander.cpp:652
Causes the Actor to wander within a specified range.
Definition: aiwander.hpp:101
bool getRepeat() const
Return true if this package should repeat. Currently only used for Wander packages.
Definition: aiwander.cpp:261
AiWander(int distance, int duration, int timeOfDay, const std::vector< unsigned char > &idle, bool repeat)
Constructor.
Definition: aiwander.cpp:51
void doPerFrameActionsForState(const MWWorld::Ptr &actor, float duration, AiWanderStorage &storage, ESM::Position &pos)
Definition: aiwander.cpp:351
Definition: aiwander.hpp:51
bool destinationThroughGround(const osg::Vec3f &startPoint, const osg::Vec3f &destination)
Definition: aiwander.cpp:340
float mDoorCheckDuration
Definition: aiwander.hpp:71
Definition: loadpgrd.hpp:30
GreetingState
Definition: aiwander.hpp:34
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
WanderState
Definition: aiwander.hpp:46
void getNeighbouringNodes(ESM::Pathgrid::Point dest, const MWWorld::CellStore *currentCell, ESM::Pathgrid::PointList &points)
Definition: aiwander.cpp:797
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const
Definition: aiwander.cpp:913
std::vector< unsigned short > mBadIdles
Definition: aiwander.hpp:59
bool playIdle(const MWWorld::Ptr &actor, unsigned short idleSelect)
Definition: aiwander.cpp:667
bool mTrimCurrentNode
Definition: aiwander.hpp:69
Definition: aiwander.hpp:38
Definition: aiwander.hpp:48
float mRemainingDuration
Definition: aiwander.hpp:157