mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-28 16:31:15 +00:00
HUD tracking polish
Inexplicably, all positional checks were inverted. This wasn't causing too many problems because the onScreen condition was inverted too, but if it would be above your screen on the opposite side of you, it would be considered onscreen when facing 180 degrees away perfectly. By swapping viewx/y/z and point->x/y/z, and inverting onScreen, we kill this annoying lack of polish for good.
This commit is contained in:
parent
81e880464a
commit
5232da8f24
1 changed files with 3 additions and 3 deletions
|
|
@ -957,7 +957,7 @@ void K_ObjectTracking(trackingResult_t *result, const vector3_t *point, boolean
|
|||
|
||||
// Determine viewpoint factors.
|
||||
h = R_PointToDist2(point->x, point->y, viewx, viewy);
|
||||
da = AngleDeltaSigned(viewpointAngle, R_PointToAngle2(point->x, point->y, viewx, viewy));
|
||||
da = AngleDeltaSigned(viewpointAngle, R_PointToAngle2(viewx, viewy, point->x, point->y));
|
||||
dp = AngleDeltaSigned(viewpointAiming, R_PointToAngle2(0, 0, h, viewz));
|
||||
|
||||
if (reverse)
|
||||
|
|
@ -967,7 +967,7 @@ void K_ObjectTracking(trackingResult_t *result, const vector3_t *point, boolean
|
|||
|
||||
// Set results relative to top left!
|
||||
result->x = FixedMul(NEWTAN(da), fg);
|
||||
result->y = FixedMul((NEWTAN(viewpointAiming) - FixedDiv((viewz - point->z), 1 + FixedMul(NEWCOS(da), h))), fg);
|
||||
result->y = FixedMul((NEWTAN(viewpointAiming) - FixedDiv((point->z-viewz), 1 + FixedMul(NEWCOS(da), h))), fg);
|
||||
|
||||
result->angle = da;
|
||||
result->pitch = dp;
|
||||
|
|
@ -994,7 +994,7 @@ void K_ObjectTracking(trackingResult_t *result, const vector3_t *point, boolean
|
|||
|
||||
result->scale = FixedDiv(screenHalfW, h+1);
|
||||
|
||||
result->onScreen = ((abs(da) > ANG60) || (abs(AngleDeltaSigned(viewpointAiming, R_PointToAngle2(0, 0, h, (viewz - point->z)))) > ANGLE_45));
|
||||
result->onScreen = !((abs(da) > ANG60) || (abs(AngleDeltaSigned(viewpointAiming, R_PointToAngle2(0, 0, h, (viewz - point->z)))) > ANGLE_45));
|
||||
|
||||
// Cheap dirty hacks for some split-screen related cases
|
||||
if (result->x < 0 || result->x > (screenWidth << FRACBITS))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue