コード例 #1
0
ファイル: main2.cpp プロジェクト: FirKys/session_2
//Точка входит в квадрат?
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; }
}
コード例 #2
0
ファイル: p4.cpp プロジェクト: OleksanderPasicznyk/Tutorials
 float x() const noexcept { return shape.getPosition().x; }
コード例 #3
0
ファイル: p6.cpp プロジェクト: OleksanderPasicznyk/Tutorials
 float x() { return shape.getPosition().x; }