diff options
author | aap <aap@papnet.eu> | 2020-05-03 15:57:57 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-03 16:09:37 +0200 |
commit | 702da55ec9d0e8e02df25a26390a113e452676e3 (patch) | |
tree | 9c86a1700aa54b929cd1015c9b9aa975a2d75336 /src/control/AutoPilot.cpp | |
parent | Fix pad Y axis (diff) | |
download | re3-702da55ec9d0e8e02df25a26390a113e452676e3.tar re3-702da55ec9d0e8e02df25a26390a113e452676e3.tar.gz re3-702da55ec9d0e8e02df25a26390a113e452676e3.tar.bz2 re3-702da55ec9d0e8e02df25a26390a113e452676e3.tar.lz re3-702da55ec9d0e8e02df25a26390a113e452676e3.tar.xz re3-702da55ec9d0e8e02df25a26390a113e452676e3.tar.zst re3-702da55ec9d0e8e02df25a26390a113e452676e3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/AutoPilot.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/control/AutoPilot.cpp b/src/control/AutoPilot.cpp index 96a1fedf..b1fce95f 100644 --- a/src/control/AutoPilot.cpp +++ b/src/control/AutoPilot.cpp @@ -12,17 +12,17 @@ void CAutoPilot::ModifySpeed(float speed) float positionBetweenNodes = (float)(CTimer::GetTimeInMilliseconds() - m_nTimeEnteredCurve) / m_nTimeToSpendOnCurrentCurve; CCarPathLink* pCurrentLink = &ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo]; CCarPathLink* pNextLink = &ThePaths.m_carPathLinks[m_nNextPathNodeInfo]; - float currentPathLinkForwardX = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].dir.x; - float currentPathLinkForwardY = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].dir.y; - float nextPathLinkForwardX = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].dir.x; - float nextPathLinkForwardY = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].dir.y; + float currentPathLinkForwardX = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].GetDirX(); + float currentPathLinkForwardY = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].GetDirY(); + float nextPathLinkForwardX = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].GetDirX(); + float nextPathLinkForwardY = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].GetDirY(); CVector positionOnCurrentLinkIncludingLane( - pCurrentLink->pos.x + ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardY, - pCurrentLink->pos.y - ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardX, + pCurrentLink->GetX() + ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardY, + pCurrentLink->GetY() - ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardX, 0.0f); CVector positionOnNextLinkIncludingLane( - pNextLink->pos.x + ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardY, - pNextLink->pos.y - ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardX, + pNextLink->GetX() + ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardY, + pNextLink->GetY() - ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardX, 0.0f); m_nTimeToSpendOnCurrentCurve = CCurves::CalcSpeedScaleFactor( &positionOnCurrentLinkIncludingLane, |