cc.exports.LineCollideRect(startLine,endLine,rect)--向量与矩形检测碰撞 --获取矩形的四个顶点位置 local p = {cc.p(rect.x,rect.y),cc.p(rect.x + rect.width,rect.y),cc.p(rect.x+rect.width,rect.y + rect.height),cc.p(rect.x,rect.y+rect.height)} local bRight = PointPosInVector(