mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 02:17:05 +00:00
FULLPIPE: Clarified MovGraph::calcDistance() implementation
This commit is contained in:
parent
6f8075833f
commit
27d29090d8
@ -1289,11 +1289,11 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int fuzz
|
||||
int n2x = link->_graphDst->_x;
|
||||
int n2y = link->_graphDst->_y;
|
||||
double dist1x = (double)(point->x - n1x);
|
||||
double dist1y = (double)(n1y - point->y);
|
||||
double dist1y = (double)(point->y - n1y);
|
||||
double dist2x = (double)(n2x - n1x);
|
||||
double dist2y = (double)(n2y - n1y);
|
||||
double dist1 = sqrt(dist1y * dist1y + dist1x * dist1x);
|
||||
double dist2 = ((double)(n1y - n2y) * dist1y + dist2x * dist1x) / link->_length / dist1;
|
||||
double dist1 = sqrt(dist1x * dist1x + dist1y * dist1y);
|
||||
double dist2 = (dist2y * dist1y + dist2x * dist1x) / link->_length / dist1;
|
||||
double distm = dist2 * dist1;
|
||||
double res = sqrt(1.0 - dist2 * dist2) * dist1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user