1
0
forked from 0ad/0ad
0ad/source/gui
Yves 8e30410109 Improve PickEntitiesAtPoint
First, do a ray intersection test with the bounding-sphere for all
entities on the map and then check the more detailed selection shape for
the remaining candidates. Do checks that require component lookups after
the ray intersection tests because these are relatively expensive.
The old method for figuring out which entities are below the mouse
cursor was incorrect because it does a 2D check to filter out the first
candidates which can lead to incorrect results with lower camera angles
and high buildings or buildings with a large footprint. Such problems
were avoided with quite a large radius for this 2D test and resulted in
a large number of candiate entities after this first test (200-500).
Also rename PickEntitiesAtPoint to PickEntityAtPoint and make it return
only one (the closest) match.

I've tested performance with the tracelogger by starting a map and then
moving the mouse in circles for one minute. The results were relatively
stable. I've compared the total time percentage of input.js:836, which
spends nearly all of the time in PickEntityAtPoint.
Ardennes Forest - Normal size:       Original: 41.46%    Patched: 31.6%
Ardennes Forest - Giant size:        Original: 40.59%    Patched: 51.55%

As we see, it's faster on normal map sizes but slower on giant maps with
a lot of entities.
This approach can be further improved with some kind of spatial
subdivision for the culling (like an octree), which would help the unit
renderer too. This way it should be possible to make it faster (and
still correct) on all map sizes and with a large total numbers of
entities.

