求问pointInPolygon ( point, polygon )中 polygon是什么呀?

我的代码如下, polygon是包围框还是点集
var touchLoc = touch.getLocation();
var ub = this.u.getBoundingBox()
if (cc.Intersection.pointInPolygon(touchLoc, ub)) {
this.up = true
cc.log(‘touchbigan2’)
}

            cc.log('touchbigan1')
            return true;
        },
    }, this.node);

可以参考一下 api 文档中的说明:http://www.cocos.com/docs/creator/api/classes/Intersection.html#method_pointInPolygon

[Vec2]是点集的意思吧,可是如何将getBoundingBox()转为[Vec2]

getBoundingBox()是拿的矩形包围框啊,Rect有自己的contains ( point )方法判断点是不是在矩形内。效率肯定比pointInPolygon高。

谢谢效果实现了