class PF::Transform2d
- PF::Transform2d
- Reference
- Object
Defined in:
transform2d.crConstructors
Class Method Summary
- .identity
-
.invert(matrix : Matrix)
Return a new inverted version of the given matrix
-
.rotation(angle : Float | Int)
Returns a matrix representing a 2d rotation
-
.scale(x : Float | Int, y : Float | Int)
Returns a matrix representing a 2d scaling
-
.shear(x : Float | Int, y : Float | Int)
Returns a matrix representing a 2d shear
-
.translation(x : Float | Int, y : Float | Int)
Returns a matrix representing a 2d translation
Instance Method Summary
- #apply(x : Float | Int, y : Float | Int)
- #apply(point : Vector2)
-
#bounding_box(x : Float | Int, y : Float | Int)
Return the boudning box of the current transformation matrix
-
#invert
Invert the transformation
- #matrix : Matrix(Float64, 9)
- #matrix=(matrix : Matrix(Float64, 9))
-
#reset
Reset the transformation to the identity matrix
-
#rotate(angle : Float | Int)
Rotate by angle (in radians)
-
#scale(x : Float | Int, y : Float | Int)
Scale by x and y
-
#scale(point : Vector2)
ditto
-
#scale(n : Number)
Scale both x and y by n
-
#shear(x : Float | Int, y : Float | Int)
Shear by x and y
-
#shear(point : Vector2)
ditto
-
#translate(x : Number, y : Number)
Translate by x and y
-
#translate(point : Vector2)
ditto
Constructor Detail
Class Method Detail
def self.translation(x : Float | Int, y : Float | Int)
#
Returns a matrix representing a 2d translation
Instance Method Detail
def bounding_box(x : Float | Int, y : Float | Int)
#
Return the boudning box of the current transformation matrix