#include <OgreRefAppNPC.h>
Public Member Functions | |
void | setState (const String &state) |
set npc animation state | |
bool | hasReachedDest () |
check if npc has reached the destination point | |
void | moveToDest (const Ogre::Vector3 &dest) |
set npc moving to the given destination point | |
void | startFollowObject (ApplicationObject *&target) |
set npc follow given application object | |
void | stopFollowObject () |
npc stop following an object | |
void | tick (const Ogre::FrameEvent &evt, double step) |
ai time tick handler for npc | |
void | crewtick (const Ogre::FrameEvent &evt) |
if the npc is a crew, interaction tick | |
void | workOnFire (string objName) |
fireman crew interact on given fire object | |
void | workOnPassenger (string objName) |
medic crew interact on given passenger object | |
bool | pathfind (AINode firstNode) |
A* algorithm from given startNode to destinationPoint. | |
void | resolvePath (double step) |
Backtrack the found path and push the path to the movement stack. | |
void | addToPath (AINode node, double step) |
Partition the movement so that it is smoother. | |
void | setDisabled () |
set crew npc disabled so that they are not visible | |
Public Attributes | |
Ogre::AnimationState * | mAnimationState |
npc animation state | |
priority_queue< AINode > | possibilities |
possible moves queue for A* algorithm | |
vector< AINode > | visitedNodes |
closed set for A* | |
stack< AINode > | movementPath |
movementPath stack for NPC | |
AINode | foundDestNode |
boolean if npc has found destination | |
AINode | pathToTake |
recent path for the npc popped from the movement path | |
ApplicationObject * | objectToFollow |
the object to follow | |
Ogre::RaySceneQuery * | npcRaySceneQuery |
ray scene query object for detecting collision | |
Ogre::Vector3 | destinationPoint |
destination point of npc | |
Ogre::Vector3 | lastDirection |
last direction of npc for smoother movement | |
bool | gotoDestination |
boolean variable if the npc is moving to the destination | |
bool | followObject |
boolean variable if the npc is following an object | |
bool | interacting |
boolean variable if a npc is in interaction | |
double | sayac |
timer for interactions | |
int | pathFindFailureCount |
number of repeated pathfind failures | |
Protected Member Functions | |
void | _notifyCollided (ApplicationObject *otherObj, const ApplicationObject::CollisionInfo &info) |
npc-movable collision handler | |
void | _notifyCollided (SceneQuery::WorldFragment *wf, const CollisionInfo &info) |
npc-world fragment collision handler | |
void | _updateFromDynamics () |
npc dynamics handler | |
Protected Attributes | |
String | npcName |
unique npcName | |
String | workOnNpc |
npc name where this npc interacts on |