AI_Obstacle Class Reference
[InExIn]
#include <AI_Obstacle.h>
Detailed Description
AI agent as an obstacle.Enhance agent properties by width. This agent is considered as an obstacle by more complicated agents, for example by actors. Width is a radius of a circle around the agent.
There are several types of an obstacle described by OBSTACLE_TYPE enum. Info is used typicaly by an actor for in time decisioning during obstacle avoidance. If obstacle is passable then actor will try to avoid an obstacle but if the avoidance fail the he do not stop the walk. If obstacle is a barrier then actor not even try to walk around and just stop walking.
- Version:
- 1.2 (13.5.2007)
- active flag added
1.1 (11.7.2006)
- passable flag was removed
- OBSTACLE_TYPE enum was added
1.0 Initial release.
Public Types | |
enum | OBSTACLE_TYPE { PASSABLE, NONPASSABLE, BARRIER } |
typedef AI_Array< AI_Obstacle * > | ObstacleArray |
Array of obstacle pointers. | |
typedef ObstacleArray::iterator | ObstacleArrayIt |
Iterator of an array of obstacles. | |
Public Member Functions | |
AI_Obstacle () | |
Default constructor. | |
AI_Obstacle (const TYPE type) | |
Constructor with type specification. | |
~AI_Obstacle () | |
Destructor. | |
virtual void | setWidth (const float f_width) |
Set width of the obstacle (radius). | |
void | setObstacleType (const OBSTACLE_TYPE info) |
Set obstacle description. | |
void | setActiveObstacle (const bool b) |
Set active obstacle. | |
const float | getWidth (void) const |
Return width of the obstacle (radius). | |
const OBSTACLE_TYPE & | getObstacleType (void) const |
Return obstacle descriptor. | |
const bool | isObstacleActive (void) const |
Test active obstacle. | |
Public Attributes | |
float | m_f_width |
Width of an agent (radius). | |
OBSTACLE_TYPE | m_obstacle_type |
Obstacle info (descriptor). | |
bool | m_b_active_obstacle |
Active obstacle. |
Member Typedef Documentation
typedef AI_Array<AI_Obstacle*> AI_Obstacle::ObstacleArray |
Array of obstacle pointers.
Iterator of an array of obstacles.
Member Enumeration Documentation
Constructor & Destructor Documentation
AI_Obstacle::AI_Obstacle | ( | ) | [inline] |
Default constructor.
AI_Obstacle::AI_Obstacle | ( | const TYPE | type | ) | [inline] |
Constructor with type specification.
AI_Obstacle::~AI_Obstacle | ( | ) | [inline] |
Destructor.
Member Function Documentation
void AI_Obstacle::setWidth | ( | const float | f_width | ) | [inline, virtual] |
Set width of the obstacle (radius).
This method also sets the aura of the agent as double of the width.
Reimplemented in AI_Actor.
void AI_Obstacle::setObstacleType | ( | const OBSTACLE_TYPE | obstacle_type | ) | [inline] |
Set obstacle description.
Note: could collide with agent's info?
void AI_Obstacle::setActiveObstacle | ( | const bool | b | ) | [inline] |
Set active obstacle.
Passive obstacle is not considered within obstacle avoidance.
const float AI_Obstacle::getWidth | ( | void | ) | const [inline] |
Return width of the obstacle (radius).
const AI_Obstacle::OBSTACLE_TYPE & AI_Obstacle::getObstacleType | ( | void | ) | const [inline] |
Return obstacle descriptor.
Note: could collide with agent's info?
const bool AI_Obstacle::isObstacleActive | ( | void | ) | const [inline] |
Test active obstacle.
Member Data Documentation
float AI_Obstacle::m_f_width |
Width of an agent (radius).
Obstacle info (descriptor).
Active obstacle.
The documentation for this class was generated from the following file: