EyePos
Vector EyePos()
Açıklama
Mevcut render bağlamının GM:CalcView tarafından hesaplanan başlangıç noktasını döndürür.
Döndürülen Değerler
Örnek
EyePos fonksiyonunun render hook'ları dışında doğru değeri döndürmesini sağlama.
local mins, maxs = Vector( -5, -5, -5 ), Vector( 5, 5, 5 )
hook.Add( "PreDrawTranslucentRenderables", "FixEyePos", function()
EyePos()
end )
hook.Add( "Think", "Use Eyepos outside of render function", function()
local start = EyePos()
local dir = gui.ScreenToVector( gui.MousePos() )
local trace = util.TraceLine({
start = start,
endpos = start + ( dir * 10000 ),
filter = { ply }
})
debugoverlay.Box( trace.HitPos, mins, maxs )
end )
Çıktı: Farenizi doğrulttuğunuz yerde dünyada beyaz bir kutu çizer. developer convar'ının
1 olarak ayarlanmasını gerektirir.Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord