Skip to content

Commit

Permalink
add showing all velocity vectors for cl_showpos
Browse files Browse the repository at this point in the history
  • Loading branch information
nillerusr committed Nov 18, 2018
1 parent b5b493b commit 3f761df
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions engine/client/cl_scrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Draw local player position, angles and velocity
void SCR_DrawPos( void )
{
static char msg[MAX_SYSPATH];
char vel[64];
float speed;
cl_entity_t *pPlayer;
rgba_t color;
Expand All @@ -148,12 +149,17 @@ void SCR_DrawPos( void )
pPlayer = CL_GetLocalPlayer();
speed = VectorLength( cl.frame.client.velocity );

if( cl_showpos->integer >= 2 )
Q_snprintf(vel, 64, "%.2f %.2f %2.2f", cl.frame.client.velocity[0],cl.frame.client.velocity[1], cl.frame.client.velocity[2] );
else
Q_snprintf(vel, 64, "%.2f",speed);

Q_snprintf( msg, MAX_SYSPATH,
"pos: %.2f %.2f %.2f\n"
"ang: %.2f %.2f %.2f\n"
"velocity: %.2f", pPlayer->origin[0], pPlayer->origin[1], pPlayer->origin[2],
"vel.: %s", pPlayer->origin[0], pPlayer->origin[1], pPlayer->origin[2],
pPlayer->angles[0], pPlayer->angles[1], pPlayer->angles[2],
speed );
vel );

MakeRGBA( color, 255, 255, 255, 255 );

Expand Down

0 comments on commit 3f761df

Please sign in to comment.