Skip to content

Commit

Permalink
Add Rack Forward Indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
LengthenedGradient committed Aug 3, 2024
1 parent 4a7ff0e commit 70c09f0
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 70c09f0

Please sign in to comment.