Skip to content

Commit 12ff044

Browse files
author
Peter Vaiko
committed
wip
1 parent d7060f2 commit 12ff044

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

scripts/ai/turns/TurnManeuver.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,13 @@ function LoopTurnManeuver:init(vehicle, turnContext, vehicleDirectionNode, turni
466466
self.debugPrefix = '(LoopTurn): '
467467
TurnManeuver.init(self, vehicle, turnContext, vehicleDirectionNode, turningRadius,
468468
workWidth, steeringLength)
469-
self:debug('r=%.1f, w=%.1f, steeringLength=%.1f', turningRadius, workWidth, steeringLength)
470-
local turnEndNode, endZOffset = self.turnContext:getTurnEndNodeAndOffsets(0)
469+
local turnEndNode, endZOffset = self.turnContext:getTurnEndNodeAndOffsets(steeringLength)
470+
self:debug('r=%.1f, w=%.1f, steeringLength=%.1f, endZOffset=%.1f', turningRadius, workWidth, steeringLength, endZOffset)
471+
local pullForward = 0.5 * workWidth
472+
self.course = Course.createFromNode(self.vehicle, vehicleDirectionNode,
473+
0, 0, pullForward, 1, false)
471474
local path = PathfinderUtil.findAnalyticPath(PathfinderUtil.dubinsSolver,
472-
vehicleDirectionNode, 0, 0, turnEndNode, 0, endZOffset, 5)
473-
self.course = Course.createFromNode(self.vehicle, self.vehicle:getAIDirectionNode(),
474-
0, 0, workWidth / 2, 1, false)
475+
vehicleDirectionNode, 0, pullForward + 0.5, turnEndNode, 0, -steeringLength, turningRadius)
475476
self.course:append(Course.createFromAnalyticPath(self.vehicle, path, true))
476477
local endingTurnLength = self.turnContext:appendEndingTurnCourse(self.course, steeringLength)
477478
self:applyTightTurnOffset(endingTurnLength)

0 commit comments

Comments
 (0)