Packagelaya.d3.math
Classpublic class Collision
InheritanceCollision Inheritance Object

Collision 类用于检测碰撞。



Public Methods
 MethodDefined By
  
创建一个 Collision 实例。
Collision
  
[static] 空间中包围盒是否包含另一个包围盒
Collision
  
[static] 空间中包围盒是否包含另一个点
Collision
  
[static] 空间中包围盒是否包含另一个包围球
Collision
  
[static] 空间中包围盒与一点的最近点
Collision
  
[static] 空间中平面与一点的最近点
Collision
  
closestPointPointTriangle(point:Vector3, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3, out:Vector3):void
[static] 空间中点与三角面的最近点
Collision
  
[static] 空间中包围球与一点的最近点
Collision
  
[static] 空间中包围球与包围球的最近点
Collision
  
[static] 空间中包围盒到包围盒的距离
Collision
  
[static] 空间中点到包围盒的距离
Collision
  
distancePlaneToPoint(plane:Plane, point:Vector3):Number
[static] 空间中点到平面的距离
Collision
  
[static] 空间中点到包围球的距离
Collision
  
[static] 空间中包围球到包围球的距离
Collision
  
[static] 空间中包围盒和包围盒是否相交
Collision
  
[static] 空间中包围盒和包围球是否相交
Collision
  
[static] 空间中平面和包围盒是否相交
Collision
  
intersectsPlaneAndPlane(plane1:Plane, plane2:Plane):Boolean
[static] 空间中平面和平面是否相交
Collision
  
intersectsPlaneAndPlaneRL(plane1:Plane, plane2:Plane, line:Ray):Boolean
[static] 空间中平面和平面是否相交
Collision
  
[static] 空间中点和平面是否相交
Collision
  
[static] 空间中平面和包围球是否相交
Collision
  
intersectsPlaneAndTriangle(plane:Plane, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3):int
[static] 空间中平面和三角面是否相交
Collision
  
[static] 空间中射线和包围盒是否相交
Collision
  
[static] 空间中射线和包围盒是否相交
Collision
  
intersectsRayAndPlaneRD(ray:Ray, plane:Plane, out:Number):Boolean
[static] 空间中射线和平面是否相交
Collision
  
intersectsRayAndPlaneRP(ray:Ray, plane:Plane, out:Vector3):Boolean
[static] 空间中射线和平面是否相交
Collision
  
intersectsRayAndPoint(ray:Ray, point:Vector3):Boolean
[static] 空间中射线和点是否相交
Collision
  
intersectsRayAndRay(ray1:Ray, ray2:Ray, out:Vector3):Boolean
[static] 空间中射线和射线是否相交
Collision
  
[static] 空间中射线和包围球是否相交
Collision
  
[static] 空间中射线和包围球是否相交
Collision
  
intersectsRayAndTriangleRD(ray:Ray, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3, out:Number):Boolean
[static] 空间中射线和三角面是否相交,输出距离
Collision
  
intersectsRayAndTriangleRP(ray:Ray, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3, out:Vector3):Boolean
[static] 空间中射线和三角面是否相交,输出相交点
Collision
  
[static] 空间中包围球和包围球是否相交
Collision
  
intersectsSphereAndTriangle(sphere:BoundSphere, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3):Boolean
[static] 空间中包围球和三角面是否相交
Collision
  
[static] 空间中包围球是否包含另一包围盒
Collision
  
[static] 空间中包围球是否包含另一个点
Collision
  
[static] 空间中包围球是否包含另一包围球
Collision
  
sphereContainsTriangle(sphere:BoundSphere, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3):int
[static] 空间中包围球是否包含另一个三角面
Collision
Constructor Detail
Collision()Constructor
public function Collision()

创建一个 Collision 实例。

Method Detail
boxContainsBox()method
public static function boxContainsBox(box1:BoundBox, box2:BoundBox):int

空间中包围盒是否包含另一个包围盒

Parameters

box1:BoundBox — 包围盒1
 
