Turn bound has one owner, the actuators; pin the turn rate and the 90 degree boundary

Ship.Update no longer clamps Turn: Thruster.Axis saturates and AetherDrive.Axis
clamps, which is where the bound is enforced. TurnIsClampedToOne becomes
TheActuatorsBoundATurnBeyondOne and asserts the actuator bounds directly. The turn
rate is pinned against a value computed from each thruster's Torque, Thrust,
TorqueMultiplier and the hull's Mass; the behind-the-hull rule is probed at 85 and
95 degrees.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-07 19:11:34 +02:00
commit b644fceb24
2 changed files with 60 additions and 7 deletions

View file

@ -278,12 +278,11 @@ public class Ship : Entity
foreach (var thruster in _forwardThrusters) thruster.Axis += MovementDirection.y;
foreach (var thruster in _reverseThrusters) thruster.Axis += -MovementDirection.y;
var turn = clamp(Turn, -1f, 1f);
foreach (var thruster in _clockwiseThrusters) thruster.Axis += turn;
foreach (var thruster in _counterClockwiseThrusters) thruster.Axis += -turn;
foreach (var thruster in _clockwiseThrusters) thruster.Axis += Turn;
foreach (var thruster in _counterClockwiseThrusters) thruster.Axis += -Turn;
foreach (var drive in _aetherDrives)
drive.Axis = float3(MovementDirection.y, MovementDirection.x, turn);
drive.Axis = float3(MovementDirection.y, MovementDirection.x, Turn);
}
var velocityMagnitude = length(Velocity);