diff options
author | aap <aap@papnet.eu> | 2019-07-10 17:18:26 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-10 17:18:26 +0200 |
commit | 4a36d64f15f898854bb8a76be86ac9a8c536b291 (patch) | |
tree | 2ff1344fb2f1e9859ba15cd56c461d40683359f9 /src/control | |
parent | Merge pull request #128 from erorcun/erorcun (diff) | |
download | re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.gz re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.bz2 re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.lz re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.xz re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.zst re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/PathFind.cpp | 14 | ||||
-rw-r--r-- | src/control/Replay.cpp | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp index f9ce7f35..a92882db 100644 --- a/src/control/PathFind.cpp +++ b/src/control/PathFind.cpp @@ -146,8 +146,8 @@ CPathFind::PreparePathData(void) numExtern++; if(InfoForTileCars[k].numLeftLanes + InfoForTileCars[k].numRightLanes > numLanes) numLanes = InfoForTileCars[k].numLeftLanes + InfoForTileCars[k].numRightLanes; - maxX = max(maxX, fabs(InfoForTileCars[k].x)); - maxY = max(maxY, fabs(InfoForTileCars[k].y)); + maxX = max(maxX, Abs(InfoForTileCars[k].x)); + maxY = max(maxY, Abs(InfoForTileCars[k].y)); }else if(InfoForTileCars[k].type == NodeTypeIntern) numIntern++; } @@ -327,10 +327,10 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor if(tempnodes[k].linkState != 1) continue; dx = tempnodes[k].pos.x - CoorsXFormed.x; - if(fabs(dx) < nearestDist){ + if(Abs(dx) < nearestDist){ dy = tempnodes[k].pos.y - CoorsXFormed.y; - if(fabs(dy) < nearestDist){ - nearestDist = max(fabs(dx), fabs(dy)); + if(Abs(dy) < nearestDist){ + nearestDist = max(Abs(dx), Abs(dy)); nearestId = k; } } @@ -369,7 +369,7 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor dx = m_pathNodes[tempnodes[nearestId].link1].pos.x - m_pathNodes[tempnodes[nearestId].link2].pos.x; dy = m_pathNodes[tempnodes[nearestId].link1].pos.y - m_pathNodes[tempnodes[nearestId].link2].pos.y; tempnodes[nearestId].pos = (tempnodes[nearestId].pos + CoorsXFormed)*0.5f; - mag = sqrt(dx*dx + dy*dy); + mag = Sqrt(dx*dx + dy*dy); tempnodes[nearestId].dirX = dx/mag; tempnodes[nearestId].dirY = dy/mag; // do something when number of lanes doesn't agree @@ -464,7 +464,7 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor posy = (m_pathNodes[i].pos.y + m_pathNodes[j].pos.y)*0.5f; dx = m_pathNodes[j].pos.x - m_pathNodes[i].pos.x; dy = m_pathNodes[j].pos.y - m_pathNodes[i].pos.y; - mag = sqrt(dx*dx + dy*dy); + mag = Sqrt(dx*dx + dy*dy); dx /= mag; dy /= mag; if(i < j){ diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 2bdb9dfe..3ce9085f 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -1505,9 +1505,9 @@ void CReplay::ProcessLookAroundCam(void) else fAlphaAngleLookAroundCam = max(0.1f, min(1.5f, fAlphaAngleLookAroundCam + y_moved)); CVector camera_pt( - fDistanceLookAroundCam * sin(fBetaAngleLookAroundCam) * cos(fAlphaAngleLookAroundCam), - fDistanceLookAroundCam * cos(fBetaAngleLookAroundCam) * cos(fAlphaAngleLookAroundCam), - fDistanceLookAroundCam * sin(fAlphaAngleLookAroundCam) + fDistanceLookAroundCam * Sin(fBetaAngleLookAroundCam) * Cos(fAlphaAngleLookAroundCam), + fDistanceLookAroundCam * Cos(fBetaAngleLookAroundCam) * Cos(fAlphaAngleLookAroundCam), + fDistanceLookAroundCam * Sin(fAlphaAngleLookAroundCam) ); CVector focus = CVector(CameraFocusX, CameraFocusY, CameraFocusZ); camera_pt += focus; |