PandaSteer 2

mavasher: thanks for trying out the code and getting back to me :slight_smile:

In theory the Character’s should be able to steer to avoid any ‘from’ object in the Panda collision system, which could be a sphere, inverse sphere, or plane, and you could use six planes together to make a cube or rectangle. It is just a case of writing new obstacle classes on the model of the existing sphere obstacle class. All that matters to the Character is that it gets a CollisionEvent with a position and surface normal for the collision from the Panda collision system, so you shouldn’t need to edit Character to get it to steer round obstacles of different shapes. In theory.

Personally I think spheres will work fine. You can roughly make any shape you want by chaining many spheres together.

For my purposes I only need 2D steering over uneven terrain. If you wanted 3D steering for flying vehicles and the like, much of the code would translate very easily, just replace Vec2 with Vec3, but some of the functions in vehicle.py and steerVec.py contain linear algebra that may get a lot more difficult in 3D compared to 2D. I’m probably not going to do 3D myself as I don’t need it.