#497 closed task (fixed)
Make square unit outlines match the ground better
Reported by: | Philip Taylor | Owned by: | Evans |
---|---|---|---|
Priority: | Nice to Have | Milestone: | |
Component: | UI & Simulation | Keywords: | simple |
Cc: | Patch: |
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 (2)
Change History (10)
comment:1 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 14 years ago
Attachment: | Render.dif added |
---|
comment:2 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:3 by , 14 years ago
Keywords: | review added |
---|---|
Status: | new → assigned |
comment:4 by , 14 years ago
Keywords: | review removed |
---|
by , 14 years ago
Attachment: | Render.diff added |
---|
comment:5 by , 14 years ago
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.
comment:6 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 by , 8 years ago
Keywords: | review removed |
---|
In
SplitLine
, iflength < 4
thenpieces == 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 ifpieces == 0
?Also, if
pieces == 0
thenpieces - 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.