Re: [Algorithms] 2d circular union nav-mesh
Brought to you by:
vexxed72
From: <Pau...@sc...> - 2010-06-01 08:54:38
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 > For interior arcs, you can reduce those to lines, since the arc > should be fully contained within two circles; if it weren't, it > would be an exterior arc. Hi Matt, Actually, i think i can contribute something here :) If the arc segment plus the centre of the circle the segment is from form a virtual slice of pie, then for any given point you can calculate the distance to the arc segment in one of two ways: 1) For any given point which lies within the angle range defined by the edges of the pie, form a vector from the pie centre to the candidate point, normalise and then scale by the circle radius - this gives the point projected onto the arc segment. You then just do a length op to find the distance 2) For any point outside of the pie (i.e. outside the angle range), the closest distance to the arc segment is the length of the vector defined by nearer of the two vertices which lie at the pie extremes subtracted from the candidate point. Mmmm, pie :) Cheers, Paul. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify pos...@sc... This footnote also confirms that this email message has been checked for all known viruses. Sony Computer Entertainment Europe Limited Registered Office: 10 Great Marlborough Street, London W1F 7LP, United Kingdom Registered in England: 3277793 ********************************************************************** P Please consider the environment before printing this e-mail -----BEGIN PGP SIGNATURE----- Version: PGP Universal 2.9.1 (Build 287) Charset: US-ASCII wsBVAwUBTATKw3ajGqjtoMHxAQhcEwf+LCAxZ38n3UFVcjjOsGRJ2TAs7p1IkroJ E2I+LdVWyAs/UJTxJ80U4e2mPoElNmKMxw2JSuZinsOIWHXbOX7h1KDKv9J9Ljxw 5l9NUskbzMY6RxIq+MlYuSmXxwGJmpsFipkqa7KbEZGuLxukecxABTKAvX44gpA/ LUBv6+lQlnphpU4YdzRf08E6E7BngVbHoMQKs2o957+MT1WjGkzKAzdU/m+p1ci5 8t3bY9pQ+ZxSVVqo2z/qZiH0FYwNpdepd9jkFGDUEu9GAM4wyM6f646VvbsvCJd0 EDW6XosGvTfaJYmRxAT9iQuOH2s0Lzyuvxql0BOFNynhIPWulzXFBg== =kpsR -----END PGP SIGNATURE----- |