Does irrlicht support selection by 2d-box somehow? I'm making a very simple space rts and want support the usual kind of "drag out a box and all units in the box get selected".
Otherwise, what's the simplest way of doing this? I'm making a 3d-game, very simple stripped down homeworld-ish rts.
Unit selection box
-
freetimecoder
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
If you have a 2d box you should have the 2d screen coordinates of the corners. Then you can get the unit's screen coordinates by using scenemanger->getSceneCollisionManager()->getScreenCoordinatesFrom3DPosition(unitposition) Then you can compare the 2d position with the selection box.
Don't know if this is the easiest/fastest way, but it worked for me.
greetings
Don't know if this is the easiest/fastest way, but it worked for me.
greetings