Exemplo n.º 1
0
//Точка входит в квадрат?
bool Check(RectangleShape rect, CircleShape shape){
	Vector2f coordrect = rect.getPosition();
	Vector2f coordshape = shape.getPosition();

	if (coordrect.x <= coordshape.x &&
		coordrect.y <= coordshape.y &&
		coordrect.x + rect.getSize().x >= coordshape.x &&
		coordrect.y + rect.getSize().y >= coordshape.y)
	{
		return true;
	}
	else { return false; }
}
Exemplo n.º 2
0
 float x() const noexcept { return shape.getPosition().x; }
Exemplo n.º 3
0
 float x() { return shape.getPosition().x; }