Torque Compensation for Strafe Input

Adjusted thruster firing to compensate for torque introduced by uniform application of strafe input to lateral thrusters.
This commit is contained in:
Reinier Vens 2021-03-03 01:53:23 +00:00
commit fae3b85213
4 changed files with 165 additions and 34 deletions

View file

@ -61,6 +61,7 @@ public class Thruster : IAnalogBehavior
var itemCenter = hullData.Shape.Inset(itemData.Shape, item.Position, item.EquippableItem.Rotation).CenterOfMass;
var toCenter = hullCenter - itemCenter;
Torque = -dot(normalize(toCenter), float2(1, 0).Rotate(item.EquippableItem.Rotation));
Thrust = Context.Evaluate(_data.Thrust, Item.EquippableItem, Entity);
}
public bool Execute(float delta)