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 | cocos2d/core/collider/CCIntersection.js:37 |
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 | 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
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 | 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 |