Naali: Box selection

This week I have implemented FrustumQuery in the renderer code of Naali. With this code it is now possible to use a selection box to determine the area from which we want entities to be selected.

In the objectedit Python module there used to be some code to draw a selection box using a Qt widget. Unfortunately it stopped working, or at least, it didn’t show anymore. After some research it looks like a combination of UiExternalModule and World Build Tools made it very hard to get this to show.

Instead of complicating the already complex code for these two modules I decided to add the visualization in the simplest possible way: using Ogre3D itself through a new Entity Component: EC_SelectionBox. Through this EC an Ogre::ManualObject is driven using three simple calls. Show(), Hide() and SetBoundingBox(QRect &view). The ManualObject is drawn in overlay. This results in nice performing selection box.

Leave a Comment