1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
if(l1.x * l1.x + l1.y * l1.y < m_radius * m_radius)
{
sf::Vector2f i = Intersect(pt1,pt2,sf::Vector2f (0,0),l1);
if (pt1 != i && pt2 != i)
if((pt1.x >= i.x && pt2.x <= i.x) || (pt1.x <= i.x && pt2.x >= i.x))
if((pt1.y >= i.y && pt2.y <= i.y) || (pt1.y <= i.y && pt2.y >= i.y))
if((l1.y >= 0 && i.y >= 0) || (l1.y <= 0 && i.y <= 0))
if((l1.x >= 0 && i.x >= 0) || (l1.x <= 0 && i.x <= 0))
AddTriangle(i, pt2, w, m_wall), pt2 = i;
}
if(l2.x * l2.x + l2.y * l2.y < m_radius * m_radius)
{
sf::Vector2f i = Intersect(pt1,pt2,sf::Vector2f (0,0),l2);
if (pt1 != i && pt2 != i)
if((pt1.x > i.x && pt2.x <= i.x) || (pt1.x <= i.x && pt2.x >= i.x))
if((pt1.y > i.y && pt2.y <= i.y) || (pt1.y <= i.y && pt2.y >= i.y))
if((l2.y >= 0 && i.y >= 0) || (l2.y <= 0 && i.y <= 0))
if((l2.x >= 0 && i.x >= 0) || (l2.x <= 0 && i.x <= 0))
AddTriangle(pt1, i, w, m_wall), pt1 = i;
} |
Partager