Wandering Steering Behavior

Topics: Developer Forum, User Forum
Coordinator
Nov 11, 2008 at 2:29 PM
There are some different ways of solving this "problem". You could do like you are doing, but you could also use the surface normal as the new direction. But that depends on what kind of behavior you want.

To answer your question, you can use the Body.Tag or Geometry.Tag to hold the wall orientation information. Or better yet, you can use the collision events.

topWall.OnCollision += OnRightWallCollision;

private bool OnRightWallCollision(Geom geom1, Geom geom2, ContactList contacts)
{
 wanderDirection = -wanderdirection.X;
}

Try playing with it. You should also, as I wrote before, have a look at surface normal.
Coordinator
Nov 12, 2008 at 6:55 PM
Edited Nov 12, 2008 at 6:56 PM
No problem sensorium7. Sorry I could not reply to your questions sooner, but I'm very busy with school and job. It seems you figured it out on your own. Thanks for posting the solution.