Targeting correction: reticle = TORSO BORESIGHT, not a free mouse cursor (task #39)
Colleague flagged that targeting is torso-locked with no fine cursor. Correct: the pod stick's yaw drove the TORSO TWIST (MechControlsMapper -> HUD::SetFreeAimSlew(stick_x) @cockpit+0x28C, gated on torso-horizontal-enabled; hud.hpp:167) and reticlePosition @HUD+0x1FC is COMPUTED by HudSimulation from the mech pose quaternion + target geometry, zeroed to centre with no target (part_013.c:5680) -- never a free-floating cursor. The engine Reticle struct is general (shared with Red Planet); BT drives it from the torso boresight. Fix: - Removed the mouse-cursor slew (a mis-sourced stand-in from the RP-shared struct). The crosshair is now the torso boresight: BTTwistToReticleX(torsoTwist) = tan(twist) projected through the live per-axis projection. Dead-centre on the fixed-torso BLH (TorsoHorizontalEnabled=0); you aim by steering the whole mech. - BT_AIM="x y" retained as the headless test harness. Verified: face-to-face spawn -> HOT lock + aimed zone hits (36); BT_FORCE_TURN circling -> 31 no-target vs 1 HOT (steering off-target drops the lock, as it must). KB swept (combat-damage / gauges-hud / open-questions); checkctx CLEAN. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
24ea7f13af
commit
a8a56c57c9
@@ -165,6 +165,20 @@ void BTClientToReticle(float mx, float my, float cw, float ch,
|
||||
*ry = y;
|
||||
}
|
||||
|
||||
//
|
||||
// Torso-twist angle (radians) -> reticle X (task #39): the crosshair marks
|
||||
// where the torso guns point relative to the body-mounted view. A boresight
|
||||
// ray at horizontal angle `twist` from forward hits camera-space
|
||||
// xc = d*tan(twist) at depth d, so ndc_x = tan(twist)*P11 and
|
||||
// rx = ndc_x * (vw/vh). Zero for a fixed torso (dead-centre boresight).
|
||||
//
|
||||
float BTTwistToReticleX(float twist_rad)
|
||||
{
|
||||
if (!gBTAimCamValid || gBTAimP11 <= 0.0f || gBTAimVpH <= 0.0f)
|
||||
return 0.0f;
|
||||
return (float)tan((double)twist_rad) * gBTAimP11 * (gBTAimVpW / gBTAimVpH);
|
||||
}
|
||||
|
||||
//
|
||||
// Crosshair (reticle coords) -> world pick ray. reticle -> NDC:
|
||||
// ndc_x = rx * vh/vw (the reticle x unit is half the viewport HEIGHT),
|
||||
|
||||
Reference in New Issue
Block a user