This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function math.clamp(value, minClamp, maxClamp) | |
return math.min(maxClamp, math.max(value, minClamp)) | |
end | |
function DrawSprite3D(textureDict, textureName, x, y, z, width, height, heading, red, green, blue, alpha) | |
x = x + math.sin(math.rad(-heading-90.0)) * (width*0.5) | |
y = y + math.cos(math.rad(-heading-90.0)) * (width*0.5) | |
--z = z -0.5 | |
local offX = math.sin(math.rad(-heading+90)) * width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lerp(x1, x2, t) | |
return x1 + (x2 - x1) * t | |
end | |
pos = GetEntityPosition(PlayerPedId()) | |
camPos = pos + vec(1.0, 1.0, 1.0) -- your camera calculation goes here | |
local ray = StartExpensiveSynchronousShapeTestLosProbe(pos.x, pos.y, pos.z, camPos.x, camPos.y, camPos.z, -1, PlayerPedId(), 0) | |
local _, hit, _end, _, hitEnt = GetShapeTestResult(ray) |