box2:BoundBox — 包围盒2

Returns
int — 位置关系:0 不想交,1 包含, 2 相交
boxContainsPoint()method 
public static function boxContainsPoint(box:BoundBox, point:Vector3):int

空间中包围盒是否包含另一个点

Parameters

box:BoundBox — 包围盒
 
point:Vector3 — 点

Returns
int — 位置关系:0 不想交,1 包含, 2 相交
boxContainsSphere()method 
public static function boxContainsSphere(box:BoundBox, sphere:BoundSphere):int

空间中包围盒是否包含另一个包围球

Parameters

box:BoundBox — 包围盒
 
sphere:BoundSphere — 包围球

Returns
int — 位置关系:0 不想交,1 包含, 2 相交
closestPointBoxPoint()method 
public static function closestPointBoxPoint(box:BoundBox, point:Vector3, out:Vector3):void

空间中包围盒与一点的最近点

Parameters

box:BoundBox — 包围盒
 
point:Vector3 — 点
 
out:Vector3 — 最近点

closestPointPlanePoint()method 
public static function closestPointPlanePoint(plane:Plane, point:Vector3, out:Vector3):void

空间中平面与一点的最近点

Parameters

plane:Plane — 平面
 
point:Vector3 — 点
 
out:Vector3 — 最近点

closestPointPointTriangle()method 
public static function closestPointPointTriangle(point:Vector3, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3, out:Vector3):void

空间中点与三角面的最近点

Parameters

point:Vector3 — 点
 
vertex1:Vector3 — 三角面顶点1
 
vertex2:Vector3 — 三角面顶点2
 
vertex3:Vector3 — 三角面顶点3
 
out:Vector3 — 最近点

closestPointSpherePoint()method 
public static function closestPointSpherePoint(sphere:BoundSphere, point:Vector3, out:Vector3):void

空间中包围球与一点的最近点

Parameters

sphere:BoundSphere — 包围球
 
point:Vector3 — 点
 
out:Vector3 — 最近点

closestPointSphereSphere()method 
public static function closestPointSphereSphere(sphere1:BoundSphere, sphere2:BoundSphere, out:Vector3):void

空间中包围球与包围球的最近点

Parameters

sphere1:BoundSphere — 包围球1
 
sphere2:BoundSphere — 包围球2
 
out:Vector3 — 最近点

distanceBoxToBox()method 
public static function distanceBoxToBox(box1:BoundBox, box2:BoundBox):Number

空间中包围盒到包围盒的距离

Parameters

box1:BoundBox — 包围盒1
 
box2:BoundBox — 包围盒2

Returns
Number
distanceBoxToPoint()method 
public static function distanceBoxToPoint(box:BoundBox, point:Vector3):Number

空间中点到包围盒的距离

Parameters

box:BoundBox — 包围盒
 
point:Vector3 — 点

Returns
Number
distancePlaneToPoint()method 
public static function distancePlaneToPoint(plane:Plane, point:Vector3):Number

空间中点到平面的距离

Parameters

plane:Plane — 平面
 
point:Vector3 — 点

Returns
Number
distanceSphereToPoint()method 
public static function distanceSphereToPoint(sphere:BoundSphere, point:Vector3):Number

空间中点到包围球的距离

Parameters

sphere:BoundSphere — 包围球
 
point:Vector3 — 点

Returns
Number
distanceSphereToSphere()method 
public static function distanceSphereToSphere(sphere1:BoundSphere, sphere2:BoundSphere):Number

空间中包围球到包围球的距离

Parameters

sphere1:BoundSphere — 包围球1
 
sphere2:BoundSphere — 包围球2

Returns
Number
intersectsBoxAndBox()method 
public static function intersectsBoxAndBox(box1:BoundBox, box2:BoundBox):Boolean

空间中包围盒和包围盒是否相交

Parameters

box1:BoundBox — 包围盒1
 
box2:BoundBox — 包围盒2

