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.
56 lines
863 B
56 lines
863 B
10 years ago
|
package mightypork.gamecore.util.math.constraints.rect.mutable;
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
import mightypork.gamecore.util.math.constraints.vect.Vect;
|
||
|
import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar;
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
public class RectVar extends RectMutable {
|
||
10 years ago
|
|
||
10 years ago
|
final VectVar pos = Vect.makeVar();
|
||
|
final VectVar size = Vect.makeVar();
|
||
10 years ago
|
|
||
|
|
||
|
/**
|
||
|
* Create at given origin, with given size.
|
||
|
*
|
||
10 years ago
|
* @param x
|
||
|
* @param y
|
||
|
* @param width
|
||
|
* @param height
|
||
10 years ago
|
*/
|
||
10 years ago
|
public RectVar(double x, double y, double width, double height)
|
||
|
{
|
||
10 years ago
|
this.pos.setTo(x, y);
|
||
10 years ago
|
this.size.setTo(width, height);
|
||
10 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
10 years ago
|
public Vect origin()
|
||
10 years ago
|
{
|
||
10 years ago
|
return pos;
|
||
10 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
10 years ago
|
public Vect size()
|
||
10 years ago
|
{
|
||
10 years ago
|
return size;
|
||
10 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
10 years ago
|
public void setOrigin(double x, double y)
|
||
10 years ago
|
{
|
||
10 years ago
|
this.pos.setTo(x, y);
|
||
10 years ago
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
10 years ago
|
public void setSize(double x, double y)
|
||
10 years ago
|
{
|
||
10 years ago
|
this.size.setTo(x, y);
|
||
10 years ago
|
}
|
||
|
}
|