©2010
<<<<<<< HEAD Generated by JsDoc Toolkit 2.4.0 on Mon Mar 21 2011 06:33:39 GMT-0000 (UTC)
======= Generated by JsDoc Toolkit 2.4.0 on Mon Apr 04 2011 02:43:32 GMT-0000 (UTC)
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff HTML template: Codeview

Class Matrix

<<<<<<< HEAD
Defined in: GameLib.js. =======
Defined in: gamelib.js. >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff

Class Summary
Constructor Attributes Constructor Name and Description
 
Matrix(a, b, c, d, tx, ty)
 _        _
| a  c tx  |
| b  d ty  |
|_0  0  1 _|
Creates a matrix for 2d affine transformations.
Field Summary
Field Attributes Field Name and Description
 
a
 
b
 
c
 
d
<static>  
A constant representing the horizontal flip transformation matrix.
<static>  
Matrix.IDENTITY
A constant representing the identity matrix.
 
tx
 
ty
<static>  
Matrix.VERTICAL_FLIP
A constant representing the vertical flip transformation matrix.
<<<<<<< HEAD ======= >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff <<<<<<< HEAD ======= >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff <<<<<<< HEAD ======= >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff <<<<<<< HEAD ======= >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff <<<<<<< HEAD ======= >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
Method Summary
Method Attributes Method Name and Description
<static>  
Matrix.concat(matrix)
 
concat(matrix)
Returns the result of this matrix multiplied by another matrix combining the geometric effects of the two.
<static>  
Matrix.deltaTransformPoint(point)
  <<<<<<< HEAD
Given a point in the pretransform coordinate space, returns the coordinates of =======
Given a point in the pretransform coordinate space, returns the coordinates of >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff that point after the transformation occurs.
<static>  
Matrix.inverse()
 
Returns the inverse of the matrix.
 
rotate(theta, aboutPoint)
Returns a new matrix that corresponds this matrix multiplied by a a rotation matrix.
<static>   <<<<<<< HEAD =======
Matrix.rotate(theta, aboutPoint)
<static>   >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
Matrix.rotation(theta, aboutPoint)
Creates a matrix transformation that corresponds to the given rotation, around (0,0) or the specified point.
<static>  
Matrix.scale(sx, sy, aboutPoint)
Returns a matrix that corresponds to scaling by factors of sx, sy along the x and y axis respectively.
 
scale(sx, sy, aboutPoint)
Returns a new matrix that corresponds this matrix multiplied by a a scaling matrix.
<static>   <<<<<<< HEAD
Matrix.scale(sx, sy, aboutPoint)
Returns a matrix that corresponds to scaling by factors of sx, sy along the x and y axis respectively.
=======
Matrix.transformPoint(point)
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
  <<<<<<< HEAD
Returns the result of applying the geometric transformation represented by the =======
Returns the result of applying the geometric transformation represented by the >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff Matrix object to the specified point.
<static>  
Matrix.translate(tx, ty)
 
translate(tx, ty)
Translates the matrix along the x and y axes, as specified by the tx and ty parameters.
<static>  
Matrix.translation(tx, ty)
Returns a matrix that corresponds to a translation of tx, ty.
Class Detail
Matrix(a, b, c, d, tx, ty)
 _        _
