< Summary

Information
Class: Trailblazer.Navigation.Motor.ClimbAffordanceSnapshot
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Navigation/Motor/Climbing/ClimbAffordanceSnapshot.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 111
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Navigation/Motor/Climbing/ClimbAffordanceSnapshot.cs

#LineLine coverage
 1//=======================================================================
 2// ClimbAffordanceSnapshot.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using FixedMathSharp;
 9
 10namespace Trailblazer.Navigation.Motor;
 11
 12/// <summary>
 13/// Immutable frame snapshot describing a climb affordance supplied by the host.
 14/// </summary>
 15public readonly struct ClimbAffordanceSnapshot
 16{
 17    /// <summary>
 18    /// Initializes a new snapshot.
 19    /// </summary>
 20    public ClimbAffordanceSnapshot(
 21        ClimbAffordanceKind kind,
 22        Vector3d attachmentPoint,
 23        Vector3d surfaceNormal,
 24        Vector3d upDirection,
 25        int? affordanceId = null,
 26        bool canStartClimb = true,
 27        bool canContinueClimb = true,
 28        bool allowLateralTraverse = true,
 29        bool allowDescent = true,
 30        bool allowMantle = false,
 31        bool allowDetachJump = true,
 32        Vector3d? mantleTargetPosition = null)
 33    {
 4734        Kind = kind;
 4735        AttachmentPoint = attachmentPoint;
 4736        SurfaceNormal = surfaceNormal;
 4737        UpDirection = upDirection;
 4738        AffordanceId = affordanceId;
 4739        CanStartClimb = canStartClimb;
 4740        CanContinueClimb = canContinueClimb;
 4741        AllowLateralTraverse = allowLateralTraverse;
 4742        AllowDescent = allowDescent;
 4743        AllowMantle = allowMantle;
 4744        AllowDetachJump = allowDetachJump;
 4745        MantleTargetPosition = mantleTargetPosition;
 4746    }
 47
 48    /// <summary>
 49    /// Gets the type of climb affordance represented by this instance.
 50    /// </summary>
 51    public ClimbAffordanceKind Kind { get; }
 52
 53    /// <summary>
 54    /// Gets the identifier of the associated affordance, if available.
 55    /// </summary>
 56    public int? AffordanceId { get; }
 57
 58    /// <summary>
 59    /// Gets the position in 3D space where the object is attached.
 60    /// </summary>
 61    public Vector3d AttachmentPoint { get; }
 62
 63    /// <summary>
 64    /// Gets the normal vector of the surface at the current location.
 65    /// </summary>
 66    public Vector3d SurfaceNormal { get; }
 67
 68    /// <summary>
 69    /// Gets the upward direction vector for the current coordinate system.
 70    /// </summary>
 71    public Vector3d UpDirection { get; }
 72
 73    /// <summary>
 74    /// Gets a value indicating whether climbing can be started based on the current state.
 75    /// </summary>
 76    public bool CanStartClimb { get; }
 77
 78    /// <summary>
 79    /// Gets a value indicating whether the climb can continue based on the current state.
 80    /// </summary>
 81    public bool CanContinueClimb { get; }
 82
 83    /// <summary>
 84    /// Gets a value indicating whether lateral traversal is permitted.
 85    /// </summary>
 86    public bool AllowLateralTraverse { get; }
 87
 88    /// <summary>
 89    /// Gets a value indicating whether descent is permitted in the current context.
 90    /// </summary>
 91    public bool AllowDescent { get; }
 92
 93    /// <summary>
 94    /// Gets a value indicating whether mantle actions are permitted.
 95    /// </summary>
 96    public bool AllowMantle { get; }
 97
 98    /// <summary>
 99    /// Gets a value indicating whether detach jump operations are permitted.
 100    /// </summary>
 101    public bool AllowDetachJump { get; }
 102
 103    /// <summary>
 104    /// Gets the target position for the mantle action, if available.
 105    /// </summary>
 106    /// <remarks>
 107    /// The target position is determined when a mantle action is in progress.
 108    /// If no mantle is being performed, the value is null.
 109    /// </remarks>
 110    public Vector3d? MantleTargetPosition { get; }
 111}