OgreRefApp::NPC Class Reference

NPC agent class definition on physics world. More...

#include <OgreRefAppNPC.h>

Inheritance diagram for OgreRefApp::NPC:

Inheritance graph
[legend]
Collaboration diagram for OgreRefApp::NPC:

Collaboration graph
[legend]

List of all members.

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< AINodepossibilities
 possible moves queue for A* algorithm
vector< AINodevisitedNodes
 closed set for A*
stack< AINodemovementPath
 movementPath stack for NPC
AINode foundDestNode
 boolean if npc has found destination
AINode pathToTake
 recent path for the npc popped from the movement path
ApplicationObjectobjectToFollow
 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


Detailed Description

NPC agent class definition on physics world.
The documentation for this class was generated from the following files:

Generated on Sun Jun 15 18:43:30 2008 for SpadeShip Project by  doxygen 1.5.5