mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-15 17:44:42 +00:00
Initial 1.7 commit
This commit is contained in:
1 parent
34154fc011
commit
ca675b5f31
72 files changed
+2967
-3335
No files matched your search
@@ -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) + ")";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user