java.lang.Object
technology.sola.engine.graphics.AffineTransform
AffineTransform represents an affine transformation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBoundingBoxForTransform
(int width, int height) Returns the bounding box for this transform applied to a rectangle with width and height.multiply
(float x, float y) Multiplies theAffineTransform
with a point (x, y).multiplyInverse
(float x, float y) Multiplies the inverse of theAffineTransform
with a point (x, y).void
reset()
Resets this AffineTransform back to theMatrix3D.identity()
.rotate
(float radians) Rotates by radians.scale
(float sx, float sy) Scales by sx, sy.sheer
(float sx, float sy) Sheers by sx, sy.translate
(float tx, float ty) Translates by tx, ty.
-
Constructor Details
-
AffineTransform
public AffineTransform()
-
-
Method Details
-
reset
public void reset()Resets this AffineTransform back to theMatrix3D.identity()
. -
translate
Translates by tx, ty.- Parameters:
tx
- the x translationty
- the y translation- Returns:
- this
-
scale
Scales by sx, sy.- Parameters:
sx
- the x scale factorsy
- the y scale factor- Returns:
- this
-
rotate
Rotates by radians.- Parameters:
radians
- the radians to rotate the transform- Returns:
- this
-
sheer
Sheers by sx, sy.- Parameters:
sx
- the x sheersy
- the y sheer- Returns:
- this
-
multiply
Multiplies theAffineTransform
with a point (x, y).- Parameters:
x
- the x coordinatey
- the y coordinate- Returns:
- a
Vector2D
of the transform multiplied with the point
-
multiplyInverse
Multiplies the inverse of theAffineTransform
with a point (x, y).- Parameters:
x
- the x coordinatey
- the y coordinate- Returns:
- a
Vector2D
of the inverse transform multiplied with the point
-
getBoundingBoxForTransform
Returns the bounding box for this transform applied to a rectangle with width and height.- Parameters:
width
- the original width of the rectangleheight
- the original height of the rectangle- Returns:
- the bounding box after transform is applied
-