AIWorld

from panda3d.ai import AIWorld
class AIWorld

Bases: DTOOL_SUPER_BASE

A class that implements the virtual AI world which keeps track of the AI characters active at any given time. It contains a linked list of AI characters, obstactle data and unique name for each character. It also updates each characters state. The AI characters can also be added to the world as flocks.

Inheritance diagram

Inheritance diagram of AIWorld

__init__(*args, **kwargs)
addAiChar()

C++ Interface: add_ai_char(const AIWorld self, AICharacter ai_ch)

addFlock()

C++ Interface: add_flock(const AIWorld self, Flock flock)

/**
  • This function adds all the AI characters in the Flock object to the

  • AICharPool. This function allows adding the AI characetrs as part of a

  • flock.

*/

addObstacle()

C++ Interface: add_obstacle(const AIWorld self, NodePath obstacle)

/**
  • This function adds the nodepath as an obstacle that is needed by the

  • obstacle avoidance behavior.

*/

add_ai_char()

C++ Interface: add_ai_char(const AIWorld self, AICharacter ai_ch)

add_flock()

C++ Interface: add_flock(const AIWorld self, Flock flock)

/**
  • This function adds all the AI characters in the Flock object to the

  • AICharPool. This function allows adding the AI characetrs as part of a

  • flock.

*/

add_obstacle()

C++ Interface: add_obstacle(const AIWorld self, NodePath obstacle)

/**
  • This function adds the nodepath as an obstacle that is needed by the

  • obstacle avoidance behavior.

*/

flockOff()

C++ Interface: flock_off(const AIWorld self, int flock_id)

/**
  • This function turns off the flock behavior temporarily. Similar to pausing

  • the behavior.

*/

flockOn()

C++ Interface: flock_on(const AIWorld self, int flock_id)

/**
  • This function turns on the flock behavior.

*/

flock_off()

C++ Interface: flock_off(const AIWorld self, int flock_id)

/**
  • This function turns off the flock behavior temporarily. Similar to pausing

  • the behavior.

*/

flock_on()

C++ Interface: flock_on(const AIWorld self, int flock_id)

/**
  • This function turns on the flock behavior.

*/

getFlock()

C++ Interface: get_flock(const AIWorld self, int flock_id)

/**
  • This function returns a handle to the Flock whose id is passed.

*/

get_flock()

C++ Interface: get_flock(const AIWorld self, int flock_id)

/**
  • This function returns a handle to the Flock whose id is passed.

*/

printList()

C++ Interface: print_list(const AIWorld self)

/**
  • This function prints the names of the AI characters that have been added to

  • the AIWorld. Useful for debugging purposes.

*/

print_list()

C++ Interface: print_list(const AIWorld self)

/**
  • This function prints the names of the AI characters that have been added to

  • the AIWorld. Useful for debugging purposes.

*/

removeAiChar()

C++ Interface: remove_ai_char(const AIWorld self, str name)

removeFlock()

C++ Interface: remove_flock(const AIWorld self, int flock_id)

/**
  • This function removes the flock behavior completely.

*/

removeObstacle()

C++ Interface: remove_obstacle(const AIWorld self, NodePath obstacle)

/**
  • This function removes the nodepath from the obstacles list that is needed

  • by the obstacle avoidance behavior.

*/

remove_ai_char()

C++ Interface: remove_ai_char(const AIWorld self, str name)

remove_flock()

C++ Interface: remove_flock(const AIWorld self, int flock_id)

/**
  • This function removes the flock behavior completely.

*/

remove_obstacle()

C++ Interface: remove_obstacle(const AIWorld self, NodePath obstacle)

/**
  • This function removes the nodepath from the obstacles list that is needed

  • by the obstacle avoidance behavior.

*/

update()

C++ Interface: update(const AIWorld self)

/**
  • The AIWorld update function calls the update function of all the AI

  • characters which have been added to the AIWorld.

*/