GarageGames / Torque2D

MIT Licensed Open Source version of Torque 2D game engine from GarageGames
MIT License
1.67k stars 1.56k forks source link

WorldQuery Now Treats Objects with No Area as Invisible #303

Closed greenfire27 closed 8 years ago

greenfire27 commented 8 years ago

The WorldQuery class is responsible for finding objects in the scene both for things like user requested picking and for handing out mouse events. In the second case, an assertion error was being thrown when an object had zero area (sizeX = 0 or sizeY = 0) and the engine tried to test it for mouse over events. This was pointless of course because a point cannot be inside an object with no area. This change treats objects without an area as invisible so they cannot be picked without picking routine also looking for invisible objects.