Collection of useful utilities for Java games and apps. A lot of interesting utilities that could maybe still find some use if you work with Java...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mightyutils/src/mightypork/utils/math/constraints/vect/proxy/VectNumAdapter.java

55 lines
903 B

package mightypork.utils.math.constraints.vect.proxy;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.num.NumBound;
import mightypork.utils.math.constraints.vect.Vect;
/**
* Coord view composed of given {@link NumBound}s, using their current values.
*
* @author Ondřej Hruška (MightyPork)
*/
public class VectNumAdapter extends Vect {
private final Num constrX;
private final Num constrY;
private final Num constrZ;
public VectNumAdapter(Num x, Num y, Num z) {
this.constrX = x;
this.constrY = y;
this.constrZ = z;
}
public VectNumAdapter(Num x, Num y) {
this.constrX = x;
this.constrY = y;
this.constrZ = Num.ZERO;
}
@Override
public double x()
{
return constrX.value();
}
@Override
public double y()
{
return constrY.value();
}
@Override
public double z()
{
return constrZ.value();
}
}