   Collision detection/correction
  I have seen various tutorials that teach how to do collision detection from a bounding shpere to a polygon, and if the sphere has ghone into the polygon it is pushed back out into a legal position correcting the problem.  What happens, however, if the player moves into an illegal position with polygon A and poly B.  The game moves the player back from poly A, and then moves the player back again from poly B.  What happens if the correction from poly B put the player in an illegal position with poly A?  
  In my collision detection routine, I have what is called Vector Safe;If I am in a safe spot in the current frame, I update this position into the safe position.If it so happens that if I get "stuck", I then make my position the Safe position.;  This has a problem though   player movement|   /|/| /||with yours, the new player location is|    x|||whereas what I want is a new player location of||||xyours leads to a "glue" effect, while in mine you can slide off of walls.  I still dont know how to correct the problem of correction creating new invalid positions.[edited by - DarkHamster on January 27, 2003 9:52:41 AM];  Why not use a hard collision system. Dont allow you Sphere to penetrate the Poly at all. Your movement vector takes you sphere through a wall.|   *| /|/    /|||So move your sphere to the point of collision and calculate the remaining velocity reflected from the surface||*| \||Now run through your collision routine again using this new position and velocity to check if there are any subsequent collisions. Repeat until there are none left (generally no more than 2 or 3 unless you are going ridiculously fast into some crazy geometry).You should end up in a safe position after bouncing off any and all surfaces in your way.    |    |    | *    |    |its a bit more complex but worth the effort.  ;  Let me clarify a little|/  You are not stuck, this is a safe position|/   so is this, so I make this the "new "safe position|/   This is also safe, Each frame I update|/   the safe position|/<-|*<|- This position (*) if you dont turn will be stuck,therefore    |   it is not safe, I just move back to here|   |___________________________________________|I slide along the wall by getting the normal of the plane the wall is on in relation to the motion vector, and move my motion vector along the normal.    ;  RatLord: But what if one of the polys that you push off of, pushes you into an illegal position with a poly that has already been checked? nevermind -- just grokked what you said[edited by - DarkHamster on January 30, 2003 7:25:26 PM]