Packageorg.ffilmation.utils
Classpublic class polygonUtils

This class provides several polygon algorythms



Public Methods
 MethodDefined by
  
checkPolygonCollision(polygonA:Array, polygonB:Array):Boolean
[static] Checks if polygon A is intersects polygon B.
polygonUtils
  
clipLine(x1:Number, y1:Number, x2:Number, y2:Number, viewport:vport):line
[static]
polygonUtils
  
clipPolygon(polygon:Array, viewport:vport):Array
[static] The clipPolygon() function accepts an array of vertices as input and clips the polygon edges against a rectangular clip region.
polygonUtils
Method detail
checkPolygonCollision()method
public static function checkPolygonCollision(polygonA:Array, polygonB:Array):Boolean

Checks if polygon A is intersects polygon B. As seen on: http://www.codeproject.com/cs/media/PolygonCollision.asp

Parameters
polygonA:Array — An array of points defining polygon A
 
polygonB:Array — An array of points defining polygon B

Returns
Boolean
clipLine()method 
public static function clipLine(x1:Number, y1:Number, x2:Number, y2:Number, viewport:vport):lineParameters
x1:Number
 
y1:Number
 
x2:Number
 
y2:Number
 
viewport:vport

Returns
line
clipPolygon()method 
public static function clipPolygon(polygon:Array, viewport:vport):Array

The clipPolygon() function accepts an array of vertices as input and clips the polygon edges against a rectangular clip region. Turning points are generated when necessary to keep the polygon structure and ensure a correct visualization. The function generates the resulting polygons in an output array of points. As seen on http://www.chez.com/pmaillot/2dpclip/2dpclip.htm

Parameters
polygon:Array
 
viewport:vport

Returns
Array