27.12.2011, 15:49
does your checkpoint data include an angle for the checkpoint? providing one, you can calculate the exit point with the sinus/cosinus functions. with the walls orientation, the angle of the checkpoint could be calculated aswell.
presuming your checkpoint coordinates are cX,cY,cZ,cA, and Radius is like 5 units, this should give you some results:
you noticed the 180 - in your example the wall is at north, thats 0 degrees. rotate (sour skin) 180 degrees, then you watch away from that wall. step forward 5 units, then you got back to your desired position. the same trick will work on any wall rotation, just think about a 90 degrees rotated wall: the sinus will be 0, where the cosinus is 1. the cosinus axis result adds the radius (5) multiplied with the bias (cosinus value=1) == 5 to the left (90 plus 180= 270, thats the left side)
i typed this out of my mind, w/o checking...
presuming your checkpoint coordinates are cX,cY,cZ,cA, and Radius is like 5 units, this should give you some results:
Код:
new cXNew=Radius*floatsin(cA+180,degrees); new cYNew=Radius*floatcos(cA+180,degrees);
i typed this out of my mind, w/o checking...