Jack
Messages : 11 Date d'inscription : 2011-10-12
| Subject: SPARK Collision with 2D Object? Mon Oct 17, 2011 10:46 am | |
| Hello, My Problem: I don't understand how to check a Collision between two SPARK Systems and how to check a Collision between an System and an SFML Sprite... I tried many many things and look in the examples, but I dont unterstand it, really... My last try was this: - Code:
-
if( System_1->GetPosition().x + System_1->getAABBMax().x > System_2->GetPosition().x + System_2->getAABBMin().x && System_1->GetPosition().x + System_1->getAABBMax().x < System_2->GetPosition().x + System_2->getAABBMax().x && System_1->GetPosition().y + System_1->getAABBMax().y > System_2->GetPosition().y + System_2->getAABBMin().y && System_1->GetPosition().y + System_1->getAABBMax().y < System_2->GetPosition().y + System_2->getAABBMax().y) { //Collision } But I think this is very wrong... Thanks for all help! | |
|
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: SPARK Collision with 2D Object? Mon Oct 17, 2011 1:46 pm | |
| If your spawning particles in system space and use only translation (no rotation) of systems, your code is ok (there s a little error though... I let you find it) What you need to do is priorly enabling aabb computing for every systems and underlying groups (using enableAABBComputing(true)) | |
|
Jack
Messages : 11 Date d'inscription : 2011-10-12
| Subject: Re: SPARK Collision with 2D Object? Mon Oct 17, 2011 2:00 pm | |
| Thank you very much, this solved my problem. | |
|
Sponsored content
| Subject: Re: SPARK Collision with 2D Object? | |
| |
|