Ok basically MD3 shadows are level 5 on the ezquake hit list.. maybe they'll come around and add it,but really who uses shadows (or MD3) for online games??!
/*
=================
R_DrawQ3Shadow
=================
*/
void R_DrawQ3Shadow (entity_t *ent, float lheight, float s1, float c1, trace_t downtrace)
{
int i, j, numtris, pose1, pose2;
vec3_t point1, point2, interpolated;
md3header_t *pmd3hdr;
md3surface_t *pmd3surf;
unsigned int *tris;
md3vert_mem_t *verts;
model_t *clmodel = ent->model;
#if 0
float m[16];
md3tag_t *tag;
tagentity_t *tagent;
#endif
pmd3hdr = (md3header_t *)Mod_Extradata (clmodel);
pmd3surf = (md3surface_t *)((byte *)pmd3hdr + pmd3hdr->ofssurfs);
for (i=0 ; i<pmd3hdr->numsurfs ; i++)
{
verts = (md3vert_mem_t *)((byte *)pmd3hdr + pmd3surf->ofsverts);
tris = (unsigned int *)((byte *)pmd3surf + pmd3surf->ofstris);
numtris = pmd3surf->numtris * 3;
pose1 = ent->pose1 * pmd3surf->numverts;
pose2 = ent->pose2 * pmd3surf->numverts;
glBegin (GL_TRIANGLES);
for (j=0 ; j<numtris ; j++)
{
// normals and vertexes come from the frame list
VectorCopy (verts[*tris+pose1].vec, point1);
point1[0] -= shadevector[0] * (point1[2] + lheight);
point1[1] -= shadevector[1] * (point1[2] + lheight);
VectorCopy (verts[*tris+pose2].vec, point2);
point2[0] -= shadevector[0] * (point2[2] + lheight);
point2[1] -= shadevector[1] * (point2[2] + lheight);
VectorInterpolate (point1, ent->framelerp, point2, interpolated);
interpolated[2] = -(ent->origin[2] - downtrace.endpos[2]);
interpolated[2] += ((interpolated[1] * (s1 * downtrace.plane.normal[0])) -
(interpolated[0] * (c1 * downtrace.plane.normal[0])) -
(interpolated[0] * (s1 * downtrace.plane.normal[1])) -
(interpolated[1] * (c1 * downtrace.plane.normal[1]))) +
((1 - downtrace.plane.normal[2]) * 20) + 0.2;
glVertex3fv (interpolated);
*tris++;
}
glEnd ();
pmd3surf = (md3surface_t *)((byte *)pmd3surf + pmd3surf->ofsend);
}
if (!pmd3hdr->numtags) // single model, done
return;
// no multimodel shadow support yet
#if 0
tag = (md3tag_t *)((byte *)pmd3hdr + pmd3hdr->ofstags);
tag += ent->pose2 * pmd3hdr->numtags;
for (i=0 ; i<pmd3hdr->numtags ; i++, tag++)
{
if (multimodel_level == 0 && !strcmp(tag->name, "tag_torso"
)
{
tagent = &q3player_body;
ent = &q3player_body.ent;
multimodel_level++;
}
else if (multimodel_level == 1 && !strcmp(tag->name, "tag_head"
)
{
tagent = &q3player_head;
ent = &q3player_head.ent;
multimodel_level++;
}
else
{
continue;
}
glPushMatrix ();
R_RotateForTagEntity (tagent, tag, m);
glMultMatrixf (m);
R_DrawQ3Shadow (ent, lheight, s1, c1, downtrace);
glPopMatrix ();
}
#endif
}