Ticket #914 (closed defect: fixed)
[PATCH] Fixed-angle/huge bounding boxes cause unintuitive selection behaviour
|Reported by:||vts||Owned by:||vts|
|Priority:||Must Have||Milestone:||Alpha 8|
|Component:||Core engine||Keywords:||review, patch|
To determine which units are to be highlighted/selected when the mouse is at a certain position, a ray is cast from the camera to the point on the terrain pointed to by the mouse, and this ray is checked for intersections with the bounding boxes of all the Selectable entities in the scene. If multiple objects' bounding boxes are intersected, the one where the ray passes the closest by its center wins.
However, the bounding boxes ignore the rotation of the models. This can cause the visual outline of the object to differ greatly from the bounding boxes used for hit testing, which causes unintuitive selection/highlight behaviour: typically buildings or trees are selected even though the mouse is nowhere near them. Some trees have massive bounding boxes, which does not help.
Also, this prevents the user from setting the a building's rally point at many points in the terrain, because seemingly unrelated objects will be highlighted instead.
The example screenshots below are also attached:
The red outline is the bounding box of the currently highlighted tree. Even though the mouse is halfway up the screen, some random tree is selected all the way down.
Again, the red outline is the bounding box, the blue is the actual floorplan. Any 2D mouse location within the red outlines will cause the building to be highlighted. This makes it impossible to set the rally point near the top of the outline under the metal mine, even though that location would otherwise be perfectly valid.
- Keywords review added
- Owner set to vts
- Summary changed from Fixed-angle/huge bounding boxes cause unintuitive selection behaviour to [PATCH] Fixed-angle/huge bounding boxes cause unintuitive selection behaviour
- Status changed from new to assigned
- Milestone changed from Backlog to Alpha 8
comment:14 Changed 18 months ago by vts
- Status changed from assigned to closed
- Resolution set to fixed