Returns
Boolean — 是否相交
intersectsBoxAndSphere()method 
public static function intersectsBoxAndSphere(box:BoundBox, sphere:BoundSphere):Boolean

空间中包围盒和包围球是否相交

Parameters

box:BoundBox — 包围盒
 
sphere:BoundSphere — 包围球

Returns
Boolean — 是否相交
intersectsPlaneAndBox()method 
public static function intersectsPlaneAndBox(plane:Plane, box:BoundBox):int

空间中平面和包围盒是否相交

Parameters

plane:Plane — 平面
 
box:BoundBox — 包围盒

Returns
int — 碰撞状态
intersectsPlaneAndPlane()method 
public static function intersectsPlaneAndPlane(plane1:Plane, plane2:Plane):Boolean

空间中平面和平面是否相交

Parameters

plane1:Plane — 平面1
 
plane2:Plane — 平面2

Returns
Boolean — 是否相交
intersectsPlaneAndPlaneRL()method 
public static function intersectsPlaneAndPlaneRL(plane1:Plane, plane2:Plane, line:Ray):Boolean

空间中平面和平面是否相交

Parameters

plane1:Plane — 平面1
 
plane2:Plane — 平面2
 
line:Ray — 相交线

Returns
Boolean — 是否相交
intersectsPlaneAndPoint()method 
public static function intersectsPlaneAndPoint(plane:Plane, point:Vector3):int

空间中点和平面是否相交

Parameters

plane:Plane — 平面
 
point:Vector3 — 点

Returns
int — 碰撞状态
intersectsPlaneAndSphere()method 
public static function intersectsPlaneAndSphere(plane:Plane, sphere:BoundSphere):int

空间中平面和包围球是否相交

Parameters

plane:Plane — 平面
 
sphere:BoundSphere — 包围球

Returns
int — 碰撞状态
intersectsPlaneAndTriangle()method 
public static function intersectsPlaneAndTriangle(plane:Plane, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3):int

空间中平面和三角面是否相交

Parameters

plane:Plane — 平面
 
vertex1:Vector3 — 三角面顶点1
 
vertex2:Vector3 — 三角面顶点2
 
vertex3:Vector3 — 三角面顶点3

Returns
int — 返回空间位置关系
intersectsRayAndBoxRD()method 
public static function intersectsRayAndBoxRD(ray:Ray, box:BoundBox):Number

空间中射线和包围盒是否相交

Parameters

ray:Ray — 射线
 
box:BoundBox — 包围盒

Returns
Number
intersectsRayAndBoxRP()method 
public static function intersectsRayAndBoxRP(ray:Ray, box:BoundBox, out:Vector3):Number

空间中射线和包围盒是否相交

Parameters

ray:Ray — 射线
 
box:BoundBox — 包围盒
 
out:Vector3 — 相交点

Returns
Number
intersectsRayAndPlaneRD()method 
public static function intersectsRayAndPlaneRD(ray:Ray, plane:Plane, out:Number):Boolean

空间中射线和平面是否相交

Parameters

ray:Ray — 射线
 
plane:Plane — 平面
 
out:Number — 相交距离,如果为0,不相交

Returns
Boolean
intersectsRayAndPlaneRP()method 
public static function intersectsRayAndPlaneRP(ray:Ray, plane:Plane, out:Vector3):Boolean

空间中射线和平面是否相交

Parameters

ray:Ray — 射线
 
plane:Plane — 平面
 
out:Vector3 — 相交点

Returns
Boolean
intersectsRayAndPoint()method 
public static function intersectsRayAndPoint(ray:Ray, point:Vector3):Boolean

空间中射线和点是否相交

Parameters

ray:Ray — 包围球1
 
point:Vector3 — 包围球2

Returns
Boolean
intersectsRayAndRay()method 
public static function intersectsRayAndRay(ray1:Ray, ray2:Ray, out:Vector3):Boolean

空间中射线和射线是否相交

Parameters

ray1:Ray — 射线1
 
