Skip to content

Commit

Permalink
Use the bounding boxes of MD5 corpses for render culling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren Salt committed May 29, 2012
1 parent 3bc2d25 commit 4d40ef1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gamelogic/gpp/src/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -3882,7 +3882,7 @@ void CG_Corpse( centity_t *cent )
int renderfx;
qboolean shadow = qfalse;
float shadowPlane;
vec3_t origin, liveZ, deadZ;
vec3_t origin, liveZ, deadZ, deadMax;
float scale;

corpseNum = CG_GetCorpseNum( es->clientNum );
Expand All @@ -3906,7 +3906,7 @@ void CG_Corpse( centity_t *cent )
memset( &head, 0, sizeof( head ) );

VectorCopy( cent->lerpOrigin, origin );
BG_ClassBoundingBox( es->clientNum, liveZ, NULL, NULL, deadZ, NULL );
BG_ClassBoundingBox( es->clientNum, liveZ, NULL, NULL, deadZ, deadMax );
origin[ 2 ] -= ( liveZ[ 2 ] - deadZ[ 2 ] );
if( ci->bodyModel )
{
Expand Down Expand Up @@ -3992,6 +3992,8 @@ void CG_Corpse( centity_t *cent )
legs.customSkin = ci->bodySkin;
memcpy( &legs.skeleton, &skeleton, sizeof( refSkeleton_t ) );
CG_TransformSkeleton( &legs.skeleton, ci->modelScale );
memcpy( &legs.skeleton.bounds[ 0 ], &deadZ, sizeof( vec3_t ) );
memcpy( &legs.skeleton.bounds[ 1 ], &deadMax, sizeof( vec3_t ) );
}

//
Expand Down

0 comments on commit 4d40ef1

Please sign in to comment.