Skip to content

Commit

Permalink
Display current angles in InfoHUD
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Mar 25, 2024
1 parent f6c48a2 commit dcf1db9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Source/TAS/InfoHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ public static void RenderGUI()
ImGui.Text($"Vel: {player.Velocity.X.ToFormattedString(Save.Instance.InfoHudDecimals)} {player.Velocity.Y.ToFormattedString(Save.Instance.InfoHudDecimals)} {player.Velocity.Z.ToFormattedString(Save.Instance.InfoHudDecimals)}");
else
ImGui.Text($"Vel: {((player.Position.X - lastPlayerPosition.Value.X) / Time.Delta).ToFormattedString(Save.Instance.InfoHudDecimals)} {((player.Position.Y - lastPlayerPosition.Value.Y) / Time.Delta).ToFormattedString(Save.Instance.InfoHudDecimals)} {((player.Position.Z - lastPlayerPosition.Value.Z) / Time.Delta).ToFormattedString(Save.Instance.InfoHudDecimals)}");
if (player.Velocity.XY() == Vec2.Zero)
ImGui.Text($"SpdAngle: N/A");
else
ImGui.Text($"SpdAngle: {Modulo(player.Velocity.XY().Angle() * Calc.RadToDeg + 90.0f, 360.0f).ToFormattedString(Save.Instance.InfoHudDecimals)}");
ImGui.Text($"Facing: {Modulo(player.Facing.Angle() * Calc.RadToDeg + 90.0f, 360.0f).ToFormattedString(Save.Instance.InfoHudDecimals)}");
ImGui.Text($"TargetFacing: {Modulo(player.targetFacing.Angle() * Calc.RadToDeg + 90.0f, 360.0f).ToFormattedString(Save.Instance.InfoHudDecimals)}");

ImGui.Text(string.Empty);

List<string> statues = new();
Expand Down Expand Up @@ -196,4 +203,10 @@ public static int ToFrames(this float seconds)
{
return (int) Math.Ceiling(seconds / Time.Delta);
}

// :screwms: moment
public static float Modulo(float a, float b)
{
return (a % b + b) % b;
}
}

0 comments on commit dcf1db9

Please sign in to comment.