This commit is contained in:
Frank
2020-05-22 11:21:09 +02:00
parent 3c7a90e2a2
commit 5223a4beba
3 changed files with 26 additions and 13 deletions
+23
View File
@@ -2726,6 +2726,29 @@ function AUFTRAG:GetMissionTypesText(MissionTypes)
return text
end
--- Get coordinate of target. First unit/group of the set is used.
-- @param #AUFTRAG self
-- @param Wrapper.Group#GROUP group Group.
-- @return Core.Point#COORDINATE Coordinate where the mission is executed.
function AUFTRAG:GetMissionWaypointCoord(group)
-- Create waypoint coordinate half way between us and the target.
local waypointcoord=group:GetCoordinate():GetIntermediateCoordinate(self:GetTargetCoordinate(), self.missionFraction)
local alt=waypointcoord.y
-- Add some randomization.
waypointcoord=ZONE_RADIUS:New("Temp", waypointcoord:GetVec2(), 1000):GetRandomCoordinate():SetAltitude(alt, false)
-- Set altitude of mission waypoint.
if self.missionAltitude then
waypointcoord:SetAltitude(self.missionAltitude, true)
end
env.info(string.format("FF mission alt=%d meters", waypointcoord.y))
return waypointcoord
end
--- Set log ID string.
-- @param #AUFTRAG self
-- @return #AUFTRAG self
+1 -1
View File
@@ -371,7 +371,7 @@ function NAVYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Depth)
-- Set speed.
wp.speed=UTILS.KmphToMps(speed)
wp.alt=-depth
wp.alt=-depth --Depth and -Depth or wp.alt
-- Add waypoint.
table.insert(waypoints, wp)
+2 -12
View File
@@ -1630,18 +1630,8 @@ function OPSGROUP:RouteToMission(mission, delay)
-- Next waypoint.
local nextwaypoint=self.currentwp+1
-- Create waypoint coordinate half way between us and the target.
local waypointcoord=self.group:GetCoordinate():GetIntermediateCoordinate(mission:GetTargetCoordinate(), mission.missionFraction)
local alt=waypointcoord.y
-- Add some randomization.
waypointcoord=ZONE_RADIUS:New("Temp", waypointcoord:GetVec2(), 1000):GetRandomCoordinate():SetAltitude(alt, false)
-- Set altitude of mission waypoint.
if mission.missionAltitude then
waypointcoord:SetAltitude(mission.missionAltitude, true)
end
env.info(string.format("FF mission alt=%d meters", waypointcoord.y))
-- Get coordinate where the mission is executed.
local waypointcoord=mission:GetMissionWaypointCoord(self.group)
-- Add enroute tasks.
for _,task in pairs(mission.enrouteTasks) do