Mercurial > mm7
changeset 793:290afbd48b6b
IndoorLocation::GetSector fixed (even better!)
author | Nomad |
---|---|
date | Mon, 25 Mar 2013 09:17:42 +0200 |
parents | 41b4e9769863 |
children | 4a00901e063c 319b35320760 |
files | Indoor.cpp |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Indoor.cpp Mon Mar 25 07:32:38 2013 +0200 +++ b/Indoor.cpp Mon Mar 25 09:17:42 2013 +0200 @@ -3196,7 +3196,7 @@ v54 = 0; v50 = pVertices[pFace->pVertexIDs[0]].y >= sY; - for (uint k = 1; k < pFace->uNumVertices; k++) + for (uint k = 1; k <= pFace->uNumVertices; k++) { v59 = v50; @@ -3206,7 +3206,7 @@ auto v2 = &pVertices[pFace->pVertexIDs[k]]; v50 = v2->y >= sY; - if ( v59 == v50 ) + if (v59 == v50) continue; auto v1 = &pVertices[pFace->pVertexIDs[k - 1]]; @@ -3232,8 +3232,8 @@ //_a58 = v33 / (v1->y - v2->y); //_a59 = fixpoint_mul(_a58, sY - v2->y); auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y); - auto rval = fixpoint_mul(x_div_y, sY - v2->y); // a / b * c - looks like projection - if (rval + v2->x > sX) + auto res = fixpoint_mul(x_div_y, sY - v2->y); // a / b * c - looks like projection + if (res + v2->x > sX) ++v54; } else