52 if (
glr.
ent->flags & RF_SHELL_MASK)
58 yaw = -DEG2RAD(
glr.
ent->angles[YAW]);
68 static inline vec_t
shadedot(
const vec_t *normal)
70 vec_t d = DotProduct(normal,
shadedir);
82 unsigned int lat = vert->
norm[0];
83 unsigned int lng = vert->
norm[1];
158 vec3_t oldnorm, newnorm, tmp;
167 len = 1 / VectorLength(tmp);
168 VectorScale(tmp, len, normal);
317 VectorAdd(bounds[0],
origin, bounds[0]);
318 VectorAdd(bounds[1],
origin, bounds[1]);
337 int flags =
glr.
ent->flags;
343 if (flags & RF_SHELL_MASK) {
345 if (flags & RF_SHELL_HALF_DAM) {
350 if (flags & RF_SHELL_DOUBLE) {
354 if (flags & RF_SHELL_RED) {
357 if (flags & RF_SHELL_GREEN) {
360 if (flags & RF_SHELL_BLUE) {
363 }
else if (flags & RF_FULLBRIGHT) {
364 VectorSet(
color, 1, 1, 1);
365 }
else if ((flags & RF_IR_VISIBLE) && (
glr.
fd.rdflags & RDF_IRGOGGLES)) {
366 VectorSet(
color, 1, 0, 0);
370 if (flags & RF_MINLIGHT) {
371 for (i = 0; i < 3; i++) {
372 if (
color[i] > 0.1f) {
377 VectorSet(
color, 0.1f, 0.1f, 0.1f);
381 if (flags & RF_GLOW) {
382 f = 0.1f * sin(
glr.
fd.time * 7);
383 for (i = 0; i < 3; i++) {
391 for (i = 0; i < 3; i++) {
392 clamp(
color[i], 0, 1);
396 if (flags & RF_TRANSLUCENT) {
413 if (
glr.
ent->flags & (RF_TRANSLUCENT | RF_SHELL_MASK))
417 celscale = 1.0f - VectorLength(dir) / 700.0f;
422 if (celscale < 0.01f || celscale > 1)
442 GLfloat matrix[16], tmp[16];
451 if (
glr.
ent->flags & (RF_WEAPONMODEL | RF_NOSHADOW))
459 VectorSet(dir, 0, 0, -1);
461 VectorSet(dir, 0, 0, 1);
466 matrix[0] = plane->normal[1] * dir[1] + plane->normal[2] * dir[2];
467 matrix[4] = -plane->normal[1] * dir[0];
468 matrix[8] = -plane->normal[2] * dir[0];
469 matrix[12] = plane->dist * dir[0];
471 matrix[1] = -plane->normal[0] * dir[1];
472 matrix[5] = plane->normal[0] * dir[0] + plane->normal[2] * dir[2];
473 matrix[9] = -plane->normal[2] * dir[1];
474 matrix[13] = plane->dist * dir[1];
476 matrix[2] = -plane->normal[0] * dir[2];
477 matrix[6] = -plane->normal[1] * dir[2];
478 matrix[10] = plane->normal[0] * dir[0] + plane->normal[1] * dir[1];
479 matrix[14] = plane->dist * dir[2];
484 matrix[15] = DotProduct(plane->normal, dir);
551 if (ent->flags & RF_SHELL_MASK)
560 if (ent->skinnum < 0 || ent->skinnum >= mesh->
numskins) {
561 Com_DPrintf(
"%s: no such skin: %d\n",
"GL_DrawAliasModel", ent->skinnum);
562 return mesh->
skins[0]->texnum;
566 return mesh->
skins[0]->texnum;
568 return mesh->
skins[ent->skinnum]->texnum;
581 if (
glr.
ent->flags & RF_TRANSLUCENT)
630 if (newframenum < 0 || newframenum >= model->numframes) {
631 Com_DPrintf(
"%s: no such frame %d\n", __func__,
newframenum);
636 if (oldframenum < 0 || oldframenum >= model->numframes) {
637 Com_DPrintf(
"%s: no such oldframe %d\n", __func__,
oldframenum);
649 if (ent->flags & RF_FRAMELERP)
650 LerpVector2(ent->oldorigin, ent->origin,
653 VectorCopy(ent->origin,
origin);
670 if (ent->flags & RF_SHELL_MASK) {
672 WEAPONSHELL_SCALE : POWERSUIT_SCALE;
684 if (ent->scale > 0.f)
689 if ((ent->flags & (RF_WEAPONMODEL | RF_LEFTHAND)) ==
690 (RF_WEAPONMODEL | RF_LEFTHAND)) {
697 if (ent->flags & RF_DEPTHHACK)
701 for (i = 0; i < model->nummeshes; i++)
704 if (ent->flags & RF_DEPTHHACK)
707 if ((ent->flags & (RF_WEAPONMODEL | RF_LEFTHAND)) ==
708 (RF_WEAPONMODEL | RF_LEFTHAND)) {