mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-03 09:51:15 +00:00
Show prediction's radius on the prediction debugger
This commit is contained in:
parent
c7e061155a
commit
df13b9fcfa
1 changed files with 44 additions and 1 deletions
45
src/k_bot.c
45
src/k_bot.c
|
|
@ -839,21 +839,64 @@ static INT16 K_FindBotController(mobj_t *mo)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
static void K_DrawPredictionDebug(botprediction_t *predict, player_t *player)
|
||||
|
||||
Draws objects to show where the viewpoint bot is trying to go.
|
||||
|
||||
Input Arguments:-
|
||||
predict - The prediction to visualize.
|
||||
player - The bot player this prediction is for.
|
||||
|
||||
Return:-
|
||||
N/A
|
||||
--------------------------------------------------*/
|
||||
static void K_DrawPredictionDebug(botprediction_t *predict, player_t *player)
|
||||
{
|
||||
const angle_t sideAngle = player->mo->angle + ANGLE_90;
|
||||
|
||||
mobj_t *debugmobj = NULL;
|
||||
UINT8 i = UINT8_MAX;
|
||||
|
||||
debugmobj = P_SpawnMobj(predict->x, predict->y, player->mo->z, MT_SPARK);
|
||||
P_SetMobjState(debugmobj, S_THOK);
|
||||
|
||||
debugmobj->frame &= ~FF_TRANSMASK;
|
||||
debugmobj->frame |= FF_TRANS20;
|
||||
debugmobj->frame |= FF_TRANS20|FF_FULLBRIGHT;
|
||||
|
||||
debugmobj->color = SKINCOLOR_ORANGE;
|
||||
debugmobj->scale *= 2;
|
||||
|
||||
debugmobj->state->tics = 2;
|
||||
debugmobj->state->nextstate = S_NULL;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
fixed_t radiusX = predict->x, radiusY = predict->y;
|
||||
|
||||
if (i & 1)
|
||||
{
|
||||
radiusX -= FixedMul(predict->radius, FINECOSINE(sideAngle >> ANGLETOFINESHIFT));
|
||||
radiusY -= FixedMul(predict->radius, FINESINE(sideAngle >> ANGLETOFINESHIFT));
|
||||
}
|
||||
else
|
||||
{
|
||||
radiusX += FixedMul(predict->radius, FINECOSINE(sideAngle >> ANGLETOFINESHIFT));
|
||||
radiusY += FixedMul(predict->radius, FINESINE(sideAngle >> ANGLETOFINESHIFT));
|
||||
}
|
||||
|
||||
debugmobj = P_SpawnMobj(radiusX, radiusY, player->mo->z, MT_SPARK);
|
||||
P_SetMobjState(debugmobj, S_THOK);
|
||||
|
||||
debugmobj->frame &= ~FF_TRANSMASK;
|
||||
debugmobj->frame |= FF_TRANS20|FF_FULLBRIGHT;
|
||||
|
||||
debugmobj->color = SKINCOLOR_YELLOW;
|
||||
debugmobj->scale /= 2;
|
||||
|
||||
debugmobj->state->tics = 2;
|
||||
debugmobj->state->nextstate = S_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue