Skip to content

Commit e02ee27

Browse files
committed
minor CameraMovement clean-up
1 parent dba6c7b commit e02ee27

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

src/game/bondmove.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,38 +470,36 @@ static void bmoveApplyCrosshairSwivel(struct movedata *movedata, f32 mlookscale,
470470

471471
#ifndef PLATFORM_N64
472472
/**
473-
* Add precision input to speed values for crosshair sway detection
473+
* Apply precision-based input to speed values for crosshair sway detection
474474
*/
475475
static void bmovePrecisionInputToCrosshairSwaySpeed(struct movedata *movedata, f32 mlookscale, bool vertical)
476476
{
477-
if (vertical) {
477+
if (vertical) { // Vertical sway movement
478478
if (movedata->freelookdy != 0.0f) {
479479
g_Vars.currentplayer->speedverta += -movedata->freelookdy * mlookscale;
480480
}
481-
} else {
481+
} else { // Horizontal sway movement
482482
if (movedata->freelookdx != 0.0f) {
483483
g_Vars.currentplayer->speedthetacontrol += movedata->freelookdx * mlookscale;
484484
}
485485
}
486486
}
487487

488488
/**
489-
* Apply Angle-based camera movement
490-
* Supports angle-based movement for mouse
489+
* Apply camera movement
490+
* Supports angle-based camera movement for precision-based inputs
491491
*/
492492
static void bmoveApplyCameraMovement(struct movedata *movedata, f32 mlookscale, bool vertical)
493493
{
494494
f32 timescale = g_Vars.lvupdate60freal * 3.5f;
495495

496-
if (vertical) {
496+
if (vertical) { // Camera vertical movement
497497
if (movedata->freelookdy != 0.0f) {
498-
f32 scaledContrib = mlookscale * timescale;
499-
g_Vars.currentplayer->vv_verta += -movedata->freelookdy * (1.0f - scaledContrib);
498+
g_Vars.currentplayer->vv_verta += -movedata->freelookdy * (1.0f - mlookscale * timescale);
500499
}
501-
} else {
500+
} else { // Camera horizontal movement
502501
if (movedata->freelookdx != 0.0f) {
503-
f32 scaledContrib = mlookscale * timescale;
504-
g_Vars.currentplayer->vv_theta += movedata->freelookdx * (1.0f - scaledContrib);
502+
g_Vars.currentplayer->vv_theta += movedata->freelookdx * (1.0f - mlookscale * timescale);
505503
}
506504
}
507505
}

0 commit comments

Comments
 (0)