www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: smither on September 22, 2010, 05:03:41 pm

Title: Priorities for collisions
Post by: smither 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.

Title: Re: Priorities for collisions
Post by: EgonOlsen 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?
Title: Re: Priorities for collisions
Post by: smither on September 22, 2010, 06:57:54 pm
I'm using the checkForCollisionEllipsoid method
Title: Re: Priorities for collisions
Post by: EgonOlsen 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...
Title: Re: Priorities for collisions
Post by: smither 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
Title: Re: Priorities for collisions
Post by: EgonOlsen on September 22, 2010, 09:27:22 pm
No problem. Glad you solved it.