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] Provide an intersection test between 2 bounding boxes.
IntersectionMath
  
intersectionLine2D(p_oPointA:Point, p_oPointB:Point, p_oPointC:Point, p_oPointD:Point):Point
[static] Computation of the intersection point between 2 2D lines AB and CD.
IntersectionMath
  
intersectionLine3D(p_oPointA:Vector, p_oPointB:Vector, p_oPointC:Vector, p_oPointD:Vector):Array
[static] Computes the smallest distance between these 3D lines.
IntersectionMath
Method detail
intersectionBSphere()method
public static function intersectionBSphere(p_oBSphereA:BSphere, p_oBSphereB:BSphere):Boolean

Provide an intersection test between 2 bounding boxes.

Parameters
p_oBSphereA:BSphere
 
p_oBSphereB:BSphere

Returns
Boolean — Boolean true is their are intersection, false otherwise
intersectionLine2D()method 
public static function intersectionLine2D(p_oPointA:Point, p_oPointB:Point, p_oPointC:Point, p_oPointD:Point):Point

Computation of the intersection point between 2 2D lines AB and CD. This function returns the intersection point. Returns null in case the two lines are coincident or parallel Original implementation : http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/

Parameters
p_oPointA:Point
 
p_oPointB:Point
 
p_oPointC:Point
 
p_oPointD:Point

Returns
Point
intersectionLine3D()method 
public static function intersectionLine3D(p_oPointA:Vector, p_oPointB:Vector, p_oPointC:Vector, p_oPointD:Vector):Array

Computes the smallest distance between these 3D lines. As 3D lines can be not intersecting, we compute two points, first owning to the first 3D line, and the second point owning to the second 3D line. The 2 points define a segment which length represents hte shortest distance between these 2 lines.

Parameters
p_oPointA:Vector
 
p_oPointB:Vector
 
p_oPointC:Vector
 
p_oPointD:Vector

Returns
Array