AIBehaviors

from panda3d.ai import AIBehaviors
class AIBehaviors

Bases: DTOOL_SUPER_BASE

This class implements all the steering behaviors of the AI framework, such as seek, flee, pursue, evade, wander and flock. Each steering behavior has a weight which is used when more than one type of steering behavior is acting on the same ai character. The weight decides the contribution of each type of steering behavior. The AICharacter class has a handle to an object of this class and this allows to invoke the steering behaviors via the AICharacter. This class also provides functionality such as pausing, resuming and removing the AI behaviors of an AI character at anytime.

Inheritance diagram

Inheritance diagram of AIBehaviors

__init__(*args, **kwargs)
addDynamicObstacle()

C++ Interface: add_dynamic_obstacle(const AIBehaviors self, NodePath obstacle)

/**
  • This function starts the pathfinding obstacle navigation for the passed in

  • obstacle.

*/

addStaticObstacle()

C++ Interface: add_static_obstacle(const AIBehaviors self, NodePath obstacle)

/**
  • This function allows the user to dynamically add obstacles to the game

  • environment. The function will update the nodes within the bounding volume

  • of the obstacle as non-traversable. Hence will not be considered by the

  • pathfinding algorithm.

*/

addToPath()

C++ Interface: add_to_path(const AIBehaviors self, LVecBase3f pos)

/**
  • This function adds positions to the path to follow.

*/

add_dynamic_obstacle()

C++ Interface: add_dynamic_obstacle(const AIBehaviors self, NodePath obstacle)

/**
  • This function starts the pathfinding obstacle navigation for the passed in

  • obstacle.

*/

add_static_obstacle()

C++ Interface: add_static_obstacle(const AIBehaviors self, NodePath obstacle)

/**
  • This function allows the user to dynamically add obstacles to the game

  • environment. The function will update the nodes within the bounding volume

  • of the obstacle as non-traversable. Hence will not be considered by the

  • pathfinding algorithm.

*/

add_to_path()

C++ Interface: add_to_path(const AIBehaviors self, LVecBase3f pos)

/**
  • This function adds positions to the path to follow.

*/

arrival()

C++ Interface: arrival(const AIBehaviors self, double distance)

/**
  • This function activates arrival. This is the function we want the user to

  • call for arrival to be done.

*/

behaviorStatus()

C++ Interface: behavior_status(const AIBehaviors self, str ai_type)

/**
  • This function returns the status of an AI Type whether it is active, paused

  • or disabled. It returns -1 if an invalid string is passed.

*/

behavior_status()

C++ Interface: behavior_status(const AIBehaviors self, str ai_type)

/**
  • This function returns the status of an AI Type whether it is active, paused

  • or disabled. It returns -1 if an invalid string is passed.

*/

evade()

C++ Interface: evade(const AIBehaviors self, NodePath target_object, double panic_distance, double relax_distance, float evade_wt)

/**
  • This function activates evade_activate.

*/

flee()

C++ Interface: flee(const AIBehaviors self, LVecBase3f pos, double panic_distance, double relax_distance, float flee_wt) flee(const AIBehaviors self, NodePath target_object, double panic_distance, double relax_distance, float flee_wt)

/**
  • This function activates flee_activate and creates an object of the Flee

  • class. This function is overloaded to accept a NodePath or an LVecBase3.

*/

flock()

C++ Interface: flock(const AIBehaviors self, float flock_wt)

/**
  • This function activates flock. This is the function we want the user to

  • call for flock to be done.

*/

initPathFind()

C++ Interface: init_path_find(const AIBehaviors self, str navmesh_filename)

// should have different function names.

/**
  • This function activates path finding in the character. This function

  • accepts the meshdata in .csv format.

*/

init_path_find()

C++ Interface: init_path_find(const AIBehaviors self, str navmesh_filename)

// should have different function names.

/**
  • This function activates path finding in the character. This function

  • accepts the meshdata in .csv format.

*/

obstacleAvoidance()

C++ Interface: obstacle_avoidance(const AIBehaviors self, float feeler_length)

/**
  • This function activates obstacle avoidance for a given character. This is

  • the function we want the user to call for obstacle avoidance to be

  • performed.

*/

obstacle_avoidance()

C++ Interface: obstacle_avoidance(const AIBehaviors self, float feeler_length)

/**
  • This function activates obstacle avoidance for a given character. This is

  • the function we want the user to call for obstacle avoidance to be

  • performed.

*/

pathFindTo()

C++ Interface: path_find_to(const AIBehaviors self, LVecBase3f pos, str type) path_find_to(const AIBehaviors self, NodePath target, str type)

/**
  • This function checks for the source and target in the navigation mesh for

  • its availability and then finds the best path via the A* algorithm Then it

  • calls the path follower to make the object follow the path.

*/

/**
  • This function checks for the source and target in the navigation mesh for

  • its availability and then finds the best path via the A* algorithm Then it

  • calls the path follower to make the object follow the path.

*/

pathFollow()

C++ Interface: path_follow(const AIBehaviors self, float follow_wt)

/**
  • This function activates path following. This is the function we want the

  • user to call for path following.

*/

path_find_to()

C++ Interface: path_find_to(const AIBehaviors self, LVecBase3f pos, str type) path_find_to(const AIBehaviors self, NodePath target, str type)

/**
  • This function checks for the source and target in the navigation mesh for

  • its availability and then finds the best path via the A* algorithm Then it

  • calls the path follower to make the object follow the path.

*/

/**
  • This function checks for the source and target in the navigation mesh for

  • its availability and then finds the best path via the A* algorithm Then it

  • calls the path follower to make the object follow the path.

*/

path_follow()

C++ Interface: path_follow(const AIBehaviors self, float follow_wt)

/**
  • This function activates path following. This is the function we want the

  • user to call for path following.

*/

pauseAi()

C++ Interface: pause_ai(const AIBehaviors self, str ai_type)

/**
  • This function pauses individual or all the AIs.

*/

pause_ai()

C++ Interface: pause_ai(const AIBehaviors self, str ai_type)

/**
  • This function pauses individual or all the AIs.

*/

pursue()

C++ Interface: pursue(const AIBehaviors self, NodePath target_object, float pursue_wt)

/**
  • This function activates pursue. This is the function we want the user to

  • call for pursue to be done.

*/

removeAi()

C++ Interface: remove_ai(const AIBehaviors self, str ai_type)

/**
  • This function removes individual or all the AIs.

*/

remove_ai()

C++ Interface: remove_ai(const AIBehaviors self, str ai_type)

/**
  • This function removes individual or all the AIs.

*/

resumeAi()

C++ Interface: resume_ai(const AIBehaviors self, str ai_type)

/**
  • This function resumes individual or all the AIs

*/

resume_ai()

C++ Interface: resume_ai(const AIBehaviors self, str ai_type)

/**
  • This function resumes individual or all the AIs

*/

seek()

C++ Interface: seek(const AIBehaviors self, LVecBase3f pos, float seek_wt) seek(const AIBehaviors self, NodePath target_object, float seek_wt)

/**
  • This function activates seek and makes an object of the Seek class. This

  • is the function we want the user to call for seek to be done. This

  • function is overloaded to accept a NodePath or an LVecBase3.

*/

startFollow()

C++ Interface: start_follow(const AIBehaviors self, str type)

start_follow()

C++ Interface: start_follow(const AIBehaviors self, str type)

wander()

C++ Interface: wander(const AIBehaviors self, double wander_radius, int flag, double aoe, float wander_weight)

/**
  • This function activates wander. This is the function we want the user to

  • call for flock to be done.

*/