struct CP::Transform
- CP::Transform
- Struct
- Value
- Object
Overview
Column major 2x3 affine transform.
Defined in:
chipmunk/vector.crConstant Summary
-
IDENTITY =
new
-
Identity transform matrix.
Constructors
- .axial_scale(axis : Vect, pivot : Vect, scale : Number) : self
- .bone_scale(v0 : Vect, v1 : Vect) : self
-
.new(a : Number = 1, b : Number = 0, c : Number = 0, d : Number = 1, tx : Number = 0, ty : Number = 0)
Construct a new transform matrix.
-
.new_transpose(a : Number, c : Number, tx : Number, b : Number, d : Number, ty : Number) : self
Construct a new transform matrix in transposed order.
- .ortho(bb : BB) : self
-
.rigid(translate : Vect, radians : Number) : Transform
Create a rigid transformation matrix.
-
.rigid_inverse : Transform
Fast inverse of a rigid transformation matrix.
-
.rotate(radians : Number) : self
Create a rotation matrix.
-
.scale(scale_x : Number, scale_y : Number) : self
Create a scale matrix.
-
.translate(translate : Vect) : self
Create a translation matrix.
Instance Method Summary
-
#*(t2 : Transform) : Transform
Multiply two transformation matrices.
- #a : Float64
- #a=(a : Float64)
- #b : Float64
- #b=(b : Float64)
- #c : Float64
- #c=(c : Float64)
- #d : Float64
- #d=(d : Float64)
-
#inverse : Transform
Get the inverse of a transform matrix.
-
#transform(bb : BB) : BB
Transform a
BB
. -
#transform_point(p : Vect) : Vect
Transform an absolute point.
-
#transform_vect(v : Vect) : Vect
Transform a vector (i.e.
- #tx : Float64
- #tx=(tx : Float64)
- #ty : Float64
- #ty=(ty : Float64)
- #wrap(inner : Transform) : Transform
- #wrap_inverse(inner : Transform) : Transform
Constructor Detail
def self.new(a : Number = 1, b : Number = 0, c : Number = 0, d : Number = 1, tx : Number = 0, ty : Number = 0)
#
Construct a new transform matrix.
- (a, b) is the x basis vector.
- (c, d) is the y basis vector.
- (tx, ty) is the translation.
def self.new_transpose(a : Number, c : Number, tx : Number, b : Number, d : Number, ty : Number) : self
#
Construct a new transform matrix in transposed order.
Create a rigid transformation matrix. (translation + rotation)