Intersection Class
Module: cc
Intersection helper class
Index
Methods
- lineLineTest line and line
- lineRectTest line and rect
- linePolygonTest line and polygon
- rectRectTest rect and rect
- rectPolygonTest rect and polygon
- polygonPolygonTest polygon and polygon
- circleCircleTest circle and circle
- polygonCircleTest polygon and circle
- pointInPolygonTest whether the point is in the polygon
- pointLineDistanceCalculate 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 line
- a2Vec2 The end point of the first line
- b1Vec2 The start point of the second line
- b2Vec2 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 line
- a2Vec2 The end point of the line
- bVec2[] 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 | number | 
| Defined in | cocos2d/core/collider/CCIntersection.js:322 | 
