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 | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:12 | 
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 | 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
- 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 | 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 | 
