Public Member Functions | |
PathFollow (AICharacter *ai_ch, float follow_wt) | |
void | add_to_path (LVecBase3 pos) |
This function adds the positions generated from a pathfind or a simple path follow behavior to the _path list. More... | |
bool | check_if_possible () |
This function checks if the current positions of the ai char and the target char can be used to generate an optimal path. More... | |
void | do_follow () |
This function allows continuous path finding by ai chars. More... | |
void | start (std::string type) |
This function initiates the path follow behavior. More... | |
Public Attributes | |
AICharacter * | _ai_char |
int | _curr_path_waypoint |
NodePath | _dummy |
float | _follow_weight |
ClockObject * | _myClock |
std::vector< LVecBase3 > | _path |
bool | _start |
float | _time |
std::string | _type |
Definition at line 11 of file pathFollow.h.
void PathFollow::add_to_path | ( | LVecBase3 | pos | ) |
This function adds the positions generated from a pathfind or a simple path follow behavior to the _path list.
Definition at line 19 of file pathFollow.cxx.
Referenced by AIBehaviors::add_to_path().
bool PathFollow::check_if_possible | ( | ) |
This function checks if the current positions of the ai char and the target char can be used to generate an optimal path.
Definition at line 105 of file pathFollow.cxx.
References find_in_mesh(), and NodePath::get_pos().
Referenced by do_follow().
void PathFollow::do_follow | ( | ) |
This function allows continuous path finding by ai chars.
There are 2 ways in which this is implemented. 1. The character re-calculates the optimal path everytime the target changes its position. Less computationally expensive. 2. The character continuosly re-calculates its optimal path to the target. This is used in a scenario where the ai chars have to avoid other ai chars. More computationally expensive.
Definition at line 46 of file pathFollow.cxx.
References check_if_possible(), PathFind::do_dynamic_avoid(), NodePath::get_pos(), ClockObject::get_real_time, and PathFind::path_find().
Referenced by AIBehaviors::calculate_prioritized().
void PathFollow::start | ( | std::string | type | ) |
This function initiates the path follow behavior.
Definition at line 26 of file pathFollow.cxx.
References NodePath::attach_new_node(), ClockObject::get_real_time, and AIBehaviors::pursue().
Referenced by AIBehaviors::start_follow().