Feeler length is the range at which the obstacle can be detected by the AI Character
(Note : This does not correspond to actual length in render. The algorithm computes the feeler’s length based on AI Character’s speed and size and also the Obstacle size and the feeler length which is input to it simply a multiplier)
For the algorithm to work, the obstacles need to be added to the world like this :
aiWorld.addObstacle(NodePath obstacle)
Also you can remove an obstacle at any time needed by using
aiWorld.removeObstacle(NodePath obstacle)
The full working code in Panda3D is :
#for directx window and functions import direct.directbase.DirectStart #for most bus3d stuff from pandac.PandaModulesimport* #for directx object support from direct.showbase.DirectObjectimport DirectObject #for tasks from direct.taskimport Task #for Actors from direct.actor.Actorimport Actor #for Pandai from panda3d.aiimport* #for Onscreen GUI from direct.gui.OnscreenTextimport OnscreenText
# Globals speed = 0.75
# Function to put instructions on the screen. font = loader.loadFont("cmss12") def addInstructions(pos, msg): return OnscreenText(text=msg, style=1, fg=(1,1,1,1), font = font, pos=(-1.3, pos), align=TextNode.ALeft, scale = .05)