This was SVN commit r16098.
2015-01-01 23:05:26 +00:00
..
scripting Improve PickEntitiesAtPoint 2015-01-01 23:05:26 +00:00
tests Start phasing out the use of CParser in the GUI. Makes GUI parsing generally faster and stricter while adding better tests and debug information. 2014-05-25 03:16:52 +00:00
CButton.cpp Adds UI sounds for buttons, dropdowns, lists, and checkboxes, fixes #948 2013-07-01 04:15:09 +00:00
CButton.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CCheckBox.cpp Cleanup GUI Checkbox C++ code by removing broken, non-obvious internal text rendering. 2014-01-02 03:28:15 +00:00
CCheckBox.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CDropDown.cpp Fixes incorrect input handling in dropdowns and lists, they were manually handling all events, but should only handle certain key presses. Fixes #2885. 2014-10-27 04:37:06 +00:00
CDropDown.h Make water specular more visible and fixes a few cases where it would actually hardly appear when it should. 2013-07-14 12:17:07 +00:00
CGUI.cpp Remove duplicated layers of unescaping which required multiple escapes in some places. 2014-12-13 01:08:29 +00:00
CGUI.h Allow nesting repeat tags in the GUI. 2014-12-10 20:10:02 +00:00
CGUIList.h Add GPL header 2009-04-18 17:00:33 +00:00
CGUIScrollBarVertical.cpp Multiplayer lobby based on the XmPP protocol. Special thanks to Philip, alpha123, scythetwirler, and anyone else who has helped build, debug or test the lobby. 2013-11-07 20:07:24 +00:00
CGUIScrollBarVertical.h Okay, do what f5ab6255d0 was supposed to do. 2013-08-26 04:17:26 +00:00
CGUISprite.cpp Use pointers instead of copying sprites in the GUI. Fixes #1984. Patch by jP_wanN. 2014-01-03 20:19:43 +00:00
CGUISprite.h Use pointers instead of copying sprites in the GUI. Fixes #1984. Patch by jP_wanN. 2014-01-03 20:19:43 +00:00
CImage.cpp Fix tooltip crash/corruption, caused by inconsistently changing types. 2011-02-18 22:36:39 +00:00
CImage.h Add GPL header 2009-04-18 17:00:33 +00:00
CInput.cpp Remove useless parameter from CFG_GET_VALUE. 2014-11-17 23:29:49 +00:00
CInput.h Fixes some bugs related to IME text input in SDL2, including a possible crash, refs #2041. Behavior seems reasonably consistent now on Windows and OS X 2014-10-03 23:33:41 +00:00
CList.cpp Fixes incorrect input handling in dropdowns and lists, they were manually handling all events, but should only handle certain key presses. Fixes #2885. 2014-10-27 04:37:06 +00:00
CList.h Multiplayer lobby based on the XmPP protocol. Special thanks to Philip, alpha123, scythetwirler, and anyone else who has helped build, debug or test the lobby. 2013-11-07 20:07:24 +00:00
COList.cpp Change L10n code to use ps/Singleton, so that we can recreate it. 2014-10-15 16:04:37 +00:00
COList.h Remove commented out code and add licence headers to COList.cpp/.h. 2014-06-05 14:33:44 +00:00
CProgressBar.cpp Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CProgressBar.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CRadioButton.cpp Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CRadioButton.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CText.cpp Multiplayer lobby based on the XmPP protocol. Special thanks to Philip, alpha123, scythetwirler, and anyone else who has helped build, debug or test the lobby. 2013-11-07 20:07:24 +00:00
CText.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
CTooltip.cpp Fix a valgrind warning about uninitilized variables in the scrollbar code and some comment/style fixes. 2014-02-19 21:59:07 +00:00
CTooltip.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
GUI.h # Restructured GUI implementation 2009-12-03 20:17:22 +00:00
GUIbase.cpp Start phasing out the use of CParser in the GUI. Makes GUI parsing generally faster and stricter while adding better tests and debug information. 2014-05-25 03:16:52 +00:00
GUIbase.h Fix bug with rating in lobby bot, remove superfluous GUI typedef, and change the lobby chat autocompletion to use tab. 2014-01-01 00:23:18 +00:00
GUIManager.cpp Give access to the templates to the GUI. This will be useful for eventually displaying factions specificities in main menus. 2014-12-28 16:21:07 +00:00
GUIManager.h Give access to the templates to the GUI. This will be useful for eventually displaying factions specificities in main menus. 2014-12-28 16:21:07 +00:00
GUIRenderer.cpp Change L10n code to use ps/Singleton, so that we can recreate it. 2014-10-15 16:04:37 +00:00
GUIRenderer.h Use pointers instead of copying sprites in the GUI. Fixes #1984. Patch by jP_wanN. 2014-01-03 20:19:43 +00:00
GUItext.cpp Remove duplicated layers of unescaping which required multiple escapes in some places. 2014-12-13 01:08:29 +00:00
GUItext.h Change GUI tag parsing to use a FSM instead of using CParser. Refs #2589. 2014-11-16 02:10:28 +00:00
GUITooltip.cpp Remove duplicated layers of unescaping which required multiple escapes in some places. 2014-12-13 01:08:29 +00:00
GUITooltip.h Game setup changes, including showing name, civ, team, and some options loaded from the scenarios. Civ data added. Civ info window to preview civs. Icon tooltips. Support for random map implementation. Fixes #590. 2010-10-30 04:02:42 +00:00
GUItypes.h Fix #402 (Clean up GUItypes.h), based on patch from Caius 2009-11-19 21:44:19 +00:00
GUIutil.cpp Replace usage of CParser for CColor. 2014-06-04 00:58:05 +00:00
GUIutil.h Replace usage of CParser for CColor. 2014-06-04 00:58:05 +00:00
IGUIButtonBehavior.cpp Make GUI button-based objects to behave more expectedly when doubleclicked, also some style tweaks. 2014-01-01 06:05:41 +00:00
IGUIButtonBehavior.h Added right click selection removal. Fixes #1028. Thanks to kingadami and GerbilOfDoom for the patch. 2013-01-03 22:53:46 +00:00
IGUIObject.cpp Exact stack rooting for IGUIObject. 2014-08-08 13:41:47 +00:00
IGUIObject.h Exact stack rooting for IGUIObject. 2014-08-08 13:41:47 +00:00
IGUIScrollBar.cpp Fix a valgrind warning about uninitilized variables in the scrollbar code and some comment/style fixes. 2014-02-19 21:59:07 +00:00
IGUIScrollBar.h Fix a valgrind warning about uninitilized variables in the scrollbar code and some comment/style fixes. 2014-02-19 21:59:07 +00:00
IGUIScrollBarOwner.cpp Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
IGUIScrollBarOwner.h Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish. 2011-04-28 20:42:11 +00:00
IGUITextOwner.cpp Fixes multiline text alignment, fixes #723. Patch by kingadami. 2013-01-06 01:46:44 +00:00
IGUITextOwner.h Fix "hides overloaded virtual function" warnings in Clang 2011-07-17 17:30:07 +00:00
MiniMap.cpp Remove useless parameter from CFG_GET_VALUE. 2014-11-17 23:29:49 +00:00
MiniMap.h Move the minimap to only use the shader pipeline. Should make it OpenGL ES compatible (untested). 2014-07-14 17:15:22 +00:00