Helm split, simulation: Ship.Turn is the only facing command; LookDirection becomes Aim
Ship.Update reads Turn and feeds the rotation thrusters and aether drives; it no longer reads the look direction or snaps Direction toward it. Steering.Toward is the one law from heading to demand (a heading astern now turns at full demand). HelmInput owns the face-the-aim state. Accelerate, Combat and MoveTo write Turn through Steering.Toward. Entity.LookDirection is renamed Aim in the simulation, the Unity readers and the tests. Unity player input follows in the next commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cf0979481f
commit
c86423936e
29 changed files with 331 additions and 80 deletions
18
Assets/Scripts/ServerShared/HelmInput.cs
Normal file
18
Assets/Scripts/ServerShared/HelmInput.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using CultMath;
|
||||
using static CultMath.math;
|
||||
|
||||
// The player's face-the-aim state, engine-free. Held follows the Face Aim hold input each frame; Latched is
|
||||
// flipped by the Caps Lock press. Either one faces the aim; neither leaves the hull to the turn axis.
|
||||
// Runtime only, never saved: Latched starts false each session.
|
||||
public class HelmInput
|
||||
{
|
||||
public bool Held;
|
||||
public bool Latched;
|
||||
|
||||
public bool FaceAim => Held || Latched;
|
||||
|
||||
public void Toggle() => Latched = !Latched;
|
||||
|
||||
public float Demand(Ship ship, float2 aim, float turnAxis) =>
|
||||
FaceAim ? Steering.Toward(ship, aim) : clamp(turnAxis, -1f, 1f);
|
||||
}
|
||||
Loading…
Reference in a new issue