mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 08:28:57 +01:00
Core/PathFinding: Return raycast hitpoint when specifying straightLine
This commit is contained in:
@@ -374,7 +374,15 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
if (hit != FLT_MAX)
|
||||
{
|
||||
// the ray hit something, return no path instead of the incomplete one
|
||||
_type = PATHFIND_NOPATH;
|
||||
Clear();
|
||||
_polyLength = 2;
|
||||
_pathPoints.resize(2);
|
||||
_pathPoints[0] = GetStartPosition();
|
||||
float hitPos[3];
|
||||
dtVlerp(hitPos, startPoint, endPoint, hit);
|
||||
_pathPoints[1] = G3D::Vector3(hitPos[2], hitPos[0], hitPos[1]);
|
||||
|
||||
_type = PATHFIND_INCOMPLETE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -437,7 +445,15 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
if (hit != FLT_MAX)
|
||||
{
|
||||
// the ray hit something, return no path instead of the incomplete one
|
||||
_type = PATHFIND_NOPATH;
|
||||
Clear();
|
||||
_polyLength = 2;
|
||||
_pathPoints.resize(2);
|
||||
_pathPoints[0] = GetStartPosition();
|
||||
float hitPos[3];
|
||||
dtVlerp(hitPos, startPoint, endPoint, hit);
|
||||
_pathPoints[1] = G3D::Vector3(hitPos[2], hitPos[0], hitPos[1]);
|
||||
|
||||
_type = PATHFIND_INCOMPLETE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user