id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc
1121,Flat actors cause problems with new selection boxes,historic_bruno,vts,"Some actors like [http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/actors/props/flora/water_lillies.xml props/flora/water_lillies.xml] which are not decals but flat models, can cause selection problems in Atlas. They have a selection box, but the calculation of the box and/or the the algorithm in `RayIntersect` is failing and causing unpredictable behavior. It's especially noticeable on Belgian Bog, due to the high concentration of such lillies in the center. Clicking in a seemingly open area of the map might select a lilly by mistake. Strangely [http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/actors/props/flora/pond_lillies_large.xml props/flora/pond_lillies_large.xml] does not have this problem.

It's easy to test on a blank map. I put a breakpoint in the selection code and found the `CBoundingBoxOriented` data for `water_lillies`:
{{{
m_Center = {X=298.17743 Y=22.402514 Z=378.40604 }
m_HalfSizes = {X=1.8804212 Y=0.00000000 Z=1.8804319 }
m_Basis
   [0] = {X=0.70711076 Y=0.00000000 Z=0.70710266 }
   [1] = {X=-1.#IND000 Y=-1.#IND000 Z=-1.#IND000 }
   [2] = {X=-0.70709860 Y=0.00000000 Z=0.70711488 }
}}}

compared with the data for `pond_lillies_large`:
{{{
m_Center = {X=297.05060 Y=22.391361 Z=382.82440 }
m_HalfSizes = {X=10.045100 Y=9.5367432e-007 Z=9.4280548 }
m_Basis
   [0] = {X=0.70711213 Y=0.00000000 Z=0.70710146 }
   [1] = {X=0.00000000 Y=1.0000000 Z=0.00000000 }
   [2] = {X=-0.70710194 Y=0.00000000 Z=0.70711166 }
}}}

Notice the first example has `-1.#IND000` values in one of its basis vectors, which means ""indeterminate"" value. The height of the bounding box (m_HalfSizes.Y) is exactly 0. The second example has sane values. Maybe we could detect completely flat models and give them a small selection box height or specially handle 2D intersection in 3D space. I guess a similar problem would occur with a vertically-oriented flat model, so the best solution is probably independent of orientation.",defect,closed,Nice to Have,Alpha 11,Core engine,fixed,,vts
