Commit 4eac07c4 authored by ronan's avatar ronan
Browse files

Add setLength sRectangel

parent 929b0067
Pipeline #2260 passed with stage
in 58 seconds
......@@ -106,6 +106,33 @@ public class sRectangle extends Form
points.get(2).set(+ 0.5f*length.x, + 0.5f*length.y);
points.get(3).set(+ 0.5f*length.x, - 0.5f*length.y);
}
/**
* @param width rec size
* @param height rec size
*/
public void setLength(float width, float height)
{
this.length.set(width, height);
points.get(0).set(- 0.5f*length.x,- 0.5f*length.y);
points.get(1).set(- 0.5f*length.x,+ 0.5f*length.y);
points.get(2).set(+ 0.5f*length.x,+ 0.5f*length.y);
points.get(3).set(+ 0.5f*length.x,- 0.5f*length.y);
}
/**
* @param length rec size
*/
public void setLength(Vector2D length)
{
this.length.set(length);
points.get(0).set(- 0.5f*length.x,- 0.5f*length.y);
points.get(1).set(- 0.5f*length.x,+ 0.5f*length.y);
points.get(2).set(+ 0.5f*length.x,+ 0.5f*length.y);
points.get(3).set(+ 0.5f*length.x,- 0.5f*length.y);
}
public void setLeft(Vector2D left, Vector2D length)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment