Report abuse

BOOL NKPolygonContainsPoint(NKPolygon polygon, NSPoint point)
{
        // We could implement a fancy ray casting algorithm. but simply making a bezier path
        // And checking if it's inside, is much simpler.
        NSBezierPath *path = [NSBezierPath pathFromPolygon:polygon];
        
        return [path containsPoint:point]; // See! two lines instead of ~40-50 (if you're desperate for speed,
                                           //                                   implement the raycaster and email me ;)
}