Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpRallyPointRenderer.cpp
Show First 20 Lines • Show All 680 Lines • ▼ Show 20 Lines | void CCmpRallyPointRenderer::RecomputeRallyPointPath(size_t index, CmpPtr<ICmpPosition>& cmpPosition, CmpPtr<ICmpFootprint>& cmpFootprint, CmpPtr<ICmpPathfinder> cmpPathfinder) | ||||
if (index == 0) | if (index == 0) | ||||
GetClosestsEdgePointFrom(start,m_RallyPoints[index], cmpPosition, cmpFootprint); | GetClosestsEdgePointFrom(start,m_RallyPoints[index], cmpPosition, cmpFootprint); | ||||
else | else | ||||
{ | { | ||||
start.X = m_RallyPoints[index-1].X; | start.X = m_RallyPoints[index-1].X; | ||||
start.Y = m_RallyPoints[index-1].Y; | start.Y = m_RallyPoints[index-1].Y; | ||||
} | } | ||||
cmpPathfinder->ComputePath(start.X, start.Y, goal, cmpPathfinder->GetPassabilityClass(m_LinePassabilityClass), path); | cmpPathfinder->ComputePathImmediate(start.X, start.Y, goal, cmpPathfinder->GetPassabilityClass(m_LinePassabilityClass), path); | ||||
// Check if we got a path back; if not we probably have two markers less than one tile apart. | // Check if we got a path back; if not we probably have two markers less than one tile apart. | ||||
if (path.m_Waypoints.size() < 2) | if (path.m_Waypoints.size() < 2) | ||||
{ | { | ||||
m_Path[index].emplace_back(start.X.ToFloat(), start.Y.ToFloat()); | m_Path[index].emplace_back(start.X.ToFloat(), start.Y.ToFloat()); | ||||
m_Path[index].emplace_back(m_RallyPoints[index].X.ToFloat(), m_RallyPoints[index].Y.ToFloat()); | m_Path[index].emplace_back(m_RallyPoints[index].X.ToFloat(), m_RallyPoints[index].Y.ToFloat()); | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 629 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator