diff --git a/src/client/defs.h b/src/client/defs.h index f68319b3..275fc056 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -110,6 +110,35 @@ void drawrect(vector pos, vector sz, float thickness, vector rgb, float al, opti drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl); } +void +drawpic3d(vector worldpos, string mat, vector sz, vector rgb, float alpha) +{ + static bool + drawpic3d_visible(vector p1) { + vector delta; + float fov; + vector p2 = getproperty(VF_ORIGIN); + vector ang = getproperty(VF_CL_VIEWANGLES); + + makevectors(ang); + delta = normalize (p1 - p2); + fov = delta * v_forward; + + if (fov > (getproperty(VF_AFOV)/180)) { + traceline(p2, p1, MOVE_WORLDONLY, self); + if (trace_fraction == 1.0) { + return (1); + } + } + return (0); + } + + if (drawpic3d_visible(worldpos) == true) { + vector vecProj = project(worldpos) - (sz/2); + drawpic(vecProj, mat, sz, rgb, alpha); + } +} + void precache_cubemap(string path) {