mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-11 07:47:47 +00:00
23 lines
567 B
Java
23 lines
567 B
Java
package codechicken.lib.render.uv;
|
|||
|
|
|
||
|
|
import codechicken.lib.vec.IrreversibleTransformationException;
|
||
|
|
import net.minecraft.util.IIcon;
|
||
|
|
|
||
|
|
public class IconTransformation extends UVTransformation {
|
||
|
|
public IIcon icon;
|
||
|
|
|
||
|
|
public IconTransformation(IIcon icon) {
|
||
|
|
this.icon = icon;
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void apply(UV uv) {
|
||
|
|
uv.u = icon.getInterpolatedU(uv.u * 16);
|
||
|
|
uv.v = icon.getInterpolatedV(uv.v * 16);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public UVTransformation inverse() {
|
||
|
|
throw new IrreversibleTransformationException(this);
|
||
|
|
}
|
||
|
|
}
|