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.
55 lines
792 B
55 lines
792 B
11 years ago
|
package mightypork.utils.math.vect;
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
import mightypork.utils.math.constraints.NumBound;
|
||
11 years ago
|
import mightypork.utils.math.num.Num;
|
||
11 years ago
|
|
||
|
|
||
|
/**
|
||
11 years ago
|
* Coord view composed of given {@link NumBound}s, using their current values.
|
||
11 years ago
|
*
|
||
|
* @author MightyPork
|
||
|
*/
|
||
11 years ago
|
class VectNumAdapter extends Vect {
|
||
11 years ago
|
|
||
11 years ago
|
private final Num constrX;
|
||
|
private final Num constrY;
|
||
|
private final Num constrZ;
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
public VectNumAdapter(Num x, Num y, Num z) {
|
||
11 years ago
|
this.constrX = x;
|
||
|
this.constrY = y;
|
||
|
this.constrZ = z;
|
||
|
}
|
||
|
|
||
|
|
||
11 years ago
|
public VectNumAdapter(Num x, Num y) {
|
||
11 years ago
|
this.constrX = x;
|
||
|
this.constrY = y;
|
||
11 years ago
|
this.constrZ = Num.ZERO;
|
||
11 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double x()
|
||
|
{
|
||
11 years ago
|
return constrX.value();
|
||
11 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double y()
|
||
|
{
|
||
11 years ago
|
return constrY.value();
|
||
11 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double z()
|
||
|
{
|
||
11 years ago
|
return constrZ.value();
|
||
11 years ago
|
}
|
||
|
|
||
|
}
|