2D Rect Collision

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
MacGyver
Posts: 6
Joined: Tue Sep 04, 2007 9:25 pm

2D Rect Collision

Post by MacGyver »

Hello
@ first yes i use the search function but the awnser was like this.
http://irrlicht.sourceforge.net/phpBB2/ ... ctcollided

The problem is, i have one Sprite and i only have to check the collision of this
Sprite with all others.

In the Link is the way to check each Sprite with each other Sprite.
Give it a better way ?

sorry for my bad english.

Greats MacGyver
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Maintain a collection of the 'other' sprites. Check the 'main' sprite for collision against every sprite in that collection. That is O(n).

If it is to slow, then do something to limit the number of items in the 'other' sprite list to test against, or order them so that you don't need to do as many comparisons.

Travis
Post Reply