- 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);
-
- model = ent->model;
- R_Mesh_ResizeCheck(model->numverts);
-
- memset(&m, 0, sizeof(m));
- m.blendfunc1 = GL_SRC_ALPHA;
- m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA;
- R_Mesh_State(&m);
-
- c_alias_polys += model->numtris;
- R_LerpMDLMD2Vertices(ent, varray_vertex, aliasvertnorm);
-
- // 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, planenormal);
- VectorNormalizeFast(planenormal);
-
- // put the plane's distance in the entity's coordinate space
- VectorSubtract(floororigin, ent->origin, floororigin);
- planedist = DotProduct(floororigin, surfnormal) + 2;
-
- dist = -1.0f / DotProduct(projection, planenormal);
- VectorScale(projection, dist, projection);
- for (i = 0, v = varray_vertex;i < model->numverts;i++, v += 4)
- {
- dist = DotProduct(v, planenormal) - planedist;
- if (dist > 0)
- //if (i & 1)
- VectorMA(v, dist, projection, v);
- }
- GL_Color(0, 0, 0, 0.5);
- R_Mesh_Draw(model->numverts, model->numtris, model->mdlmd2data_indices);
-}
-
-int ZymoticLerpBones(int count, const zymbonematrix *bonebase, const frameblend_t *blend, const zymbone_t *bone)
-{
- int i;
- float lerp1, lerp2, lerp3, lerp4;
- zymbonematrix *out, rootmatrix, m;
- const zymbonematrix *bone1, *bone2, *bone3, *bone4;
-
- /*
- // LordHavoc: combine transform from zym coordinate space to quake coordinate space with model to world transform matrix
- rootmatrix.m[0][0] = softwaretransform_matrix[0][1];
- rootmatrix.m[0][1] = -softwaretransform_matrix[0][0];
- rootmatrix.m[0][2] = softwaretransform_matrix[0][2];
- rootmatrix.m[0][3] = softwaretransform_matrix[0][3];
- rootmatrix.m[1][0] = softwaretransform_matrix[1][1];
- rootmatrix.m[1][1] = -softwaretransform_matrix[1][0];
- rootmatrix.m[1][2] = softwaretransform_matrix[1][2];
- rootmatrix.m[1][3] = softwaretransform_matrix[1][3];
- rootmatrix.m[2][0] = softwaretransform_matrix[2][1];
- rootmatrix.m[2][1] = -softwaretransform_matrix[2][0];
- rootmatrix.m[2][2] = softwaretransform_matrix[2][2];
- rootmatrix.m[2][3] = softwaretransform_matrix[2][3];
- */
- rootmatrix.m[0][0] = 1;
- rootmatrix.m[0][1] = 0;
- rootmatrix.m[0][2] = 0;
- rootmatrix.m[0][3] = 0;
- rootmatrix.m[1][0] = 0;
- rootmatrix.m[1][1] = 1;
- rootmatrix.m[1][2] = 0;
- rootmatrix.m[1][3] = 0;
- rootmatrix.m[2][0] = 0;
- rootmatrix.m[2][1] = 0;
- rootmatrix.m[2][2] = 1;
- rootmatrix.m[2][3] = 0;
-
- bone1 = bonebase + blend[0].frame * count;
- lerp1 = blend[0].lerp;
- if (blend[1].lerp)
- {
- bone2 = bonebase + blend[1].frame * count;
- lerp2 = blend[1].lerp;
- if (blend[2].lerp)