struct

CP::Transform

Inherits Struct / Value / Object

Column major 2x3 affine transform.

Constants

IDENTITY = new

Identity transform matrix.

Constructors

axial_scale(axis : Vect, pivot : Vect, scale : Number) : self
Source
bone_scale(v0 : Vect, v1 : Vect) : self
Source
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.
Source
new_transpose(a : Number, c : Number, tx : Number, b : Number, d : Number, ty : Number) : self

Construct a new transform matrix in transposed order.

Source
ortho(bb : BB) : self
Source
rigid(translate : Vect, radians : Number) : Transform

Create a rigid transformation matrix. (translation + rotation)

Source
rigid_inverse

Fast inverse of a rigid transformation matrix.

Source
rotate(radians : Number) : self

Create a rotation matrix.

Source
scale(scale_x : Number, scale_y : Number) : self

Create a scale matrix.

Source
translate(translate : Vect) : self

Create a translation matrix.

Source

Instance methods

*(t2 : Transform) : Transform

Multiply two transformation matrices.

Source
a=(a : Float64)
Source
b=(b : Float64)
Source
c=(c : Float64)
Source
d=(d : Float64)
Source
inverse

Get the inverse of a transform matrix.

Source
transform(bb : BB) : BB

Transform a BB.

Source
transform_point(p : Vect) : Vect

Transform an absolute point. (i.e. a vertex)

Source
transform_vect(v : Vect) : Vect

Transform a vector (i.e. a normal)

Source
tx=(tx : Float64)
Source
ty=(ty : Float64)
Source
wrap(inner : Transform) : Transform
Source
wrap_inverse(inner : Transform) : Transform
Source