Skip to content

Commit 8e80353

Browse files
committed
Added g_showModelAnims debug
g_showModelAnims debug prints the animation name that a model is playing.
1 parent fcd05ee commit 8e80353

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

d3xp/Player.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10201,6 +10201,41 @@ void idPlayer::Think( void ) {
1020110201
}
1020210202
}
1020310203
}
10204+
10205+
10206+
//BC 1-31-2026: debug for model animations
10207+
if (g_showModelAnims.GetBool())
10208+
{
10209+
idEntity *ent;
10210+
idMat3 axis = viewAngles.ToMat3();
10211+
idVec3 up = axis[2] * 5.0f;
10212+
idBounds viewTextBounds(GetPhysics()->GetOrigin());
10213+
idBounds viewBounds(GetPhysics()->GetOrigin());
10214+
10215+
float maxDistance = 128.0f;
10216+
10217+
viewTextBounds.ExpandSelf(maxDistance);
10218+
viewBounds.ExpandSelf(maxDistance);
10219+
for (ent = gameLocal.spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next())
10220+
{
10221+
if (!viewBounds.IntersectsBounds(ent->GetPhysics()->GetAbsBounds()))
10222+
continue;
10223+
10224+
if (ent->entityNumber <= 0) //skip player.
10225+
continue;
10226+
10227+
if (ent->GetAnimator() != NULL)
10228+
{
10229+
gameRenderWorld->DrawText(ent->spawnArgs.GetString("name"),
10230+
ent->GetPhysics()->GetOrigin() + idVec3(0,0,6), 0.1f, idVec4(0, 1, 0, 1), viewAxis, 1);
10231+
10232+
gameRenderWorld->DrawText(ent->GetAnimator()->CurrentAnim(ANIMCHANNEL_ALL)->AnimFullName(),
10233+
ent->GetPhysics()->GetOrigin() , 0.15f, idVec4(1, 1, 1, 1), viewAxis, 1);
10234+
10235+
gameRenderWorld->DebugBounds(idVec4(0, 1, 0, 1), ent->GetPhysics()->GetAbsBounds(), vec3_zero, 1);
10236+
}
10237+
}
10238+
}
1020410239
}
1020510240

1020610241
void idPlayer::DebugMessage( const char *text )

d3xp/gamesys/SysCvar.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,6 @@ idCVar net_serverDlTable( "net_serverDlTable", "", CVAR_GAME | CVAR_ARCHIV
478478

479479
//BC 1-30-2026: debug for player states
480480
idCVar ai_showPlayerState("ai_showPlayerState", "0", CVAR_GAME | CVAR_INTEGER, "Draws the Player state changes.");
481+
482+
//BC 1-31-2026: debug for model animations
483+
idCVar g_showModelAnims("g_showModelAnims", "0", CVAR_GAME | CVAR_INTEGER, "Display animation name of model you're looking at.");

d3xp/gamesys/SysCvar.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ extern idCVar g_showModelNames;
8888
//BC 1-30-2026: anim debug
8989
extern idCVar ai_showPlayerState;
9090

91+
//BC 1-31-2026: anim debug
92+
extern idCVar g_showModelAnims;
93+
9194
extern idCVar g_frametime;
9295
extern idCVar g_timeentities;
9396

0 commit comments

Comments
 (0)