ray2:Ray — 射线2
 
out:Vector3 — 相交点

Returns
Boolean
intersectsRayAndSphereRD()method 
public static function intersectsRayAndSphereRD(ray:Ray, sphere:BoundSphere):Number

空间中射线和包围球是否相交

Parameters

ray:Ray — 射线
 
sphere:BoundSphere — 包围球

Returns
Number — 相交距离,-1表示不相交
intersectsRayAndSphereRP()method 
public static function intersectsRayAndSphereRP(ray:Ray, sphere:BoundSphere, out:Vector3):Number

空间中射线和包围球是否相交

Parameters

ray:Ray — 射线
 
sphere:BoundSphere — 包围球
 
out:Vector3 — 相交点

Returns
Number — 相交距离,-1表示不相交
intersectsRayAndTriangleRD()method 
public static function intersectsRayAndTriangleRD(ray:Ray, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3, out:Number):Boolean

空间中射线和三角面是否相交,输出距离

Parameters

ray:Ray — 射线
 
vertex1:Vector3 — 三角面顶点1
 
vertex2:Vector3 — 三角面顶点2
 
vertex3:Vector3 — 三角面顶点3
 
out:Number — 点和三角面的距离

Returns
Boolean — 是否相交
intersectsRayAndTriangleRP()method 
public static function intersectsRayAndTriangleRP(ray:Ray, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3, out:Vector3):Boolean

空间中射线和三角面是否相交,输出相交点

Parameters

ray:Ray — 射线
 
vertex1:Vector3 — 三角面顶点1
 
vertex2:Vector3 — 三角面顶点2
 
vertex3:Vector3 — 三角面顶点3
 
out:Vector3 — 相交点

Returns
Boolean — 是否相交
intersectsSphereAndSphere()method 
public static function intersectsSphereAndSphere(sphere1:BoundSphere, sphere2:BoundSphere):Boolean

空间中包围球和包围球是否相交

Parameters

sphere1:BoundSphere — 包围球1
 
sphere2:BoundSphere — 包围球2

Returns
Boolean — 是否相交
intersectsSphereAndTriangle()method 
public static function intersectsSphereAndTriangle(sphere:BoundSphere, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3):Boolean

空间中包围球和三角面是否相交

Parameters

sphere:BoundSphere — 包围球
 
vertex1:Vector3 — 三角面顶点1
 
vertex2:Vector3 — 三角面顶点2
 
vertex3:Vector3 — 三角面顶点3

Returns
Boolean — 返回是否相交
sphereContainsBox()method 
public static function sphereContainsBox(sphere:BoundSphere, box:BoundBox):int

空间中包围球是否包含另一包围盒

Parameters

sphere:BoundSphere — 包围球
 
box:BoundBox — 包围盒

Returns
int — 位置关系:0 不想交,1 包含, 2 相交
sphereContainsPoint()method 
public static function sphereContainsPoint(sphere:BoundSphere, point:Vector3):int

空间中包围球是否包含另一个点

Parameters

sphere:BoundSphere — 包围球
 
point:Vector3 — 点

Returns
int — 位置关系:0 不想交,1 包含, 2 相交
sphereContainsSphere()method 
public static function sphereContainsSphere(sphere1:BoundSphere, sphere2:BoundSphere):int

空间中包围球是否包含另一包围球

Parameters

sphere1:BoundSphere — 包围球
 
sphere2:BoundSphere — 包围球

Returns
int — 位置关系:0 不想交,1 包含, 2 相交
sphereContainsTriangle()method 
public static function sphereContainsTriangle(sphere:BoundSphere, vertex1:Vector3, vertex2:Vector3, vertex3:Vector3):int

空间中包围球是否包含另一个三角面

Parameters

sphere:BoundSphere
 
vertex1:Vector3 — 三角面顶点1
 
vertex2:Vector3 — 三角面顶点2
 
vertex3:Vector3 — 三角面顶点3

Returns
int — 返回空间位置关系