Author Topic: Priorities for collisions  (Read 1635 times)

Offline smither

  • byte
  • *
  • Posts: 13
    • View Profile
Priorities for collisions
« on: September 22, 2010, 05:03:41 pm »
I want to know if the collisions are calculated using a priority, or depends on the order of how the elements were added, set or whatever.

Maybe it's my fault and is not the engine, I have 1 Object (source) and 2 Objects (targets), everything is set properly and works as expected most of the time, but sometimes when the source will collied with both objects the engine always choose the same no matter if the non chosen is the closer one.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Priorities for collisions
« Reply #1 on: September 22, 2010, 06:54:08 pm »
That depends on the kind of collision detection. Which one are you using...ray, sphere or ellipsoid?

Offline smither

  • byte
  • *
  • Posts: 13
    • View Profile
Re: Priorities for collisions
« Reply #2 on: September 22, 2010, 06:57:54 pm »
I'm using the checkForCollisionEllipsoid method

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Priorities for collisions
« Reply #3 on: September 22, 2010, 09:09:31 pm »
Ok...then please elaborate a bit more on the actual problem. What does 'choose' mean in that context and why is order a problem. How do you define 'closer'? Actually, ellipsoid collision setwction is a swept collision detection, i.e. the first obstacle will the hit first, then the next and so on...

Offline smither

  • byte
  • *
  • Posts: 13
    • View Profile
Re: Priorities for collisions
« Reply #4 on: September 22, 2010, 09:21:13 pm »
With "closer" you catch me ;D.

Actually is my fault, I've forgotten the CollisionEvent return a list of Targets and I was checking just the first one of the list! Sorry
« Last Edit: September 22, 2010, 09:31:45 pm by smither »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Priorities for collisions
« Reply #5 on: September 22, 2010, 09:27:22 pm »
No problem. Glad you solved it.