AI_World Class Reference
[InExIn]
#include <AI_World.h>
Detailed Description
World for AI agents.
- Version:
- 1.0 Initial release.
Public Member Functions | |
AI_World (void) | |
Constructor. | |
~AI_World (void) | |
Destructor. | |
void | trigger (double d_time) |
Trigger world. | |
bool | findWay (AI_Actor &actor) |
Find way for the actor (actor's nav mesh session must be defined before). | |
bool | testVisibility (const AI_Vector3 &v_first, const AI_Vector3 &v_second) |
Test visibility between two points. | |
const bool | testWallDistance (const AI_Vector3 &v_first, const AI_Vector3 &v_second, float &f_distance) |
Test the distance of the wall from the first point when the line segment between both points is intersected by wall. | |
bool | isOnSurface (const AI_Vector3 &v_pos) |
Test whether given position is on surface of navigation mesh. | |
bool | getNearestSurfacePosition (const AI_Vector3 &v_position, float radius, bool cylinder, AI_Vector3 &v_nearest_position) |
Return nearest position on navigation mesh to given position and width defined by radius, which defines sphere or infinite Y axis aligned cylinder - depending on state of cylinder parameter. | |
bool | addAgent (AI_Agent *ptr_agent) |
Add new agent into the world. | |
void | removeAgent (AI_Agent *ptr_agent) |
Remove an agent from the world. | |
void | setAutoEnable (bool b_enable) |
On/off auto enable strategy. | |
void | setAutoDisable (bool b_enable) |
On/off auto disable strategy. | |
void | setAutoEnableDisablePivot (AI_Actor *ptr_actor) |
Set auto enable/disable pivot. | |
void | setAutoEnableDistance (const float f_dist) |
Set auto enable distance. | |
void | setAutoDisableDistance (const float f_dist) |
Set auto disable distance. | |
void | setWideAgents (bool b) |
On/off wide agents for pathfinding. | |
void | setHero (AI_Actor *ptr_actor) |
Set hero of this world. | |
AI_NavigationMesh & | getNavigationMesh (void) |
Get only navigation mesh of the world. | |
bool | isAutoEnable (void) const |
Is auto enable strategy on? | |
bool | isAutoDisable (void) const |
Is auto disable strategy on? | |
const float | getAutoEnableDistance (void) const |
Get auto enable distance. | |
const float | getAutoDisableDistance (void) const |
Get auto enable distance. | |
AI_Actor * | getAutoEnableDisablePivot (void) |
Get auto enable/disable pivot. | |
bool | isWideAgents (void) |
Is "wide agents" of the pathfinder on? | |
const ai_dword | getDBVersion (void) |
Get actual version of the spatial database of the world. | |
AI_Actor * | getHero (void) |
Get hero of this world. | |
AI_Actor::ActorArray & | getEnabledActors (void) |
void | updateSpatialElement (AI_SDB_SpatialElement *ptr_spatial_element, const AI_BBox &bbox_new) |
Update spatial element. | |
void | getNearAgents (const AI_Vector3 &v_position, const float f_range, AI_Agent::AgentArray &arr_near_agents, AI_Agent *ptr_agent_exclude=NULL) |
Make an quaery into the spatial database and return all agents in given distance from given point. | |
void | enableActor (AI_Actor *ptr_actor) |
Add an actor into array of enabled actors. | |
void | disableActor (AI_Actor *ptr_actor) |
Remove an actor from array of enabled actors. | |
Protected Attributes | |
AI_List | m_list_agents |
List of all agents in world. | |
AI_NavigationMesh | m_navigation_mesh |
Only navigation mesh. | |
AI_SDB_SpatialAABBTree | m_spatial_tree |
Spatial tree with spatial elements for all agents. | |
AI_SDB_VisibilityVisitor::VisibleElements | m_visible_elements |
Array of selected visible (near enough) elements. | |
float | m_f_enable_dist |
Enable distance. | |
float | m_f_disable_dist |
Disable distance. | |
AI_Ref< AI_Actor > | m_ref_actor_pivot |
Actor pivot for enabling/disabling strategy. | |
AI_Ref< AI_Actor > | m_ref_hero |
Hero actor of this world. | |
ai_dword | m_dw_db_version |
Spatial database version. | |
double | m_d_time_auto_enable |
Time elapsed from last auto enable check. | |
AI_Actor::ActorArray | m_arr_enabled_actors |
AI_Actor::ActorArray | m_arr_temp_actors |
struct { | |
bool m_b_auto_enable: 1 | |
bool m_b_auto_disable: 1 | |
bool m_b_wide_agents: 1 | |
}; |
Constructor & Destructor Documentation
AI_World::AI_World | ( | void | ) | [inline] |
Constructor.
AI_World::~AI_World | ( | void | ) | [inline] |
Destructor.
Member Function Documentation
void AI_World::trigger | ( | double | d_time | ) |
Trigger world.
Enable/disable agents and trigger all enabled actors.
bool AI_World::findWay | ( | AI_Actor & | actor | ) | [inline] |
Find way for the actor (actor's nav mesh session must be defined before).
bool AI_World::testVisibility | ( | const AI_Vector3 & | v_first, | |
const AI_Vector3 & | v_second | |||
) | [inline] |
Test visibility between two points.
const bool AI_World::testWallDistance | ( | const AI_Vector3 & | v_first, | |
const AI_Vector3 & | v_second, | |||
float & | f_distance | |||
) | [inline] |
Test the distance of the wall from the first point when the line segment between both points is intersected by wall.
- Returns:
- Return true if the line segment is intersected. Set the distance of the intersection from the first point.
bool AI_World::isOnSurface | ( | const AI_Vector3 & | v_pos | ) | [inline] |
Test whether given position is on surface of navigation mesh.
Point need not to be exactly on surface it need to be just above it.
bool AI_World::getNearestSurfacePosition | ( | const AI_Vector3 & | v_position, | |
float | radius, | |||
bool | cylinder, | |||
AI_Vector3 & | v_nearest_position | |||
) | [inline] |
Return nearest position on navigation mesh to given position and width defined by radius, which defines sphere or infinite Y axis aligned cylinder - depending on state of cylinder parameter.
bool AI_World::addAgent | ( | AI_Agent * | ptr_agent | ) | [inline] |
Add new agent into the world.
User must add reference after the agent is added.
void AI_World::removeAgent | ( | AI_Agent * | ptr_agent | ) | [inline] |
Remove an agent from the world.
void AI_World::setAutoEnable | ( | bool | b_enable | ) | [inline] |
On/off auto enable strategy.
void AI_World::setAutoDisable | ( | bool | b_enable | ) | [inline] |
On/off auto disable strategy.
void AI_World::setAutoEnableDisablePivot | ( | AI_Actor * | ptr_actor | ) | [inline] |
Set auto enable/disable pivot.
Actor pivot must be added into the world before.
void AI_World::setAutoEnableDistance | ( | const float | f_dist | ) | [inline] |
Set auto enable distance.
void AI_World::setAutoDisableDistance | ( | const float | f_dist | ) | [inline] |
Set auto disable distance.
void AI_World::setWideAgents | ( | bool | b | ) | [inline] |
On/off wide agents for pathfinding.
void AI_World::setHero | ( | AI_Actor * | ptr_actor | ) | [inline] |
Set hero of this world.
AI_NavigationMesh & AI_World::getNavigationMesh | ( | void | ) | [inline] |
Get only navigation mesh of the world.
bool AI_World::isAutoEnable | ( | void | ) | const [inline] |
Is auto enable strategy on?
bool AI_World::isAutoDisable | ( | void | ) | const [inline] |
Is auto disable strategy on?
const float AI_World::getAutoEnableDistance | ( | void | ) | const [inline] |
Get auto enable distance.
const float AI_World::getAutoDisableDistance | ( | void | ) | const [inline] |
Get auto enable distance.
AI_Actor * AI_World::getAutoEnableDisablePivot | ( | void | ) | [inline] |
Get auto enable/disable pivot.
bool AI_World::isWideAgents | ( | void | ) | [inline] |
Is "wide agents" of the pathfinder on?
const ai_dword AI_World::getDBVersion | ( | void | ) | [inline] |
Get actual version of the spatial database of the world.
AI_Actor * AI_World::getHero | ( | void | ) | [inline] |
Get hero of this world.
AI_Actor::ActorArray & AI_World::getEnabledActors | ( | void | ) | [inline] |
void AI_World::updateSpatialElement | ( | AI_SDB_SpatialElement * | ptr_spatial_element, | |
const AI_BBox & | bbox_new | |||
) | [inline] |
Update spatial element.
void AI_World::getNearAgents | ( | const AI_Vector3 & | v_position, | |
const float | f_range, | |||
AI_Agent::AgentArray & | arr_near_agents, | |||
AI_Agent * | ptr_agent_exclude = NULL | |||
) |
Make an quaery into the spatial database and return all agents in given distance from given point.
void AI_World::enableActor | ( | AI_Actor * | ptr_actor | ) | [inline] |
Add an actor into array of enabled actors.
Enabled actors are triggered within world trigger.
void AI_World::disableActor | ( | AI_Actor * | ptr_actor | ) | [inline] |
Remove an actor from array of enabled actors.
Member Data Documentation
AI_List AI_World::m_list_agents [protected] |
List of all agents in world.
AI_NavigationMesh AI_World::m_navigation_mesh [protected] |
Only navigation mesh.
AI_SDB_SpatialAABBTree AI_World::m_spatial_tree [protected] |
Spatial tree with spatial elements for all agents.
Array of selected visible (near enough) elements.
float AI_World::m_f_enable_dist [protected] |
Enable distance.
float AI_World::m_f_disable_dist [protected] |
Disable distance.
AI_Ref<AI_Actor> AI_World::m_ref_actor_pivot [protected] |
Actor pivot for enabling/disabling strategy.
AI_Ref<AI_Actor> AI_World::m_ref_hero [protected] |
Hero actor of this world.
ai_dword AI_World::m_dw_db_version [protected] |
Spatial database version.
double AI_World::m_d_time_auto_enable [protected] |
Time elapsed from last auto enable check.
AI_Actor::ActorArray AI_World::m_arr_enabled_actors [protected] |
AI_Actor::ActorArray AI_World::m_arr_temp_actors [protected] |
struct { ... } [protected] |
The documentation for this class was generated from the following files: