Packagesandy.math
Classpublic final class IntersectionMath

An util class with static method which provides useful functions related to intersection.



Public Methods
 MethodDefined by
  
intersectionBSphere(p_oBSphereA:BSphere, p_oBSphereB:BSphere):Boolean
[static] Determines whether two bounding spheres intersect.
IntersectionMath
  
intersectionLine2D(p_oPointA:Point, p_oPointB:Point, p_oPointC:Point, p_oPointD:Point):Point
[static] Finds the intersection point of two 2D lines.
IntersectionMath
  
intersectionLine3D(p_oPointA:Vector, p_oPointB:Vector, p_oPointC:Vector, p_oPointD:Vector):Array
[static] Computes the smallest distance between two 3D lines.
IntersectionMath
  
isPointInTriangle2D(p_oPoint:Point, p_oA:Point, p_oB:Point, p_oC:Point):Boolean
[static] Determines if a point is within a triangle.
IntersectionMath
Method detail
intersectionBSphere()method
public static function intersectionBSphere(p_oBSphereA:BSphere, p_oBSphereB:BSphere):Boolean

Determines whether two bounding spheres intersect.

Parameters
p_oBSphereA:BSphere — The first bounding sphere.
 
p_oBSphereB:BSphere — The second bounding sphere.

Returns
Boolean — Whether the two spheres intersect.
intersectionLine2D()method 
public static function intersectionLine2D(p_oPointA:Point, p_oPointB:Point, p_oPointC:Point, p_oPointD:Point):Point

Finds the intersection point of two 2D lines.

Parameters
p_oPointA:Point — A point of the first line.
 
p_oPointB:Point — Another point of the first line.
 
p_oPointC:Point — A point of the second line.
 
p_oPointD:Point — Another point of the second line.

Returns
Point — The point where the two lines intersect. Returns null if lines are coincident or parallel.
intersectionLine3D()method 
public static function intersectionLine3D(p_oPointA:Vector, p_oPointB:Vector, p_oPointC:Vector, p_oPointD:Vector):Array

Computes the smallest distance between two 3D lines.

As 3D lines cannot intersect, we compute two points, first owning to the first 3D line, and the second point owning to the second 3D line.

The two points define a segment which length represents the shortest distance between these two lines.

Parameters
p_oPointA:Vector — A vector of the first 3D line.
 
p_oPointB:Vector — Another vector of the first 3D line.
 
p_oPointC:Vector — A vector of the second 3D line.
 
p_oPointD:Vector — Another vector of the second 3D line.

Returns
Array — An array containing the vectors of the segment connecting the two 3D lines.
isPointInTriangle2D()method 
public static function isPointInTriangle2D(p_oPoint:Point, p_oA:Point, p_oB:Point, p_oC:Point):Boolean

Determines if a point is within a triangle.

Parameters
p_oPoint:Point — The point to find in the triangle.
 
p_oA:Point — The first point of the triangle.
 
p_oB:Point — The second point of the triangle.
 
p_oC:Point — The third point of the triangle.

Returns
Boolean — Whether the point is inside the triangle.