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
897 B
55 lines
897 B
10 years ago
|
package mightypork.utils.math.coord;
|
||
|
|
||
|
|
||
|
import mightypork.utils.math.constraints.NumberConstraint;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Coord view composed of given {@link NumberConstraint}s, using their current
|
||
10 years ago
|
* values.
|
||
10 years ago
|
*
|
||
|
* @author MightyPork
|
||
|
*/
|
||
10 years ago
|
class NumConstrVec extends VecView {
|
||
10 years ago
|
|
||
|
private final NumberConstraint constrX;
|
||
|
private final NumberConstraint constrY;
|
||
|
private final NumberConstraint constrZ;
|
||
|
|
||
|
|
||
10 years ago
|
public NumConstrVec(NumberConstraint x, NumberConstraint y, NumberConstraint z) {
|
||
10 years ago
|
this.constrX = x;
|
||
|
this.constrY = y;
|
||
|
this.constrZ = z;
|
||
|
}
|
||
|
|
||
|
|
||
10 years ago
|
public NumConstrVec(NumberConstraint x, NumberConstraint y) {
|
||
10 years ago
|
this.constrX = x;
|
||
|
this.constrY = y;
|
||
|
this.constrZ = NumberConstraint.ZERO;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double x()
|
||
|
{
|
||
|
return constrX.getValue();
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double y()
|
||
|
{
|
||
|
return constrY.getValue();
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double z()
|
||
|
{
|
||
|
return constrZ.getValue();
|
||
|
}
|
||
|
|
||
|
}
|