Removed ray vectors, updated speed convert, removed thread creation for ray traces

This commit is contained in:
Dan
2019-11-07 19:39:31 +00:00
parent 294c82cc73
commit 14e8ef06dd

View File

@@ -78,14 +78,11 @@ RADAR.rayTraces = {
{ startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 } }, { startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 } },
{ startVec = { x = -5.0, y = 15.0 }, endVec = { x = -5.0, y = 150.0 } }, { startVec = { x = -5.0, y = 15.0 }, endVec = { x = -5.0, y = 150.0 } },
{ startVec = { x = 5.0, y = 15.0 }, endVec = { x = 5.0, y = 150.0 } } { startVec = { x = 5.0, y = 15.0 }, endVec = { x = 5.0, y = 150.0 } }
--{ startVec = { x = -12.0, y = 25.0 }, endVec = { x = -12.0, y = 150.0 } },
--{ startVec = { x = 12.0, y = 25.0 }, endVec = { x = 12.0, y = 150.0 } }
} }
RADAR.sorting = { RADAR.sorting = {
[1] = { name = "CLOSEST", func = function( a, b ) return a.dist < b.dist end }, [1] = { name = "CLOSEST", func = function( a, b ) return a.dist < b.dist end },
[2] = { name = "FASTEST", func = function( a, b ) return a.speed > b.speed end }, [2] = { name = "FASTEST", func = function( a, b ) return a.speed > b.speed end },
--[3] = { name = "FASTEST & CLOSEST", func = function( a, b ) return math.ceil( a.speed ) > math.ceil( b.speed ) and a.dist < b.dist end },
[3] = { name = "LARGEST", func = function( a, b ) return a.size > b.size end } [3] = { name = "LARGEST", func = function( a, b ) return a.size > b.size end }
} }
@@ -163,10 +160,9 @@ end
------------------------------------------------------------------------]]-- ------------------------------------------------------------------------]]--
function RADAR:GetVehSpeedFormatted( speed ) function RADAR:GetVehSpeedFormatted( speed )
if ( self.vars.speedType == "mph" ) then if ( self.vars.speedType == "mph" ) then
-- return GetEntitySpeed( veh ) * 2.236936
return math.ceil( speed * 2.236936 ) return math.ceil( speed * 2.236936 )
else else
return GetEntitySpeed( veh ) * 3.6 return math.ceil( speed * 3.6 )
end end
end end
@@ -331,7 +327,6 @@ function RADAR:GetVehsHitByRay( ownVeh, vehs, s, e )
end end
function RADAR:CreateRayThread( vehs, from, startX, endX, endY ) function RADAR:CreateRayThread( vehs, from, startX, endX, endY )
--Citizen.CreateThread( function()
local startP = GetOffsetFromEntityInWorldCoords( from, startX, 0.0, 0.0 ) local startP = GetOffsetFromEntityInWorldCoords( from, startX, 0.0, 0.0 )
local endP = GetOffsetFromEntityInWorldCoords( from, endX, endY, 0.0 ) local endP = GetOffsetFromEntityInWorldCoords( from, endX, endY, 0.0 )
@@ -343,7 +338,6 @@ function RADAR:CreateRayThread( vehs, from, startX, endX, endY )
print( "Ray thread: increasing ray state from " .. tostring( self:GetRayTraceState() ) .. " to " .. tostring( self:GetRayTraceState() + 1 ) ) print( "Ray thread: increasing ray state from " .. tostring( self:GetRayTraceState() ) .. " to " .. tostring( self:GetRayTraceState() + 1 ) )
self:IncreaseRayTraceState() self:IncreaseRayTraceState()
--end )
end end
function RADAR:RunControlManager() function RADAR:RunControlManager()