Panda3D
Public Member Functions | Public Attributes
ObstacleAvoidance Class Reference

List of all members.

Public Member Functions

 ObstacleAvoidance (AICharacter *ai_char, float feeler_length)
LVecBase3f 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.
void obstacle_avoidance_activate ()
 This function activates obstacle_avoidance if a obstacle is detected.
bool obstacle_detection ()
 This function checks if an obstacle is near to the AICharacter and if an obstacle is detected returns true.

Public Attributes

AICharacter_ai_char
float _feeler
NodePath _nearest_obstacle
bool _obstacle_avoidance_done
float _obstacle_avoidance_weight

Detailed Description

Definition at line 24 of file obstacleAvoidance.h.


Member Function Documentation

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 93 of file obstacleAvoidance.cxx.

References LVector3f::forward(), NodePath::get_pos(), NodePath::get_relative_vector(), LVecBase3f::length(), LVecBase3f::normalize(), obstacle_detection(), AIBehaviors::turn_off(), and AIBehaviors::turn_on().

Referenced by AIBehaviors::calculate_prioritized().

This function activates obstacle_avoidance if a obstacle is detected.

Definition at line 76 of file obstacleAvoidance.cxx.

References obstacle_detection(), AIBehaviors::turn_off(), and AIBehaviors::turn_on().

Referenced by AIBehaviors::calculate_prioritized().

This function checks if an obstacle is near to the AICharacter and if an obstacle is detected returns true.

Definition at line 34 of file obstacleAvoidance.cxx.

References LVector3f::forward(), NodePath::get_pos(), NodePath::get_relative_vector(), LVecBase3f::length(), LVecBase3f::length_squared(), and LVecBase3f::normalize().

Referenced by do_obstacle_avoidance(), and obstacle_avoidance_activate().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations