Intersection Class

Module: cc

Intersection helper class

Index

Methods

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
  • 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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:43
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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:75
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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:100
Parameters
  • a Rect The first rect
  • b Rect The second rect
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
  • a Rect The rect
  • b Vec2[] The polygon, a set of points
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
  • 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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:221
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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:238
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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:267
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 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCIntersection.js:297
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 ""