From 70c09f072baf32ac01b51c1861b244c7583cf15e Mon Sep 17 00:00:00 2001 From: LengthenedGradient <109800352+LengthenedGradient@users.noreply.github.com> Date: Fri, 2 Aug 2024 23:05:01 -0400 Subject: [PATCH] Add Rack Forward Indicators --- lua/entities/acf_rack/cl_init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/entities/acf_rack/cl_init.lua b/lua/entities/acf_rack/cl_init.lua index a0af10f..1b23323 100644 --- a/lua/entities/acf_rack/cl_init.lua +++ b/lua/entities/acf_rack/cl_init.lua @@ -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() @@ -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 \ No newline at end of file