Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 SPARK Collision with 2D Object?

Go down 
2 posters
AuthorMessage
Jack




Messages : 11
Date d'inscription : 2011-10-12

SPARK Collision with 2D Object? Empty
PostSubject: SPARK Collision with 2D Object?   SPARK Collision with 2D Object? Icon_minitimeMon 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!
Back to top Go down
Juff
Developer



Messages : 539
Date d'inscription : 2009-07-14
Age : 42

SPARK Collision with 2D Object? Empty
PostSubject: Re: SPARK Collision with 2D Object?   SPARK Collision with 2D Object? Icon_minitimeMon 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))
Back to top Go down
http://spark.developpez.com
Jack




Messages : 11
Date d'inscription : 2011-10-12

SPARK Collision with 2D Object? Empty
PostSubject: Re: SPARK Collision with 2D Object?   SPARK Collision with 2D Object? Icon_minitimeMon Oct 17, 2011 2:00 pm

Thank you very much, this solved my problem. flower
Back to top Go down
Sponsored content





SPARK Collision with 2D Object? Empty
PostSubject: Re: SPARK Collision with 2D Object?   SPARK Collision with 2D Object? Icon_minitime

Back to top Go down
 
SPARK Collision with 2D Object?
Back to top 
Page 1 of 1
 Similar topics
-
» Using SPARK with SFML
» Démo collision particules vs particules
» SPARK and C++
» OpenSceneGraph (OSG) and Spark
» Spark opengl 64 bit

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Questions (en)-
Jump to: