Skip to content

Commit

Permalink
Merge pull request #99 from LengthenedGradient/Rack-Indicators
Browse files Browse the repository at this point in the history
Add Rack Forward Indicators
  • Loading branch information
TwistedTail authored Aug 3, 2024
2 parents 4a7ff0e + 70c09f0 commit 42036d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lua/entities/acf_rack/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ do -- Overlay/networking
local JoystickMat = Material("icon16/joystick.png")
local RadarColor = Color(255,255,0,25)
local ControllerColor = Color(0,255,0,25)
local ForwardColor = Color(255,0,0)

function ENT:DrawOverlay()
local SelfTbl = self:GetTable()
Expand Down Expand Up @@ -132,5 +133,15 @@ do -- Overlay/networking
render.SetMaterial(JoystickMat)
render.DrawSprite(Computer:LocalToWorld(Computer:OBBCenter()), 12, 12, color_white)
end

local p1 = self:GetPos() + self:GetForward() * 24
local p2 = self:GetPos()
local dir = (p1 - p2):GetNormalized()
local dir2 = EyeVector()
local right = (dir:Cross(dir2)):GetNormalized()

render.DrawLine(p1, p2, ForwardColor)
render.DrawLine(p1, p1 + (-dir - right) * 5, ForwardColor)
render.DrawLine(p1, p1 + (-dir + right) * 5, ForwardColor)
end
end

0 comments on commit 42036d3

Please sign in to comment.