#include "gl_local.h"
#include "anorms.h"
#include "anormtab.h"
Go to the source code of this file.
|
void | GL_LerpVerts (int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3]) |
|
void | GL_DrawAliasFrameLerp (dmdl_t *paliashdr, float backlerp) |
|
void | GL_DrawAliasShadow (dmdl_t *paliashdr, int posenum) |
|
static qboolean | R_CullAliasModel (vec3_t bbox[8], entity_t *e) |
|
void | R_DrawAliasModel (entity_t *e) |
|
◆ NUMVERTEXNORMALS
#define NUMVERTEXNORMALS 162 |
◆ SHADEDOT_QUANT
#define SHADEDOT_QUANT 16 |
◆ vec4_t
◆ GL_DrawAliasFrameLerp()
void GL_DrawAliasFrameLerp |
( |
dmdl_t * |
paliashdr, |
|
|
float |
backlerp |
|
) |
| |
Definition at line 90 of file gl_mesh.c.
99 vec3_t move, delta, vectors[3];
111 ov = oldframe->
verts;
125 qglDisable( GL_TEXTURE_2D );
127 frontlerp = 1.0 - backlerp;
139 for (
i=0 ;
i<3 ;
i++)
141 move[
i] = backlerp*move[
i] + frontlerp*frame->
translate[
i];
144 for (
i=0 ;
i<3 ;
i++)
146 frontv[
i] = frontlerp*frame->
scale[
i];
147 backv[
i] = backlerp*oldframe->
scale[
i];
158 qglEnableClientState( GL_VERTEX_ARRAY );
159 qglVertexPointer( 3, GL_FLOAT, 16,
s_lerped );
169 qglEnableClientState( GL_COLOR_ARRAY );
170 qglColorPointer( 3, GL_FLOAT, 0, colorArray );
185 if ( qglLockArraysEXT != 0 )
186 qglLockArraysEXT( 0, paliashdr->
num_xyz );
197 qglBegin (GL_TRIANGLE_FAN);
201 qglBegin (GL_TRIANGLE_STRIP);
209 index_xyz =
order[2];
212 qglVertex3fv(
s_lerped[index_xyz] );
221 qglTexCoord2f (((
float *)
order)[0], ((
float *)
order)[1]);
222 index_xyz =
order[2];
230 qglArrayElement( index_xyz );
237 if ( qglUnlockArraysEXT != 0 )
238 qglUnlockArraysEXT();
251 qglBegin (GL_TRIANGLE_FAN);
255 qglBegin (GL_TRIANGLE_STRIP);
262 index_xyz =
order[2];
275 qglTexCoord2f (((
float *)
order)[0], ((
float *)
order)[1]);
276 index_xyz =
order[2];
294 qglEnable( GL_TEXTURE_2D );
Referenced by R_DrawAliasModel().
◆ GL_DrawAliasShadow()
Definition at line 306 of file gl_mesh.c.
319 verts = frame->
verts;
336 qglBegin (GL_TRIANGLE_FAN);
339 qglBegin (GL_TRIANGLE_STRIP);
356 qglVertex3fv (point);
Referenced by R_DrawAliasModel().
◆ GL_LerpVerts()
Definition at line 54 of file gl_mesh.c.
61 for (
i=0 ;
i < nverts;
i++,
v++, ov++, lerp+=4 )
65 lerp[0] = move[0] + ov->v[0]*backv[0] +
v->v[0]*frontv[0] + normal[0] *
POWERSUIT_SCALE;
66 lerp[1] = move[1] + ov->v[1]*backv[1] +
v->v[1]*frontv[1] + normal[1] *
POWERSUIT_SCALE;
67 lerp[2] = move[2] + ov->v[2]*backv[2] +
v->v[2]*frontv[2] + normal[2] *
POWERSUIT_SCALE;
72 for (
i=0 ;
i < nverts;
i++,
v++, ov++, lerp+=4)
74 lerp[0] = move[0] + ov->v[0]*backv[0] +
v->v[0]*frontv[0];
75 lerp[1] = move[1] + ov->v[1]*backv[1] +
v->v[1]*frontv[1];
76 lerp[2] = move[2] + ov->v[2]*backv[2] +
v->v[2]*frontv[2];
Referenced by GL_DrawAliasFrameLerp().
◆ R_CullAliasModel()
Definition at line 373 of file gl_mesh.c.
379 vec3_t thismins, oldmins, thismaxs, oldmaxs;
409 if ( pframe == poldframe )
411 for (
i = 0;
i < 3;
i++ )
414 maxs[
i] = mins[
i] + pframe->
scale[
i]*255;
419 for (
i = 0;
i < 3;
i++ )
422 thismaxs[
i] = thismins[
i] + pframe->
scale[
i]*255;
425 oldmaxs[
i] = oldmins[
i] + poldframe->
scale[
i]*255;
427 if ( thismins[
i] < oldmins[
i] )
428 mins[
i] = thismins[
i];
430 mins[
i] = oldmins[
i];
432 if ( thismaxs[
i] > oldmaxs[
i] )
433 maxs[
i] = thismaxs[
i];
435 maxs[
i] = oldmaxs[
i];
442 for (
i = 0;
i < 8;
i++ )
468 angles[
YAW] = -angles[
YAW];
469 AngleVectors( angles, vectors[0], vectors[1], vectors[2] );
471 for (
i = 0;
i < 8;
i++ )
485 int p, f, aggregatemask = ~0;
487 for ( p = 0; p < 8; p++ )
491 for ( f = 0; f < 4; f++ )
495 if ( ( dp -
frustum[f].dist ) < 0 )
501 aggregatemask &=
mask;
Referenced by R_DrawAliasModel().
◆ R_DrawAliasModel()
Definition at line 519 of file gl_mesh.c.
634 for (
i=0 ;
i<3 ;
i++)
681 for (
i=0 ;
i<3 ;
i++)
698 for (
i=0 ;
i<3 ;
i++)
742 qglMatrixMode( GL_PROJECTION );
745 qglScalef( -1, 1, 1 );
747 qglMatrixMode( GL_MODELVIEW );
749 qglCullFace( GL_BACK );
777 qglShadeModel (GL_SMOOTH);
782 qglEnable (GL_BLEND);
809 qglShadeModel (GL_FLAT);
814 qglDisable( GL_CULL_FACE );
815 qglPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
816 qglDisable( GL_TEXTURE_2D );
817 qglBegin( GL_TRIANGLE_STRIP );
818 for (
i = 0;
i < 8;
i++ )
820 qglVertex3fv( bbox[
i] );
823 qglEnable( GL_TEXTURE_2D );
824 qglPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
825 qglEnable( GL_CULL_FACE );
830 qglMatrixMode( GL_PROJECTION );
832 qglMatrixMode( GL_MODELVIEW );
833 qglCullFace( GL_FRONT );
838 qglDisable (GL_BLEND);
849 qglDisable (GL_TEXTURE_2D);
850 qglEnable (GL_BLEND);
851 qglColor4f (0,0,0,0.5);
853 qglEnable (GL_TEXTURE_2D);
854 qglDisable (GL_BLEND);
858 qglColor4f (1,1,1,1);
◆ lightspot
◆ r_avertexnormal_dots
◆ r_avertexnormals
◆ s_lerped
◆ shadedots
◆ shadelight
◆ shadevector
void MYgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
void GL_LerpVerts(int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3])