/** Postmultiplies this matrix by a translation matrix. * @param trn The translation vector. * @return This matrix for the purpose of chaining. */ public Affine2 translate (Vector2 trn) { return translate(trn.x, trn.y); }
/** Postmultiplies this matrix by a translation matrix. * @param trn The translation vector. * @return This matrix for the purpose of chaining. */ public Affine2 translate (Vector2 trn) { return translate(trn.x, trn.y); }
/** Returns the transform for this group's coordinate system. */ protected Matrix4 computeTransform () { Affine2 worldTransform = this.worldTransform; float originX = this.originX, originY = this.originY; worldTransform.setToTrnRotScl(x + originX, y + originY, rotation, scaleX, scaleY); if (originX != 0 || originY != 0) worldTransform.translate(-originX, -originY); // Find the first parent that transforms. Group parentGroup = parent; while (parentGroup != null) { if (parentGroup.transform) break; parentGroup = parentGroup.parent; } if (parentGroup != null) worldTransform.preMul(parentGroup.worldTransform); computedTransform.set(worldTransform); return computedTransform; }
/** Returns the transform for this group's coordinate system. */ protected Matrix4 computeTransform () { Affine2 worldTransform = this.worldTransform; float originX = this.originX, originY = this.originY; worldTransform.setToTrnRotScl(x + originX, y + originY, rotation, scaleX, scaleY); if (originX != 0 || originY != 0) worldTransform.translate(-originX, -originY); // Find the first parent that transforms. Group parentGroup = parent; while (parentGroup != null) { if (parentGroup.transform) break; parentGroup = parentGroup.parent; } if (parentGroup != null) worldTransform.preMul(parentGroup.worldTransform); computedTransform.set(worldTransform); return computedTransform; }
afn1.idt().scale(scl).rotate(rot).translate(trn).shear(shear); checkEqual(mat1, afn1); afn1.idt().mul(afn2.setToScaling(scl)).mul(afn2.setToRotation(rot)).mul(afn2.setToTranslation(trn))
/** Postmultiplies this matrix by a translation matrix. * @param trn The translation vector. * @return This matrix for the purpose of chaining. */ public Affine2 translate (Vector2 trn) { return translate(trn.x, trn.y); }
/** Postmultiplies this matrix by a translation matrix. * @param trn The translation vector. * @return This matrix for the purpose of chaining. */ public Affine2 translate (Vector2 trn) { return translate(trn.x, trn.y); }
/** Returns the transform for this group's coordinate system. */ protected Matrix4 computeTransform () { Affine2 worldTransform = this.worldTransform; float originX = this.originX, originY = this.originY; worldTransform.setToTrnRotScl(x + originX, y + originY, rotation, scaleX, scaleY); if (originX != 0 || originY != 0) worldTransform.translate(-originX, -originY); // Find the first parent that transforms. Group parentGroup = parent; while (parentGroup != null) { if (parentGroup.transform) break; parentGroup = parentGroup.parent; } if (parentGroup != null) worldTransform.preMul(parentGroup.worldTransform); computedTransform.set(worldTransform); return computedTransform; }