Public Member Functions | |
ObstacleAvoidance (AICharacter *ai_char, float feeler_length) | |
LVecBase3 | do_obstacle_avoidance () |
This function returns the force necessary by the AICharacter to avoid the nearest obstacle detected by obstacle_detection function NOTE : This assumes the obstacles are spherical. More... | |
void | obstacle_avoidance_activate () |
This function activates obstacle_avoidance if a obstacle is detected. More... | |
bool | obstacle_detection () |
This function checks if an obstacle is near to the AICharacter and if an obstacle is detected returns true. More... | |
Public Attributes | |
AICharacter * | _ai_char |
float | _feeler |
NodePath | _nearest_obstacle |
bool | _obstacle_avoidance_done |
float | _obstacle_avoidance_weight |
Definition at line 22 of file obstacleAvoidance.h.
LVecBase3 ObstacleAvoidance::do_obstacle_avoidance | ( | ) |
This function returns the force necessary by the AICharacter to avoid the nearest obstacle detected by obstacle_detection function NOTE : This assumes the obstacles are spherical.
Definition at line 85 of file obstacleAvoidance.cxx.
References NodePath::get_pos().
Referenced by AIBehaviors::calculate_prioritized().
void ObstacleAvoidance::obstacle_avoidance_activate | ( | ) |
This function activates obstacle_avoidance if a obstacle is detected.
Definition at line 72 of file obstacleAvoidance.cxx.
References obstacle_detection(), AIBehaviors::turn_off(), and AIBehaviors::turn_on().
Referenced by AIBehaviors::calculate_prioritized().
bool ObstacleAvoidance::obstacle_detection | ( | ) |
This function checks if an obstacle is near to the AICharacter and if an obstacle is detected returns true.
Definition at line 31 of file obstacleAvoidance.cxx.
Referenced by obstacle_avoidance_activate().