Intersection Class
Module: cc
Intersection helper class
Index
Methods
lineLineTest line and linelineRectTest line and rectlinePolygonTest line and polygonrectRectTest rect and rectrectPolygonTest rect and polygonpolygonPolygonTest polygon and polygoncircleCircleTest circle and circlepolygonCircleTest polygon and circlepointInPolygonTest whether the point is in the polygonpointLineDistanceCalculate the distance of point to line.
Details
Methods
lineLine
Test line and line
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:37 |
Parameters
a1Vec2 The start point of the first linea2Vec2 The end point of the first lineb1Vec2 The start point of the second lineb2Vec2 The end point of the second line
lineRect
Test line and rect
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:68 |
Parameters
linePolygon
Test line and polygon
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:100 |
Parameters
a1Vec2 The start point of the linea2Vec2 The end point of the linebVec2[] The polygon, a set of points
rectRect
Test rect and rect
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:125 |
Parameters
rectPolygon
Test rect and polygon
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:155 |
Parameters
polygonPolygon
Test polygon and polygon
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:207 |
Parameters
circleCircle
Test circle and circle
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:246 |
Parameters
polygonCircle
Test polygon and circle
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:263 |
Parameters
pointInPolygon
Test whether the point is in the polygon
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:292 |
Parameters
pointLineDistance
Calculate the distance of point to line.
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/collider/CCIntersection.js:322 |