Added AffineTransform.scale(Vector).

This commit is contained in:
sk89q 2014-07-02 02:54:48 -07:00
parent c5bd8704ea
commit 83e141bfb0

View File

@ -280,6 +280,10 @@ public class AffineTransform implements Transform {
return concatenate(new AffineTransform(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0)); return concatenate(new AffineTransform(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0));
} }
public AffineTransform scale(Vector vec) {
return scale(vec.getX(), vec.getY(), vec.getZ());
}
@Override @Override
public Vector apply(Vector vector) { public Vector apply(Vector vector) {
return new Vector( return new Vector(
@ -296,4 +300,9 @@ public class AffineTransform implements Transform {
return new CombinedTransform(this, other); return new CombinedTransform(this, other);
} }
} }
@Override
public String toString() {
return String.format("Affine[%g %g %g %g, %g %g %g %g, %g %g %g %g]}", m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23);
}
} }