geomUtils.intersect
Class
Module: cc
Index
Methods
ray_cast
Check whether ray intersect with nodesray_plane
ray-plane intersectline_plane
line-plane intersectray_triangle
ray-triangle intersectline_triangle
line-triangle intersectline_quad
line-quad intersectray_sphere
ray-sphere intersectray_aabb
ray-aabb intersectray_obb
ray-obb intersectaabb_aabb
aabb-aabb intersectaabb_obb
aabb-obb intersectaabb_plane
aabb-plane intersectaabb_frustum
aabb-frustum intersect, faster but has false positive corner casesaabb_frustum_accurate
aabb-frustum intersect, handles most of the false positives correctlyobb_point
obb-point intersectobb_plane
obb-plane intersectobb_frustum
obb-frustum intersect, faster but has false positive corner casesobb_frustum_accurate
obb-frustum intersect, handles most of the false positives correctlyobb_obb
obb-obb intersectsphere_plane
phere-plane intersect, not necessarily faster than obb-plane...sphere_frustum
sphere-frustum intersect, faster but has false positive corner casessphere_frustum_accurate
sphere-frustum intersect, handles the false positives correctlysphere_sphere
sphere-sphere intersectsphere_aabb
sphere-aabb intersectsphere_obb
sphere-obb intersectresolve
The 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
root
Node If root is null, then traversal nodes from scene nodeworldRay
geomUtils.Rayhandler
Functionfilter
Function
ray_plane
ray-plane intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:201 |
Parameters
ray
geomUtils.Rayplane
geomUtils.Plane
line_plane
line-plane intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:223 |
Parameters
line
geomUtils.Lineplane
geomUtils.Plane
ray_triangle
ray-triangle intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:244 |
Parameters
ray
geomUtils.Raytriangle
geomUtils.TriangledoubleSided
boolean
line_triangle
line-triangle intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:287 |
Parameters
line
geomUtils.Linetriangle
geomUtils.TriangleoutPt
Vec3 optional, The intersection point
line_quad
line-quad intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:352 |
Parameters
p
Vec3 A point on a line segmentq
Vec3 Another point on the line segmenta
Vec3 Quadrilateral point ab
Vec3 Quadrilateral point bc
Vec3 Quadrilateral point cd
Vec3 Quadrilateral point doutPt
Vec3 optional, The intersection point
ray_sphere
ray-sphere intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:445 |
Parameters
ray
geomUtils.Raysphere
geomUtils.Sphere
ray_aabb
ray-aabb intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:476 |
Parameters
ray
geomUtils.Rayaabb
geomUtils.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
ray
geomUtils.Rayobb
geomUtils.Obb Direction box
aabb_aabb
aabb-aabb intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:589 |
Parameters
aabb1
geomUtils.Aabb Axis alignment surrounds box 1aabb2
geomUtils.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
aabb
geomUtils.Aabb Align the axis around the boxobb
geomUtils.Obb Direction box
aabb_plane
aabb-plane intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:733 |
Parameters
aabb
geomUtils.Aabb Align the axis around the boxplane
geomUtils.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
aabb
geomUtils.Aabb Align the axis around the boxfrustum
geomUtils.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
aabb
geomUtils.Aabb Align the axis around the boxfrustum
geomUtils.Frustum
obb_point
obb-point intersect
meta | description |
---|---|
Returns | boolean |
Defined in | cocos2d/core/geom-utils/intersect.ts:824 |
Parameters
obb
geomUtils.Obb Direction boxpoint
geomUtils.Vec3
obb_plane
obb-plane intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:843 |
Parameters
obb
geomUtils.Obb Direction boxplane
geomUtils.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
obb
geomUtils.Obb Direction boxfrustum
geomUtils.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
obb
geomUtils.Obb Direction boxfrustum
geomUtils.Frustum
obb_obb
obb-obb intersect
meta | description |
---|---|
Returns | number |
Defined in | cocos2d/core/geom-utils/intersect.ts:949 |
Parameters
obb1
geomUtils.Obb Direction box1obb2
geomUtils.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
sphere
geomUtils.Sphereplane
geomUtils.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
sphere
geomUtils.Spherefrustum
geomUtils.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
sphere
geomUtils.Spherefrustum
geomUtils.Frustum
sphere_sphere
sphere-sphere intersect
meta | description |
---|---|
Returns | boolean |
Defined in | cocos2d/core/geom-utils/intersect.ts:1076 |
Parameters
sphere0
geomUtils.Spheresphere1
geomUtils.Sphere
sphere_aabb
sphere-aabb intersect
meta | description |
---|---|
Returns | boolean |
Defined in | cocos2d/core/geom-utils/intersect.ts:1090 |
Parameters
sphere
geomUtils.Sphereaabb
geomUtils.Aabb
sphere_obb
sphere-obb intersect
meta | description |
---|---|
Returns | boolean |
Defined in | cocos2d/core/geom-utils/intersect.ts:1107 |
Parameters
sphere
geomUtils.Sphereobb
geomUtils.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
g1
Unknown Geometry 1g2
Unknown Geometry 2outPt
Unknown optional, Intersection point. (note: only partial shape detection with this return value)