package starling.utils {
import openfl.geom.Vector3D;
import openfl.geom.Point;
import openfl.geom.Matrix3D;
import openfl.geom.Matrix;
/**
 *  A utility class containing methods related to the Matrix class. 
 * @externs
 */
public class MatrixUtil {
	/**
	 *  Converts a 2D matrix to a 3D matrix. If you pass an <code>out</code>-matrix,
	 *      * the result will be stored in this matrix instead of creating a new object. 
	 */
	public static function convertTo3D(matrix:openfl.geom.Matrix, out:openfl.geom.Matrix3D = undefined):openfl.geom.Matrix3D { return null; }
	/**
	 *  Converts a 3D matrix to a 2D matrix. Beware that this will work only for a 3D matrix
	 *      * describing a pure 2D transformation. 
	 */
	public static function convertTo2D(matrix3D:openfl.geom.Matrix3D, out:openfl.geom.Matrix = undefined):openfl.geom.Matrix { return null; }
	/**
	 *  Determines if the matrix is an identity matrix. 
	 */
	public static function isIdentity(matrix:openfl.geom.Matrix):Boolean { return false; }
	/**
	 *  Determines if the 3D matrix is an identity matrix. 
	 */
	public static function isIdentity3D(matrix:openfl.geom.Matrix3D):Boolean { return false; }
	/**
	 *  Transform a point with the given matrix. 
	 */
	public static function transformPoint(matrix:openfl.geom.Matrix, point:openfl.geom.Point, out:openfl.geom.Point = undefined):openfl.geom.Point { return null; }
	/**
	 *  Transforms a 3D point with the given matrix. 
	 */
	public static function transformPoint3D(matrix:openfl.geom.Matrix3D, point:openfl.geom.Vector3D, out:openfl.geom.Vector3D = undefined):openfl.geom.Vector3D { return null; }
	/**
	 *  Uses a matrix to transform 2D coordinates into a different space. If you pass an
	 *      * <code>out</code>-point, the result will be stored in this point instead of creating a
	 *      * new object. 
	 */
	public static function transformCoords(matrix:openfl.geom.Matrix, x:Number, y:Number, out:openfl.geom.Point = undefined):openfl.geom.Point { return null; }
	/**
	 *  Uses a matrix to transform 3D coordinates into a different space. If you pass a
	 *      * 'resultVector', the result will be stored in this vector3D instead of creating a
	 *      * new object. 
	 */
	public static function transformCoords3D(matrix:openfl.geom.Matrix3D, x:Number, y:Number, z:Number, out:openfl.geom.Vector3D = undefined):openfl.geom.Vector3D { return null; }
	/**
	 *  Appends a skew transformation to a matrix (angles in radians). The skew matrix
	 *      * has the following form:
	 *      * <pre>
	 *      * | cos(skewY)  -sin(skewX)  0 |
	 *      * | sin(skewY)   cos(skewX)  0 |
	 *      * |     0            0       1 |
	 *      * </pre>
	 *      
	 */
	public static function skew(matrix:openfl.geom.Matrix, skewX:Number, skewY:Number):void {}
	/**
	 *  Prepends a matrix to 'base' by multiplying it with another matrix. 
	 */
	public static function prependMatrix(base:openfl.geom.Matrix, prep:openfl.geom.Matrix):void {}
	/**
	 *  Prepends an incremental translation to a Matrix object. 
	 */
	public static function prependTranslation(matrix:openfl.geom.Matrix, tx:Number, ty:Number):void {}
	/**
	 *  Prepends an incremental scale change to a Matrix object. 
	 */
	public static function prependScale(matrix:openfl.geom.Matrix, sx:Number, sy:Number):void {}
	/**
	 *  Prepends an incremental rotation to a Matrix object (angle in radians). 
	 */
	public static function prependRotation(matrix:openfl.geom.Matrix, angle:Number):void {}
	/**
	 *  Prepends a skew transformation to a Matrix object (angles in radians). The skew matrix
	 *      * has the following form:
	 *      * <pre>
	 *      * | cos(skewY)  -sin(skewX)  0 |
	 *      * | sin(skewY)   cos(skewX)  0 |
	 *      * |     0            0       1 |
	 *      * </pre>
	 *      
	 */
	public static function prependSkew(matrix:openfl.geom.Matrix, skewX:Number, skewY:Number):void {}
	/**
	 *  Converts a Matrix3D instance to a String, which is useful when debugging. Per default,
	 *         *  the raw data is displayed transposed, so that the columns are displayed vertically. 
	 */
	public static function toString3D(matrix:openfl.geom.Matrix3D, transpose:Boolean = undefined, precision:int = undefined):String { return null; }
	/**
	 *  Converts a Matrix instance to a String, which is useful when debugging. 
	 */
	public static function toString(matrix:openfl.geom.Matrix, precision:int = undefined):String { return null; }
	/**
	 *  Updates the given matrix so that it points exactly to pixel boundaries. This works
	 *         *  only if the object is unscaled and rotated by a multiple of 90 degrees.
	 *         *
	 *         *  @param matrix    The matrix to manipulate in place (normally the modelview matrix).
	 *         *  @param pixelSize The size (in points) that represents one pixel in the back buffer.
	 *         
	 */
	public static function snapToPixels(matrix:openfl.geom.Matrix, pixelSize:Number):void {}
	/**
	 *  Creates a perspective projection matrix suitable for 2D and 3D rendering.
	 *         *
	 *         *  <p>The first 4 parameters define which area of the stage you want to view (the camera
	 *         *  will 'zoom' to exactly this region). The final 3 parameters determine the perspective
	 *         *  in which you're looking at the stage.</p>
	 *         *
	 *         *  <p>The stage is always on the rectangle that is spawned up between x- and y-axis (with
	 *         *  the given size). All objects that are exactly on that rectangle (z equals zero) will be
	 *         *  rendered in their true size, without any distortion.</p>
	 *         *
	 *         *  <p>If you pass only the first 4 parameters, the camera will be set up above the center
	 *         *  of the stage, with a field of view of 1.0 rad.</p>
	 *         
	 */
	public static function createPerspectiveProjectionMatrix(x:Number, y:Number, width:Number, height:Number, stageWidth:Number = undefined, stageHeight:Number = undefined, cameraPos:openfl.geom.Vector3D = undefined, out:openfl.geom.Matrix3D = undefined):openfl.geom.Matrix3D { return null; }
	/**
	 *  Creates a orthographic projection matrix suitable for 2D rendering. 
	 */
	public static function createOrthographicProjectionMatrix(x:Number, y:Number, width:Number, height:Number, out:openfl.geom.Matrix = undefined):openfl.geom.Matrix { return null; }
}
}
