Picking driving me mad

Everything was working fine until… well until what ? I can’t remember, that’s the worst of it.

Has anybody done anything recently (code streamlining, e.g.) which could have screw up picking ?

It’s really strange… on some portion of my terrain (which consists of one quad) it works well, then at some frontier it jumps to another place and do some strange things…

I’m gonna investigate further but if someone changed something in the algorithm, please put an end to my pain :slight_smile:

I can’t say that I changed PickingLibrary recently, but I’m certainly the last (before you), who changed it. So I guess I’m the suspect. But as far as I tested it, It was working fine.

I commented out this “closestIntersect = f” lines because they weren’t used at all. I also changed the sorting. The PickResult objects were put into a TreeMap (if I remember right) to be sorted. I changed it to be put into a Vector and sorted it once afterwards. This is more efficient, because the objects are only sorted once.

Maybe this helps you to find what is the problem.

btw: It is called “Depth first search” :wink:

Okay Qudus, not your fault (about picking ^^). I traced that bug and it seems that even mouse events are wrong !!! Probably it’s the swing gui system which is modifying the mouse events (it’s registered before my game event code).

[quote="<MagicSpark.org [ BlueSky ]>,post:3,topic:28307"]
Okay Qudus, not your fault (about picking ^^). I traced that bug and it seems that even mouse events are wrong !!! Probably it’s the swing gui system which is modifying the mouse events (it’s registered before my game event code).
[/quote]
Puh, good to know. I just couldn’t see what could be wrong with the PickingLibrary. Well, please let be know, when you’ve discovered this one. I would be interesed in it.