@Test public void testContains() { Box2D box=new Box2D(new Vector2(0,0),new Vector2(10,10)); assertFalse(box.contains(new Vector2(-5,-5))); assertTrue(box.contains(new Vector2(5,5))); assertTrue(box.contains(new Vector2(0,10))); assertFalse(box.contains(new Vector2(20,20))); }
public boolean contains(Vector2 position) { return this.valid() && (position.getX() >= this.getMin().getX() && position.getX() <= this.getMax().getX() && position.getY() >= this.getMin().getY() && position.getY() <= this.getMax() .getY()); }
Box2D implements IsSerializable { public boolean contains(Vector2 position) { return this.valid() && (position.getX() >= this.getMin().getX() && position.getX() <= this.getMax().getX() && position.getY() >= this.getMin().getY() && position.getY() <= this.getMax() .getY()); } }
Box2D implements IsSerializable { public boolean contains(Vector2 position) { return this.valid() && (position.getX() >= this.getMin().getX() && position.getX() <= this.getMax().getX() && position.getY() >= this.getMin().getY() && position.getY() <= this.getMax() .getY()); } Box2D();  Box2D(Vector2 min, Vector2 max); }
Box2D implements IsSerializable { public boolean contains(Vector2 position) { return this.valid() && (position.getX() >= this.getMin().getX() && position.getX() <= this.getMax().getX() && position.getY() >= this.getMin().getY() && position.getY() <= this.getMax() .getY()); } Box2D();  Box2D(Vector2 min, Vector2 max); Box2D clone(); Boolean valid(); Vector2 getMin(); void setMin(Vector2 min); Vector2 getMax(); void setMax(Vector2 max); void expandBy(Vector2 v); void expandBy(Box2D bb); void expandBy(double d); boolean intersects(Box2D bb); boolean contains(Vector2 position); Vector2 getCenter(); double getWidth(); double getHeight(); String toString(); static Box2D createBox(Vector2 v0, Vector2 v1); String toJSON(); }
Box2D implements IsSerializable { public boolean contains(Vector2 position) { return this.valid() && (position.getX() >= this.getMin().getX() && position.getX() <= this.getMax().getX() && position.getY() >= this.getMin().getY() && position.getY() <= this.getMax() .getY()); } Box2D();  Box2D(Vector2 min, Vector2 max); Box2D clone(); Boolean valid(); Vector2 getMin(); void setMin(Vector2 min); Vector2 getMax(); void setMax(Vector2 max); void expandBy(Vector2 v); void expandBy(Box2D bb); void expandBy(double d); boolean intersects(Box2D bb); boolean contains(Vector2 position); Vector2 getCenter(); double getWidth(); double getHeight(); String toString(); static Box2D createBox(Vector2 v0, Vector2 v1); String toJSON();  }