HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 SPARK Collision with 2D Object?

View previous topic View next topic Go down 
AuthorMessage
Jack



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

PostSubject: 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!
Back to top Go down
View user profile
Juff
Developer


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

PostSubject: 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))
Back to top Go down
View user profile http://spark.developpez.com
Jack



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

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

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




PostSubject: Re: SPARK Collision with 2D Object?   Today at 3:43 am

Back to top Go down
 
SPARK Collision with 2D Object?
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Issue - Selenium checks object in some cache
» If object present do sumthing else proceed to next selenium step
» How to create/recognize object element not using recording?
» is there object spy option in selenium ID/ Tool
» Page Object Framework Implementation using web driver.

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