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
CButton.cpp
CButton.h
CCheckBox.cpp
CCheckBox.h
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
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
CGUIScrollBarVertical.cpp
CGUIScrollBarVertical.h
CGUISprite.cpp
CGUISprite.h
CImage.cpp
CImage.h
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
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
CProgressBar.h
CRadioButton.cpp
CRadioButton.h
CText.cpp
CText.h
CTooltip.cpp
CTooltip.h
GUI.h
GUIbase.cpp
GUIbase.h
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
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
GUItypes.h
GUIutil.cpp
GUIutil.h
IGUIButtonBehavior.cpp
IGUIButtonBehavior.h
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
IGUIScrollBar.h
IGUIScrollBarOwner.cpp
IGUIScrollBarOwner.h
IGUITextOwner.cpp
IGUITextOwner.h
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