Intersection
Class
Module: cc
Intersection helper class
Index
Methods
lineLine
Test line and linelineRect
Test line and rectlinePolygon
Test line and polygonrectRect
Test rect and rectrectPolygon
Test rect and polygonpolygonPolygon
Test polygon and polygoncircleCircle
Test circle and circlepolygonCircle
Test polygon and circlepointInPolygon
Test whether the point is in the polygonpointLineDistance
Calculate the distance of point to line.
Details
Methods
lineLine
Test line and line
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:12 |
Parameters
a1
Vec2 The start point of the first linea2
Vec2 The end point of the first lineb1
Vec2 The start point of the second lineb2
Vec2 The end point of the second line
lineRect
Test line and rect
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:43 |
Parameters
linePolygon
Test line and polygon
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:75 |
Parameters
a1
Vec2 The start point of the linea2
Vec2 The end point of the lineb
Vec2[] The polygon, a set of points
rectRect
Test rect and rect
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:100 |
Parameters
rectPolygon
Test rect and polygon
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:130 |
Parameters
polygonPolygon
Test polygon and polygon
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:182 |
Parameters
circleCircle
Test circle and circle
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:221 |
Parameters
polygonCircle
Test polygon and circle
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:238 |
Parameters
pointInPolygon
Test whether the point is in the polygon
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:267 |
Parameters
pointLineDistance
Calculate the distance of point to line.
meta | description |
---|---|
Returns | boolean |
Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:297 |