At 8/21/08 07:20 AM, GustTheASGuy wrote:
What, no. You iterate points around the given in a circle to find two on the border of the shape and get their normal.
you test for collisions in a circle, for example every 10 degrees, and take the average angle of the two farthest border points.
//outline
for(var i=0;i<Math.PI*2, i+=Math.PI/10){
if(_root.ground.hitTest(_x+Math.cos(i)*1 0,_y+Math.sin(i)*10)){
//find border points
}
}
//find average angle