Updated 9 Feb 2007, added collision avoidance (avoid other moving vehicles).
Update: screenshot and movie.
Updated 5 Feb 2007, added obstacle avoidance.
Demonstration of steering behaviors implemented in Panda, based on Craig Reynold’s steering behaviors site and on OpenSteer. The code is object oriented, designed to be extensible and easy to integrate with your own code.
There are five modules in the download:
- camera.py – a controllable camera. Very useful.
- draw.py – a library of primitive drawing functions (lines, circles, rectangles, grid, reticles etc) built on top of Panda’s LineSegs class. Useful for quickly throwing together a test environment for your code.
- steerVec.py – an extension of Panda’s Vec2 class with some extra methods needed for steering behaviors
- vehicle.py – a steerable vehicle with simple 2D physics (acceleration and momentum) and a variety of steering behaviors.
- steerDemo.py – this is the file you should run, it’s a graphical demo of the steering behaviors implemented in vehicle.py
Still to do:
- Obstacle and vehicle avoidance steering behaviors Update: done
- Combined steering behaviors. E.g. pursue the target while avoiding obstacles and other vehicles, steer to the goal while evading enemies and avoiding obstacles… Update: done
- Integrate vehicle.py with my NPC code to steer 3D animated characters over uneven terrain.
Also see IP Knightly’s steering demo which he released on the same day!