Move the entity transform setup into the clients.

This has several benifits:
  o The silly issue with alias model pitches being backwards is kept out
    of the renderer (it's a quakec thing: entites do their pitch
    backwards, but originally, only alias models were rotated. Hipnotic
    did brush entity rotations in the correct direction).
  o Angle to frame vector conversions are done only when the entity's
    angles vector changes, rather than every frame. This avoids a lot of
    unnecessary trig function calls.
  o Once transformed, an entity's frame vectors are always available.
    However, the vectors are left handed rather than right handed (ie,
    forward/left/up instead of forward/right/up): just a matter of
    watching the sign. This avoids even more trig calls (flag models in
    qw).
  o This paves the way for merging brush entity surface rendering with the
    world model surface rendering (the actual goal of this patch).
  o This also paves the way for using quaternions to represent entity
    orientation, as that would be a protocol change.
This commit is contained in:
Bill Currie 2011-12-15 12:06:03 +09:00
parent f6ebb78140
commit 3eb859a88f
24 changed files with 205 additions and 223 deletions

View file

@ -42,6 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
#include "qw/bothdefs.h"
#include "cl_cam.h"
#include "cl_ents.h"
#include "cl_main.h"
#include "client.h"
#include "compat.h"
@ -693,6 +694,7 @@ V_CalcRefdef (void)
if (cl.chase && chase_active->int_val)
Chase_Update ();
CL_TransformEntity (view, view->angles, true);
}
static void