Initial 1.7 commit

This commit is contained in:
Chicken-Bomes committed 2014-04-07 14:02:47 +10:00
1 parent 34154fc011
commit ca675b5f31
72 files changed
+2967 -3335

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package codechicken.lib.render.uv;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
public class UVScale extends UVTransformation {
double su;
double sv;
public UVScale(double scaleu, double scalev) {
su = scaleu;
sv = scalev;
}
public UVScale(double d) {
this(d, d);
}
@Override
public void apply(UV uv) {
uv.u *= su;
uv.v *= sv;
}
@Override
public UVTransformation inverse() {
return new UVScale(1 / su, 1 / sv);
}
@Override
public String toString() {
MathContext cont = new MathContext(4, RoundingMode.HALF_UP);
return "UVScale(" + new BigDecimal(su, cont) + ", " + new BigDecimal(sv, cont) + ")";
}
}