ARTY v0.5

- Adjusted schedulers.
- Improved transitions.
- Make rearming unit go back to its original position.
- Added user functions.
- Using only coodinates for target assignments.
- Added dead event handling.
This commit is contained in:
funkyfranky
2018-05-02 00:14:05 +02:00
parent 394b5f5b89
commit 274b44459e
4 changed files with 384 additions and 137 deletions

View File

@@ -471,8 +471,8 @@ do -- COORDINATE
-- @param height (Optional) parameter specifying the height ASL.
-- @return Temperature in Degrees Celsius.
function COORDINATE:GetTemperature(height)
self:F2(height)
local y=height or self.y
env.info("FF height = "..y)
local point={x=self.x, y=height or self.y, z=self.z}
-- get temperature [K] and pressure [Pa] at point
local T,P=atmosphere.getTemperatureAndPressure(point)
@@ -940,13 +940,13 @@ do -- COORDINATE
-- @param #COORDINATE ToCoord Coordinate of destination.
-- @return #table Table of coordinates on road.
function COORDINATE:GetPathOnRoad(ToCoord)
local Path={}
self:F2(ToCoord)
local path = land.findPathOnRoads("roads", self.x, self.z, ToCoord.x, ToCoord.z)
local Path={}
for i, v in ipairs(path) do
--self:E(v)
local coord=COORDINATE:NewFromVec2(v)
Path[#Path+1]=COORDINATE:NewFromVec2(v)
end
self:F(string.format("Number of points in Path on Road = %d", #Path))
return Path
end