From 5e724e7a3fc4daa89422bcbcfe0850d43fa5ab79 Mon Sep 17 00:00:00 2001 From: smiki Date: Fri, 25 Jul 2025 23:39:53 +0200 Subject: [PATCH] [ADDED] `COORDINATE:GetLandProfile` --- Moose Development/Moose/Core/Point.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index fc77cdeb6..0d3c7f21d 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -837,6 +837,26 @@ do -- COORDINATE return land.getHeight( Vec2 ) end + --- Returns a table of `Vec3` points representing the terrain profile between two points. + -- @param #COORDINATE self + -- @param Destination DCS#Vec3 Ending point of the profile. + -- @return #table DCS#Vec3 table of the profile + function COORDINATE:GetLandProfileVec3(Destination) + return land.profile(self:GetVec3(), Destination) + end + + --- Returns a table of `Vec3` points representing the terrain profile between two points. + -- @param #COORDINATE self + -- @param Destination #COORDINATE Ending coordinate of the profile. + -- @return #table #COORDINATE table of the profile + function COORDINATE:GetLandProfileCoordinates(Destination) + local points = self:GetLandProfileVec3(Destination:GetVec3()) + local coords = {} + for _, point in ipairs(points) do + table.insert(coords, COORDINATE:NewFromVec3(point)) + end + return coords + end --- Set the heading of the coordinate, if applicable. -- @param #COORDINATE self