+ int i, meshnum;
+ aliasmesh_t *mesh;
+ aliasskin_t *skin;
+ rmeshstate_t m;
+ float *v, plane[4], dist, projection[3], floororigin[3], surfnormal[3], lightdirection[3], v2[3];
+
+ if ((ent->effects & EF_ADDITIVE) || ent->alpha < 1)
+ return;
+
+ lightdirection[0] = 0.5;
+ lightdirection[1] = 0.2;
+ lightdirection[2] = -1;
+ VectorNormalizeFast(lightdirection);
+
+ VectorMA(ent->origin, 65536.0f, lightdirection, v2);
+ if (CL_TraceLine(ent->origin, v2, floororigin, surfnormal, 0, false, NULL) == 1)
+ return;
+
+ R_Mesh_Matrix(&ent->matrix);
+
+ memset(&m, 0, sizeof(m));
+ R_Mesh_State_Texture(&m);
+
+ GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ GL_DepthMask(false);
+ GL_DepthTest(true);
+ GL_VertexPointer(varray_vertex3f);
+ GL_Color(0, 0, 0, 0.5);
+
+ // put a light direction in the entity's coordinate space
+ Matrix4x4_Transform3x3(&ent->inversematrix, lightdirection, projection);
+ VectorNormalizeFast(projection);
+
+ // put the plane's normal in the entity's coordinate space
+ Matrix4x4_Transform3x3(&ent->inversematrix, surfnormal, plane);
+ VectorNormalizeFast(plane);
+
+ // put the plane's distance in the entity's coordinate space
+ VectorSubtract(floororigin, ent->origin, floororigin);
+ plane[3] = DotProduct(floororigin, surfnormal) + 2;
+
+ dist = -1.0f / DotProduct(projection, plane);
+ VectorScale(projection, dist, projection);
+ for (meshnum = 0, mesh = ent->model->aliasdata_meshes;meshnum < ent->model->aliasnum_meshes;meshnum++)