|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.geom.Transform
public class Transform
A 2 dimensional transformation that can be applied to Shape
implemenations.
Constructor Summary | |
---|---|
Transform()
Create and identity transform |
|
Transform(float[] matrixPosition)
Create a transform for the given positions |
|
Transform(float point00,
float point01,
float point02,
float point10,
float point11,
float point12)
Create a transform for the given positions |
|
Transform(Transform other)
Copy a transform |
|
Transform(Transform t1,
Transform t2)
Concatanate to transform into one |
Method Summary | |
---|---|
Transform |
concatenate(Transform tx)
Update this Transform by concatenating the given Transform to this one. |
static Transform |
createRotateTransform(float angle)
Create a new rotation Transform |
static Transform |
createRotateTransform(float angle,
float x,
float y)
Create a new rotation Transform around the specified point |
static Transform |
createScaleTransform(float xScale,
float yScale)
Create an new scaling Transform |
static Transform |
createTranslateTransform(float xOffset,
float yOffset)
Create a new translation Transform |
float[] |
getMatrixPosition()
Get an array representing this Transform. |
java.lang.String |
toString()
Convert this Transform to a String. |
void |
transform(float[] source,
int sourceOffset,
float[] destination,
int destOffset,
int numberOfPoints)
Transform the point pairs in the source array and store them in the destination array. |
Vector2f |
transform(Vector2f pt)
Transform the vector2f based on the matrix defined in this transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Transform()
public Transform(Transform other)
other
- The other transform to copypublic Transform(Transform t1, Transform t2)
t1
- The first transform to joint2
- The second transform to joinpublic Transform(float[] matrixPosition)
matrixPosition
- An array of float[6] to set up a transform
java.lang.RuntimeException
- if the array is not of length 6public Transform(float point00, float point01, float point02, float point10, float point11, float point12)
point00
- float for the first positionpoint01
- float for the second positionpoint02
- float for the third positionpoint10
- float for the fourth positionpoint11
- float for the fifth positionpoint12
- float for the sixth positionMethod Detail |
---|
public void transform(float[] source, int sourceOffset, float[] destination, int destOffset, int numberOfPoints)
source
- Array of floats containing the points to be transformedsourceOffset
- Where in the array to start processingdestination
- Array of floats to store the results.destOffset
- Where in the array to start storingnumberOfPoints
- Number of points to be transformed
java.lang.ArrayIndexOutOfBoundsException
- if sourceOffset + numberOfPoints * 2 > source.length or the same operation on the destination arraypublic Transform concatenate(Transform tx)
tx
- The Transfrom to concatenate to this one.
public java.lang.String toString()
toString
in class java.lang.Object
public float[] getMatrixPosition()
public static Transform createRotateTransform(float angle)
angle
- The angle in radians to set the transform.
public static Transform createRotateTransform(float angle, float x, float y)
angle
- The angle in radians to set the transform.x
- The x coordinate around which to rotate.y
- The y coordinate around which to rotate.
public static Transform createTranslateTransform(float xOffset, float yOffset)
xOffset
- The amount to move in the x directionyOffset
- The amount to move in the y direction
public static Transform createScaleTransform(float xScale, float yScale)
xScale
- The amount to scale in the x coordinateyScale
- The amount to scale in the x coordinate
public Vector2f transform(Vector2f pt)
pt
- The point to be transformed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |