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.
69 lines
885 B
69 lines
885 B
11 years ago
|
package mightypork.utils.math.vect;
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
public abstract class VectAdapter extends VectView {
|
||
11 years ago
|
|
||
|
/**
|
||
|
* @return the proxied coord
|
||
|
*/
|
||
11 years ago
|
protected abstract Vect getSource();
|
||
|
|
||
11 years ago
|
|
||
|
@Override
|
||
|
public double x()
|
||
|
{
|
||
|
return processX(getSource().x());
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double y()
|
||
|
{
|
||
|
return processY(getSource().y());
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public double z()
|
||
|
{
|
||
|
return processZ(getSource().z());
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Process X before it's returned by x()
|
||
|
*
|
||
|
* @param x original X
|
||
|
* @return output X
|
||
|
*/
|
||
|
protected double processX(double x)
|
||
|
{
|
||
|
return x;
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Process Y before it's returned by y()
|
||
|
*
|
||
|
* @param y original Y
|
||
|
* @return output Y
|
||
|
*/
|
||
|
protected double processY(double y)
|
||
|
{
|
||
|
return y;
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Process Z before it's returned by z()
|
||
|
*
|
||
|
* @param z original Z
|
||
|
* @return output Z
|
||
|
*/
|
||
|
protected double processZ(double z)
|
||
|
{
|
||
|
return z;
|
||
|
}
|
||
|
|
||
|
}
|