getPointToPointPath
Definition
-- @/lua/ge/map.lua:2712
local function getPointToPointPath(startPos, targetPos, cutOffDrivability, dirMult, penaltyAboveCutoff, penaltyBelowCutoff, wD, wZ)
-- startPos: path source position
-- targetPos: target position (vec3)
-- cutOffDrivability: penalize roads with drivability <= cutOffDrivability
-- dirMult: amount of penalty to impose to path if it does not respect road legal directions (should be larger than 1 typically >= 10e4).
-- If equal to nil or 1 then it means no penalty.
-- penaltyAboveCutoff: penalty multiplier for roads above the drivability cutoff
-- penaltyBelowCutoff: penalty multiplier for roads below the drivability cutoff
-- wZ: number (typically >= 1). When higher than 1 destination node of optimum path will be biased towards minimizing height difference to targetPos.
-- wD has been depricated (left here for backwards compatibility)
if gp == nil then return {} end
wZ = wZ or 4
local iter = startPosLinks(startPos, wZ)
return gp:getPointToPointPath(startPos, iter, targetPos, cutOffDrivability, dirMult, penaltyAboveCutoff, penaltyBelowCutoff, wZ)
end
Callers
@/lua/common/graphpath.lua
function Graphpath:getPointToPointPath(sourcePos, iter, targetPos, cutOffDrivability, dirMult, penaltyAboveCutoff, penaltyBelowCutoff, wZ)
-- sourcePos: path source position
@/lua/ge/extensions/gameplay/route/raceRoute.lua
profilerPushEvent("RaceRoute - get point to point")
local path = map.getPointToPointPath(from.pos, to.pos, self.cutOffDrivability, self.dirMult, self.penaltyAboveCutoff, self.penaltyBelowCutoff, self.wD, self.wZ)
profilerPopEvent("RaceRoute - get point to point")
@/lua/vehicle/mapmgr.lua
local function getPointToPointPath(startPos, targetPos, cutOffDrivability, dirMult, penaltyAboveCutoff, penaltyBelowCutoff, wZ)
-- startPos: path source position
local iter = startPosLinks(startPos, wZ)
return mapData:getPointToPointPath(startPos, iter, targetPos, cutOffDrivability, dirMult, penaltyAboveCutoff, penaltyBelowCutoff, wZ)
end
@/lua/vehicle/controller/tech/roadsSensor.lua
--local pointAhead = rearAxleMidpoint + (lookAheadDistance * fwd)
--local path = mapmgr.getPointToPointPath(rearAxleMidpoint, pointAhead, nil, 1e-4, nil, nil, nil)
local pFKey, pRKey, pH = getPointAhead(frontAxleMidpointProjGround, fwd, lookAheadDistance)
@/lua/ge/extensions/gameplay/route/route.lua
profilerPushEvent("Route - get point to point")
local path = map.getPointToPointPath(from, to, self.cutOffDrivability, self.dirMult, self.penaltyAboveCutoff, self.penaltyBelowCutoff, self.wD, self.wZ)
profilerPopEvent("Route - get point to point")
@/lua/ge/map.lua
local iter = startPosLinks(startPos, wZ)
return gp:getPointToPointPath(startPos, iter, targetPos, cutOffDrivability, dirMult, penaltyAboveCutoff, penaltyBelowCutoff, wZ)
end