|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bramosystems.oss.player.core.client.geom.TransformationMatrix
public class TransformationMatrix
Represents a transformation matrix that determines how to map points from one coordinate space to another. The matrix can be used to perform various two-dimensional graphical transformations including translation (x and y repositioning), rotation, scaling, and skewing.
A transformation matrix object is a 3x3 matrix with the following contents:
[ a b u ] [ c d v ] [ tx ty w ]Note: Property values
u
and v
are always 0.0,
while w
is always 1.0.
Note:The 3x3 matrix is implemented with a Matrix2D object.
Matrix2D
Constructor Summary | |
---|---|
TransformationMatrix()
Constructs a new identity TransformationMatrix |
|
TransformationMatrix(Matrix2D matrix)
Constructs a TransformationMatrix using the specified matrix. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
Matrix2D |
getMatrix()
Returns the backing 3x3 matrix |
int |
hashCode()
|
void |
invert()
Performs an inversion on this matrix |
void |
multiply(TransformationMatrix m)
Performs matrix multiplication on this matrix with the specified transformation matrix and keeps the result in this matrix |
void |
rotate(double angle)
Applies a rotation transformation to this matrix. |
void |
scale(double x,
double y)
Performs a scalling transformation on this matrix along the x and y axes. |
void |
skew(double ax,
double ay)
Applies a skewing transformation to this matrix |
void |
toIdentity()
Converts this matrix to an identity matrix |
java.lang.String |
toString()
Returns the matrix elements as a String |
void |
translate(double x,
double y)
Performs a displacement transformation on this matrix along the x and y axes |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TransformationMatrix()
public TransformationMatrix(Matrix2D matrix)
matrix
- the matrixMethod Detail |
---|
public Matrix2D getMatrix()
public void translate(double x, double y)
x
- displacement along the x-axis (in pixels)y
- displacement along the y-axis (in pixels)public void scale(double x, double y)
x
and the y-axis is multiplied by y
.
x
- multiplier used to scale the matrix along the x-axisy
- multiplier used to scale the matrix along the y-axispublic void rotate(double angle)
angle
- angle of rotation in radianspublic void skew(double ax, double ay)
ax
- skew angle along the x-axis (in radians)ay
- skew angle along the y-axis (in radians)public void multiply(TransformationMatrix m)
m
- the matrix to multipy with this matrixpublic void invert()
public void toIdentity()
public java.lang.String toString()
toString
in class java.lang.Object
a, b, u, c, d, v, tx, ty, w
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |