Snapshot for release 2026.10.20.1 (internal e05e9a8)
This commit is contained in:
parent
7439236e1d
commit
286abd1445
35 changed files with 3569 additions and 65 deletions
|
|
@ -191,14 +191,25 @@ internal static class PlayerPhysicsHooks
|
|||
|
||||
/// <summary>
|
||||
/// The per-frame main-thread pose copy (cell, cell-local origin, yaw quaternion
|
||||
/// qw/qz and AC's heading, 0 = North, clockwise), read from any thread without
|
||||
/// calling into AC. headingValid is false while AC's get_heading isn't bound;
|
||||
/// derive the heading from qw/qz then. False when nothing valid is published.
|
||||
/// qw/qz and GetPlayerHeading's value, 0 = East, counter-clockwise: see HeadingMath),
|
||||
/// read from any thread without calling into AC. headingValid is false while AC's
|
||||
/// get_heading isn't bound. False when nothing valid is published. Against a map
|
||||
/// bearing use <see cref="TryGetPlayerCompassSnapshot"/>.
|
||||
/// </summary>
|
||||
public static bool TryGetPlayerPoseSnapshot(out uint objCellId, out float x, out float y, out float z,
|
||||
out float qw, out float qz, out bool headingValid, out float heading)
|
||||
=> TryReadPoseSnapshot(out objCellId, out x, out y, out z, out qw, out _, out _, out qz, out headingValid, out heading);
|
||||
|
||||
/// <summary>Your compass heading (0 = North, clockwise) from the pose snapshot's quaternion; any thread, no AC call.</summary>
|
||||
public static bool TryGetPlayerCompassSnapshot(out float heading)
|
||||
{
|
||||
heading = 0;
|
||||
if (!TryReadPoseSnapshot(out _, out _, out _, out _, out float qw, out _, out _, out float qz, out _, out _))
|
||||
return false;
|
||||
heading = HeadingMath.CompassFromYaw(qw, qz);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool TryGetPlayerPose(
|
||||
out uint objCellId,
|
||||
out float x,
|
||||
|
|
@ -623,9 +634,10 @@ internal static class PlayerPhysicsHooks
|
|||
return BitConverter.Int32BitsToSingle(bits);
|
||||
}
|
||||
|
||||
// CPhysicsObj heading is rotated 90 degrees from the Decal/VTank basis
|
||||
// used by old RynthAi Actions.Heading. Normalize here so plugins can stay
|
||||
// on the original T1 heading math.
|
||||
// AC's get_heading is already a compass value (0 = North, clockwise); 90 - it is
|
||||
// 0 = East, counter-clockwise, which GetPlayerHeading has always returned and the
|
||||
// radar and world map draw with. Kept as it is for them; a bearing wants
|
||||
// HeadingMath.CompassFromYaw (measured 2026-10-20, see HeadingMath).
|
||||
private static float NormalizeDecalHeading(float physicsHeading)
|
||||
{
|
||||
return NormalizeDegrees(90f - physicsHeading);
|
||||
|
|
|
|||
Loading…
Reference in a new issue