Re: [Algorithms] 2d circular union nav-mesh
Brought to you by:
vexxed72
From: Simon F. <sim...@po...> - 2010-05-26 12:05:33
|
Pau...@sc... wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Hi guys, > > Does anyone have any references or pointers for how to constrain a > small character (represented by a circle) within the interior of the > union of a set of larger circles? > > The background is, the larger circles define regions of land where > the small circle can navigate around (like a nav mesh), and the union > of the these circles defines the entire nav-mesh. The character is > not allowed to leave the interior of the nav-mesh and must remain > wholly inside it at all times. I'm probably missing something entirely obvious here, but since your items are all circles, can't you reduce the problem to just testing if the exact centre of your character (with radius R) is entirely contained in region circles whose radii have been reduced by R? Simon |