Ticket #497 (closed task: fixed)
Make square unit outlines match the ground better
| Reported by: | Philip | Owned by: | evans |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | |
| Component: | UI & Simulation | Keywords: | simple review |
| Cc: |
Description
See ConstructSquareOnGround in simulation2/helpers/Render.cpp (used to render the outlines of selected units). Currently it constructs a 4-point square, and moves each point vertically to match the terrain. That looks a bit rubbish if a unit with a large square outline is on bumpy land.
The straight edges ought to be split into smaller segments, each of which is fitted to the terrain, so that the whole shape fits better. Rather than a fixed number of segments, I guess they should be split so each segment is slightly smaller than a tile (4 units), or whatever looks reasonable without wasting lots of vertexes.
Attachments
Change History
comment:1 Changed 3 years ago by moo
- Owner changed from Philip to moo
- Status changed from new to assigned
comment:2 Changed 3 years ago by evans
- Owner changed from moo to evans
- Status changed from assigned to new
comment:4 Changed 3 years ago by Philip
- Keywords review removed
In SplitLine, if length < 4 then pieces == 0 and it'll do a divide-by-zero and get infinities, which is a bit ugly. Could you change it to skip those divisions if pieces == 0?
Also, if pieces == 0 then pieces - 1 == 4294967295 (unsigned) and the loop will try to add four billion points, which is not good. (To test it, try selecting the siege weapons in the techdemo1 map).
Also, each SplitLine adds both the start and end points, so the points at the corners will be duplicated - it should only add the corners once.
I think it should be okay after those fixes.
comment:5 Changed 3 years ago by evans
- Keywords review added
I've fixed the code as mentioned. It should be okay now, I hope. The selection box renders correctly for siege units.
