SFML community forums

Help => Graphics => Topic started by: lohr on June 25, 2008, 11:32:30 am

Title: Intersection
Post by: lohr on June 25, 2008, 11:32:30 am
Hello,

I am want to program a little racer game, so i have to check for the border of my race circuit.
Now I was wondering about, that the Sprite class has no function "intersects" but rectangle has it?

How could I solve my problem best, because my car sure has to move :) Could i use a Rect instead of Sprite or are there other possibilities?

Best regards,
Alex "lohr"
Title: Intersection
Post by: Regen on June 25, 2008, 11:42:28 am
Was'nt there a new function in 1.3?
IsPointInside, play around whith that one?
Title: Intersection
Post by: lohr on June 25, 2008, 12:01:29 pm
Hm i cant find this function...in which class is it?

EDIT:
I will do it now with an invisible Rect Object and the contains() method.
If you have better solutions, let me know ;)
Title: Intersection
Post by: Laurent on June 25, 2008, 12:17:07 pm
It's still in the roadmap, which means it hasn't been implemented in version 1.3.

However you can do it quite easily. The only tricky part is if you need to apply any rotation.
Title: Intersection
Post by: lohr on June 26, 2008, 07:35:44 am
Hm ive done it now with the contains-method from rect :) and i calculate the 3 other edges every time...