Panda3D
|
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. | |
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. | |
void | do_follow () |
This function allows continuous path finding by ai chars. | |
void | start (std::string type) |
This function initiates the path follow behavior. | |
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.
PathFollow::PathFollow | ( | AICharacter * | ai_ch, |
float | follow_wt ) |
Definition at line 18 of file pathFollow.cxx.
PathFollow::~PathFollow | ( | ) |
Definition at line 26 of file pathFollow.cxx.
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 33 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 119 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 60 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 40 of file pathFollow.cxx.
References NodePath::attach_new_node(), ClockObject::get_real_time, and AIBehaviors::pursue().
Referenced by AIBehaviors::start_follow().
AICharacter* PathFollow::_ai_char |
Definition at line 14 of file pathFollow.h.
int PathFollow::_curr_path_waypoint |
Definition at line 17 of file pathFollow.h.
NodePath PathFollow::_dummy |
Definition at line 19 of file pathFollow.h.
float PathFollow::_follow_weight |
Definition at line 15 of file pathFollow.h.
ClockObject* PathFollow::_myClock |
Definition at line 21 of file pathFollow.h.
std::vector<LVecBase3> PathFollow::_path |
Definition at line 16 of file pathFollow.h.
bool PathFollow::_start |
Definition at line 18 of file pathFollow.h.
float PathFollow::_time |
Definition at line 22 of file pathFollow.h.
std::string PathFollow::_type |
Definition at line 20 of file pathFollow.h.