16 #pragma warning (disable:4996) 17 #pragma warning (disable:4005) 18 #pragma warning(disable:4275) 20 #ifndef _AIBEHAVIORS_H 21 #define _AIBEHAVIORS_H 23 #include "aiGlobals.h" 49 typedef list<Flee, allocator<Flee> > ListFlee;
50 typedef list<Evade, allocator<Evade> > ListEvade;
59 _flee_activate = 0x00100,
61 _arrival_activate = 0x01000,
65 _evade_activate = 0x00800,
67 _flock_activate = 0x00400,
68 _obstacle_avoidance = 0x02000,
69 _obstacle_avoidance_activate = 0x04000
86 ListFlee::iterator _flee_itr;
96 ListEvade::iterator _evade_itr;
116 bool _conflict, _previous_conflict;
121 bool is_on(_behavior_type bt);
122 bool is_on(
string ai_type);
123 bool is_off(_behavior_type bt);
124 bool is_off(
string ai_type);
125 void turn_on(
string ai_type);
126 void turn_off(
string ai_type);
130 void accumulate_force(
string force_type,
LVecBase3 force);
133 void flock_activate();
136 int char_to_int(
string ai_type);
139 void seek(
NodePath target_object,
float seek_wt = 1.0);
140 void seek(
LVecBase3 pos,
float seek_wt = 1.0);
142 void flee(
NodePath target_object,
double panic_distance = 10.0,
double relax_distance = 10.0,
float flee_wt = 1.0);
143 void flee(
LVecBase3 pos,
double panic_distance = 10.0,
double relax_distance = 10.0,
float flee_wt = 1.0);
145 void pursue(
NodePath target_object,
float pursue_wt = 1.0);
147 void evade(
NodePath target_object,
double panic_distance = 10.0,
double relax_distance = 10.0,
float evade_wt = 1.0);
149 void arrival(
double distance = 10.0);
151 void flock(
float flock_wt);
153 void wander(
double wander_radius = 5.0,
int flag =0,
double aoe = 0.0,
float wander_weight = 1.0);
155 void obstacle_avoidance(
float feeler_length = 1.0);
157 void path_follow(
float follow_wt);
159 void start_follow(
string type =
"normal");
162 void init_path_find(
const char* navmesh_filename);
163 void path_find_to(
LVecBase3 pos,
string type =
"normal");
164 void path_find_to(
NodePath target,
string type =
"normal");
165 void add_static_obstacle(
NodePath obstacle);
166 void add_dynamic_obstacle(
NodePath obstacle);
169 void remove_ai(
string ai_type);
170 void pause_ai(
string ai_type);
171 void resume_ai(
string ai_type);
173 string behavior_status(
string ai_type);
This is the base class for all three-component vectors and points.
float _flock_weight
Since Flock is a collective behavior the variables are declared within the AIBehaviors class...
ListEvade _evade_list
This list is used if the ai character needs to evade from multiple onjects.
This class is used to define the flock attributes and the AI characters which are part of the flock...
This class contains all the members and functions that are required to form an interface between the ...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
ListFlee _flee_list
This list is used if the ai character needs to flee from multiple onjects.