mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-16 10:44:51 +00:00
Initial Commit
This commit is contained in:
1 parent
397135f687
commit
0f32dd8620
82 files changed
+10693
No files matched your search
@@ -0,0 +1,71 @@
|
||||
package codechicken.lib.render;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
public class UV
|
||||
{
|
||||
public double u;
|
||||
public double v;
|
||||
|
||||
public UV()
|
||||
{
|
||||
}
|
||||
|
||||
public UV(double u, double v)
|
||||
{
|
||||
this.u = u;
|
||||
this.v = v;
|
||||
}
|
||||
|
||||
public UV(UV uv)
|
||||
{
|
||||
this(uv.u, uv.v);
|
||||
}
|
||||
|
||||
public UV set(double u, double v)
|
||||
{
|
||||
this.u = u;
|
||||
this.v = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UV set(UV uv)
|
||||
{
|
||||
u = uv.u;
|
||||
v = uv.v;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UV copy()
|
||||
{
|
||||
return new UV(this);
|
||||
}
|
||||
|
||||
public UV add(UV uv)
|
||||
{
|
||||
u+=uv.u;
|
||||
v+=uv.v;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UV mul(double d)
|
||||
{
|
||||
u*=d;
|
||||
v*=d;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
MathContext cont = new MathContext(4, RoundingMode.HALF_UP);
|
||||
return "UV("+new BigDecimal(u, cont)+", "+new BigDecimal(v, cont)+")";
|
||||
}
|
||||
|
||||
public UV apply(IUVTransformation transform)
|
||||
{
|
||||
transform.transform(this);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user