geomUtils.intersect Class
Module: cc
Index
Methods
ray_castCheck whether ray intersect with nodesray_planeray-plane intersectline_planeline-plane intersectray_triangleray-triangle intersectline_triangleline-triangle intersectline_quadline-quad intersectray_sphereray-sphere intersectray_aabbray-aabb intersectray_obbray-obb intersectaabb_aabbaabb-aabb intersectaabb_obbaabb-obb intersectaabb_planeaabb-plane intersectaabb_frustumaabb-frustum intersect, faster but has false positive corner casesaabb_frustum_accurateaabb-frustum intersect, handles most of the false positives correctlyobb_pointobb-point intersectobb_planeobb-plane intersectobb_frustumobb-frustum intersect, faster but has false positive corner casesobb_frustum_accurateobb-frustum intersect, handles most of the false positives correctlyobb_obbobb-obb intersectsphere_planephere-plane intersect, not necessarily faster than obb-plane...sphere_frustumsphere-frustum intersect, faster but has false positive corner casessphere_frustum_accuratesphere-frustum intersect, handles the false positives correctlysphere_spheresphere-sphere intersectsphere_aabbsphere-aabb intersectsphere_obbsphere-obb intersectresolveThe intersection detection of g1 and g2 can fill in the shape in the basic geometry.
Details
Methods
ray_cast
Check whether ray intersect with nodes
| meta | description |
|---|---|
| Returns | |
| Defined in | cocos2d/core/geom-utils/intersect.ts:88 |
Parameters
rootNode If root is null, then traversal nodes from scene nodeworldRaygeomUtils.RayhandlerFunctionfilterFunction
ray_plane
ray-plane intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:201 |
Parameters
raygeomUtils.RayplanegeomUtils.Plane
line_plane
line-plane intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:223 |
Parameters
linegeomUtils.LineplanegeomUtils.Plane
ray_triangle
ray-triangle intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:244 |
Parameters
raygeomUtils.RaytrianglegeomUtils.TriangledoubleSidedboolean
line_triangle
line-triangle intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:287 |
Parameters
linegeomUtils.LinetrianglegeomUtils.TriangleoutPtVec3 optional, The intersection point
line_quad
line-quad intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:352 |
Parameters
pVec3 A point on a line segmentqVec3 Another point on the line segmentaVec3 Quadrilateral point abVec3 Quadrilateral point bcVec3 Quadrilateral point cdVec3 Quadrilateral point doutPtVec3 optional, The intersection point
ray_sphere
ray-sphere intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:445 |
Parameters
raygeomUtils.RayspheregeomUtils.Sphere
ray_aabb
ray-aabb intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:476 |
Parameters
raygeomUtils.RayaabbgeomUtils.Aabb Align the axis around the box
ray_obb
ray-obb intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:509 |
Parameters
raygeomUtils.RayobbgeomUtils.Obb Direction box
aabb_aabb
aabb-aabb intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:589 |
Parameters
aabb1geomUtils.Aabb Axis alignment surrounds box 1aabb2geomUtils.Aabb Axis alignment surrounds box 2
aabb_obb
aabb-obb intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:678 |
Parameters
aabbgeomUtils.Aabb Align the axis around the boxobbgeomUtils.Obb Direction box
aabb_plane
aabb-plane intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:733 |
Parameters
aabbgeomUtils.Aabb Align the axis around the boxplanegeomUtils.Plane
aabb_frustum
aabb-frustum intersect, faster but has false positive corner cases
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:752 |
Parameters
aabbgeomUtils.Aabb Align the axis around the boxfrustumgeomUtils.Frustum
aabb_frustum_accurate
aabb-frustum intersect, handles most of the false positives correctly
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:772 |
Parameters
aabbgeomUtils.Aabb Align the axis around the boxfrustumgeomUtils.Frustum
obb_point
obb-point intersect
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/geom-utils/intersect.ts:824 |
Parameters
obbgeomUtils.Obb Direction boxpointgeomUtils.Vec3
obb_plane
obb-plane intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:843 |
Parameters
obbgeomUtils.Obb Direction boxplanegeomUtils.Plane
obb_frustum
obb-frustum intersect, faster but has false positive corner cases
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:870 |
Parameters
obbgeomUtils.Obb Direction boxfrustumgeomUtils.Frustum
obb_frustum_accurate
obb-frustum intersect, handles most of the false positives correctly
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:890 |
Parameters
obbgeomUtils.Obb Direction boxfrustumgeomUtils.Frustum
obb_obb
obb-obb intersect
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:949 |
Parameters
obb1geomUtils.Obb Direction box1obb2geomUtils.Obb Direction box2
sphere_plane
phere-plane intersect, not necessarily faster than obb-plane
due to the length calculation of the plane normal to factor out
the unnomalized plane distance
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:1004 |
Parameters
spheregeomUtils.SphereplanegeomUtils.Plane
sphere_frustum
sphere-frustum intersect, faster but has false positive corner cases
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:1023 |
Parameters
spheregeomUtils.SpherefrustumgeomUtils.Frustum
sphere_frustum_accurate
sphere-frustum intersect, handles the false positives correctly
| meta | description |
|---|---|
| Returns | number |
| Defined in | cocos2d/core/geom-utils/intersect.ts:1043 |
Parameters
spheregeomUtils.SpherefrustumgeomUtils.Frustum
sphere_sphere
sphere-sphere intersect
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/geom-utils/intersect.ts:1076 |
Parameters
sphere0geomUtils.Spheresphere1geomUtils.Sphere
sphere_aabb
sphere-aabb intersect
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/geom-utils/intersect.ts:1090 |
Parameters
spheregeomUtils.SphereaabbgeomUtils.Aabb
sphere_obb
sphere-obb intersect
| meta | description |
|---|---|
| Returns | boolean |
| Defined in | cocos2d/core/geom-utils/intersect.ts:1107 |
Parameters
spheregeomUtils.SphereobbgeomUtils.Obb
resolve
The intersection detection of g1 and g2 can fill in the shape in the basic geometry.
| meta | description |
|---|---|
| Defined in | cocos2d/core/geom-utils/intersect.ts:1159 |
Parameters
g1Unknown Geometry 1g2Unknown Geometry 2outPtUnknown optional, Intersection point. (note: only partial shape detection with this return value)