Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Transform
- m00 :: Transform -> Float
- m10 :: Transform -> Float
- m20 :: Transform -> Float
- m01 :: Transform -> Float
- m11 :: Transform -> Float
- m21 :: Transform -> Float
- m02 :: Transform -> Float
- m12 :: Transform -> Float
- m22 :: Transform -> Float
- createTransform :: Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Transform
- idTransform :: Transform
- translation :: Float -> Float -> Transform
- rotation :: Float -> Transform
- rotationWithCenter :: Float -> Float -> Float -> Transform
- scaling :: Float -> Float -> Transform
- scalingWithCenter :: Float -> Float -> Float -> Float -> Transform
- inverse :: Transform -> Transform
- fastInverse :: Transform -> Transform
- transformPoint :: Transform -> Vec2f -> Vec2f
- transformDir :: Transform -> Vec2f -> Vec2f
- transformRect :: Transform -> FloatRect -> FloatRect
Documentation
:: Float | Element (0, 0) of the matrix |
-> Float | Element (0, 1) of the matrix |
-> Float | Element (0, 2) of the matrix |
-> Float | Element (1, 0) of the matrix |
-> Float | Element (1, 1) of the matrix |
-> Float | Element (1, 2) of the matrix |
-> Float | Element (2, 0) of the matrix |
-> Float | Element (2, 1) of the matrix |
-> Float | Element (2, 2) of the matrix |
-> Transform |
Create a new transform from a matrix.
idTransform :: Transform Source
Identity transform.
Create a translation.
:: Float | Rotation angle, in degrees |
-> Float | X coordinate of the center of rotation |
-> Float | Y coordinate of the center of rotation |
-> Transform |
Create a rotation.
The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual [translate(-center), rotate(angle), translate(center)].
Create a scaling.
:: Float | Scaling factor on X axis |
-> Float | Scaling factor on Y axis |
-> Float | X coordinate of the center of scaling |
-> Float | Y coordinate of the center of scaling |
-> Transform |
Create a scaling.
The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual [translate(-center), scale(factors), translate(center)]
inverse :: Transform -> Transform Source
Return the inverse of a transform.
If the inverse cannot be computed, a new identity transform is returned.
fastInverse :: Transform -> Transform Source
Return the inverse of a transform.
This function is only applicable when the transform is composed of rotations and translations only.
transformPoint :: Transform -> Vec2f -> Vec2f Source
Apply a transform to a 2D point.
transformDir :: Transform -> Vec2f -> Vec2f Source
Apply a transform to a 2D direction vector.
transformRect :: Transform -> FloatRect -> FloatRect Source
Apply a transform to a rectangle.
Since SFML doesn't provide support for oriented rectangles, the result of this function is always an axis-aligned rectangle, which means that if the transform contains a rotation, the bounding rectangle of the transformed rectangle is returned.