Set up shadevector for gl alias models.

The setup had been lost at some stage, thus shadows were always directly
under the entity. Unlike the original quake shadow code, the vector is
correctly transformed into the entity's space.
This commit is contained in:
Bill Currie 2012-07-17 17:10:48 +09:00
parent fbc0ad59df
commit a7327acb80

View file

@ -678,6 +678,8 @@ gl_R_DrawAliasModel (entity_t *e)
// torches, grenades, and lightning bolts do not have shadows
if (r_shadows->int_val && model->shadow_alpha) {
mat4_t shadow_mat;
qfglPushMatrix ();
gl_R_RotateForEntity (e);
@ -695,6 +697,12 @@ gl_R_DrawAliasModel (entity_t *e)
color_black[3] = model->shadow_alpha;
qfglColor4ubv (color_black);
}
shadevector[0] = 1;
shadevector[1] = 0;
shadevector[2] = 1;
VectorNormalize (shadevector);
Mat4Transpose (e->transform, shadow_mat);
Mat4as3MultVec (shadow_mat, shadevector, shadevector);
if (vo->tex_coord)
GL_DrawAliasShadowTri (paliashdr, vo);
else