| a  c tx  |
| b  d ty  |
|_0  0  1 _|
Creates a matrix for 2d affine transformations. concat, inverse, rotate, scale and translate return new matrices with the transformations applied. The matrix is not modified in place. Returns the identity matrix when called with no arguments.
Parameters:
{Number} a Optional
{Number} b Optional
{Number} c Optional
{Number} d Optional
{Number} tx Optional
{Number} ty Optional
Field Detail
a
b
c
d
<static> Matrix.HORIZONTAL_FLIP
A constant representing the horizontal flip transformation matrix.
<static> Matrix.IDENTITY
A constant representing the identity matrix.
tx
ty
<static> Matrix.VERTICAL_FLIP
A constant representing the vertical flip transformation matrix.
Method Detail
<<<<<<< HEAD =======
<static> Matrix.concat(matrix)
Parameters:
matrix
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Matrix} concat(matrix)
Returns the result of this matrix multiplied by another matrix <<<<<<< HEAD combining the geometric effects of the two. In mathematical terms, ======= combining the geometric effects of the two. In mathematical terms, >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff concatenating two matrixes is the same as combining them using matrix multiplication. If this matrix is A and the matrix passed in is B, the resulting matrix is A x B http://mathworld.wolfram.com/MatrixMultiplication.html
Parameters:
{Matrix} matrix
The matrix to multiply this matrix by.
Returns:
The result of the matrix multiplication, a new matrix.
<<<<<<< HEAD =======
<static> Matrix.deltaTransformPoint(point)
Parameters:
point
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Point} deltaTransformPoint()
<<<<<<< HEAD Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs. Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method's transformation does not consider the translation parameters tx and ty. ======= Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs. Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method does not consider the translation parameters tx and ty. >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
Returns:
A new point transformed by this matrix ignoring tx and ty.
See:
#transformPoint
<<<<<<< HEAD =======
<static> Matrix.inverse()
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Matrix} inverse()
Returns the inverse of the matrix. http://mathworld.wolfram.com/MatrixInverse.html
Returns:
A new matrix that is the inverse of this matrix.
{Matrix} rotate(theta, aboutPoint)
Returns a new matrix that corresponds this matrix multiplied by a a rotation matrix.
Parameters:
{Number} theta
Amount to rotate in radians.
{Point} aboutPoint Optional
The point about which this rotation occurs. Defaults to (0,0).
Returns:
A new matrix, rotated by the specified amount.
See:
Matrix.rotation
<<<<<<< HEAD =======
<static> Matrix.rotate(theta, aboutPoint)
Parameters:
theta
aboutPoint
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
<static> {Matrix} Matrix.rotation(theta, aboutPoint)
Creates a matrix transformation that corresponds to the given rotation, around (0,0) or the specified point.
Parameters:
{Number} theta
Rotation in radians.
{Point} aboutPoint Optional
The point about which this rotation occurs. Defaults to (0,0).
Returns:
See:
Matrix#rotate
<<<<<<< HEAD
=======
<static> >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff {Matrix} <<<<<<< HEAD scale(sx, sy, aboutPoint)
Returns a new matrix that corresponds this matrix multiplied by a a scaling matrix. ======= Matrix.scale(sx, sy, aboutPoint)
Returns a matrix that corresponds to scaling by factors of sx, sy along the x and y axis respectively. If only one parameter is given the matrix is scaled uniformly along both axis. If the optional aboutPoint parameter is given the scaling takes place about the given point. >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
Parameters:
{Number} sx
<<<<<<< HEAD
=======
The amount to scale by along the x axis or uniformly if no sy is given.
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Number} sy Optional
<<<<<<< HEAD
=======
The amount to scale by along the y axis.
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Point} aboutPoint Optional
<<<<<<< HEAD
The point that remains fixed during the scaling
=======
The point about which the scaling occurs. Defaults to (0,0).
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
<<<<<<< HEAD =======
Returns:
A matrix transformation representing scaling by sx and sy.
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
See:
<<<<<<< HEAD
Matrix.scale
=======
Matrix#scale
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
<<<<<<< HEAD
<static> =======
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff {Matrix} <<<<<<< HEAD Matrix.scale(sx, sy, aboutPoint)
Returns a matrix that corresponds to scaling by factors of sx, sy along the x and y axis respectively. If only one parameter is given the matrix is scaled uniformly along both axis. If the optional aboutPoint parameter is given the scaling takes place about the given point. ======= scale(sx, sy, aboutPoint)
Returns a new matrix that corresponds this matrix multiplied by a a scaling matrix. >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
Parameters:
{Number} sx
<<<<<<< HEAD
The amount to scale by along the x axis or uniformly if no sy is given.
=======
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Number} sy Optional
<<<<<<< HEAD
The amount to scale by along the y axis.
=======
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Point} aboutPoint Optional
<<<<<<< HEAD
The point about which the scaling occurs. Defaults to (0,0).
=======
The point that remains fixed during the scaling
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
<<<<<<< HEAD
Returns:
A matrix transformation representing scaling by sx and sy.
======= >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
See:
<<<<<<< HEAD
Matrix#scale
=======
Matrix.scale
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
<<<<<<< HEAD =======
<static> Matrix.transformPoint(point)
Parameters:
point
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Point} transformPoint()
<<<<<<< HEAD Returns the result of applying the geometric transformation represented by the ======= Returns the result of applying the geometric transformation represented by the >>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff Matrix object to the specified point.
Returns:
A new point with the transformation applied.
See:
#deltaTransformPoint
<<<<<<< HEAD =======
<static> Matrix.translate(tx, ty)
Parameters:
tx
ty
>>>>>>> 3fe863faa00b8e51f1f2f53b6d3e10fbf4b349ff
{Matrix} translate(tx, ty)
Translates the matrix along the x and y axes, as specified by the tx and ty parameters.
Parameters:
{Number} tx
The translation along the x axis.
{Number} ty
The translation along the y axis.
Returns:
A new matrix with the translation applied.
See:
Matrix.translation
<static> {Matrix} Matrix.translation(tx, ty)
Returns a matrix that corresponds to a translation of tx, ty.
Parameters:
{Number} tx
The amount to translate in the x direction.
{Number} ty
The amount to translate in the y direction.
Returns:
A matrix transformation representing a translation by tx and ty.
See:
Matrix#translate