deleted some unused code
added pointInPolygon, will be needed for convex/sphere nearphase