Intersection Class

Module: cc

Intersection helper class

Index

Methods

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 line
  • a2 Vec2 The end point of the first line
  • b1 Vec2 The start point of the second line
  • b2 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
  • a1 Vec2 The start point of the line
  • a2 Vec2 The end point of the line
  • b Rect The rect
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 line
  • a2 Vec2 The end point of the line
  • b 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
  • a Rect The first rect
  • b Rect The second rect
rectPolygon

Test rect and polygon

meta description
Returns boolean
Defined in cocos2d/core/collider/CCIntersection.js:155
Parameters
  • a Rect The rect
  • b Vec2[] The polygon, a set of points
polygonPolygon

Test polygon and polygon

meta description
Returns boolean
Defined in cocos2d/core/collider/CCIntersection.js:207
Parameters
  • a Vec2[] The first polygon, a set of points
  • b Vec2[] The second polygon, a set of points
circleCircle

Test circle and circle

meta description
Returns boolean
Defined in cocos2d/core/collider/CCIntersection.js:246
Parameters
  • a Object Object contains position and radius
  • b Object Object contains position and radius
polygonCircle

Test polygon and circle

meta description
Returns boolean
Defined in cocos2d/core/collider/CCIntersection.js:263
Parameters
  • polygon Vec2[] The Polygon, a set of points
  • circle Object Object contains position and radius
pointInPolygon

Test whether the point is in the polygon

meta description
Returns boolean
Defined in cocos2d/core/collider/CCIntersection.js:292
Parameters
  • point Vec2 The point
  • polygon Vec2[] The polygon, a set of points
pointLineDistance

Calculate the distance of point to line.

meta description
Returns boolean
Defined in cocos2d/core/collider/CCIntersection.js:322
Parameters
  • point Vec2 The point
  • start Vec2 The start point of line
  • end Vec2 The end point of line
  • isSegment boolean whether this line is a segment

results matching ""

    No results matching ""