2007-02-04 01:16:06 +00:00
|
|
|
|
|
|
|
ENT.Spawnable = false
|
|
|
|
ENT.AdminSpawnable = false
|
|
|
|
|
|
|
|
include('shared.lua')
|
2007-04-30 21:07:03 +00:00
|
|
|
|
2007-05-05 01:54:41 +00:00
|
|
|
--handle overlay text client side instead (TAD2020)
|
2007-04-30 21:07:03 +00:00
|
|
|
function ENT:Think()
|
|
|
|
self.BaseClass.Think(self)
|
2007-12-04 07:58:30 +00:00
|
|
|
|
|
|
|
local txt
|
|
|
|
|
2007-06-28 06:02:32 +00:00
|
|
|
if (self:GetXYZMode()) then
|
2007-04-30 21:07:03 +00:00
|
|
|
local vel = self.Entity:WorldToLocal(self.Entity:GetVelocity()+self.Entity:GetPos())
|
2007-12-04 07:58:30 +00:00
|
|
|
txt = "Velocity = " .. math.Round((-vel.y or 0)*1000)/1000 .. "," .. math.Round((vel.x or 0)*1000)/1000 .. "," .. math.Round((vel.z or 0)*1000)/1000
|
2007-04-30 21:07:03 +00:00
|
|
|
else
|
|
|
|
local vel = self.Entity:GetVelocity():Length()
|
2007-12-04 07:58:30 +00:00
|
|
|
txt = "Speed = " .. math.Round((x or 0)*1000)/1000
|
2007-04-30 21:07:03 +00:00
|
|
|
end
|
|
|
|
|
2007-12-04 07:58:30 +00:00
|
|
|
--sadly self.Entity:GetPhysicsObject():GetAngleVelocity() does work client side, so read out is unlikely
|
|
|
|
/*if (self:GetAngVel()) then
|
|
|
|
local ang = self.Entity:GetPhysicsObject():GetAngleVelocity()
|
|
|
|
txt = txt .. "\nAngVel = P " .. math.Round((ang.y or 0)*1000)/1000 .. ", Y " .. math.Round((ang.z or 0)*1000) /1000 .. ", R " .. math.Round((ang.x or 0)*1000)/1000
|
|
|
|
end*/
|
|
|
|
|
|
|
|
self.Entity:SetNetworkedBeamString( "GModOverlayText", txt )
|
|
|
|
|
2007-04-30 21:07:03 +00:00
|
|
|
self.Entity:NextThink(CurTime()+0.04)
|
|
|
|
return true
|
|
|
|
end
|