Re: [Quake-C] Using v_forward vs. Aim () function ?
Quake C mods and support - SSQC / CSQC
Brought to you by:
teknoskillz
From: <qu...@ca...> - 2016-09-30 06:26:42
|
Best check that engine code. For this: sv_aim is "2" ["2"] maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93 That is used as a dotproduct result comparison. #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) VectorNormalize (dir); dist = DotProduct (dir, PRVM_serverglobalvector(v_forward)); if (dist < bestdist) continue; // to far to turn Quake one engine just checked every entity. Darkplaces uses traceline. Ents are checked for takedamage, teamsettings, etc. If valid: dir is tested as vector for every valid entity near your v_forward. If the dotproduct of dir and v_forward is > sv_aim cvar value, the vector pointing at the shootable entity is returned. Otherwise v_forward is returned. If sv_aim >= 1 v_forward is always returned. The autoaim feature was a holdover from doom which had vertical autoaim. I just do this in qc: // compile this with fteqcc #define aim(ign,igntwo) v_forward Happy coding! Support free code by Six gaming on Patreon: https://www.patreon.com/six_gaming On 2016-09-29 12:12, je...@qb... wrote: > The Quake source code comment says it's missile speed, and the > argument is read, but it's not actually used in the function. See > PF_Aim in pr_cmds.c This function is loaded with various tasks, so > overhead could be an issue if calling it a lot. > >> -------- Original Message -------- >> Subject: [Quake-C] Using v_forward vs. Aim () function ? >> From: "Cobalt" <co...@te...> >> Date: Thu, September 29, 2016 12:19 pm >> To: "QC" <qua...@li...> >> >> Recently discovered if you call makevectors and get a v_forward, >> you basicly >> wind up with the same result as if you did: >> >> aim (self, x); >> >> What exactly is the ' x ' float for in that function? >> >> |