| | | 1 | | using FixedMathSharp; |
| | | 2 | | |
| | | 3 | | namespace Trailblazer.Navigation.Motor; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Immutable frame snapshot describing a climb affordance supplied by the host. |
| | | 7 | | /// </summary> |
| | | 8 | | public readonly struct ClimbAffordanceSnapshot |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new snapshot. |
| | | 12 | | /// </summary> |
| | | 13 | | public ClimbAffordanceSnapshot( |
| | | 14 | | ClimbAffordanceKind kind, |
| | | 15 | | Vector3d attachmentPoint, |
| | | 16 | | Vector3d surfaceNormal, |
| | | 17 | | Vector3d upDirection, |
| | | 18 | | int? affordanceId = null, |
| | | 19 | | bool canStartClimb = true, |
| | | 20 | | bool canContinueClimb = true, |
| | | 21 | | bool allowLateralTraverse = true, |
| | | 22 | | bool allowDescent = true, |
| | | 23 | | bool allowMantle = false, |
| | | 24 | | bool allowDetachJump = true, |
| | | 25 | | Vector3d? mantleTargetPosition = null) |
| | | 26 | | { |
| | 27 | 27 | | Kind = kind; |
| | 27 | 28 | | AttachmentPoint = attachmentPoint; |
| | 27 | 29 | | SurfaceNormal = surfaceNormal; |
| | 27 | 30 | | UpDirection = upDirection; |
| | 27 | 31 | | AffordanceId = affordanceId; |
| | 27 | 32 | | CanStartClimb = canStartClimb; |
| | 27 | 33 | | CanContinueClimb = canContinueClimb; |
| | 27 | 34 | | AllowLateralTraverse = allowLateralTraverse; |
| | 27 | 35 | | AllowDescent = allowDescent; |
| | 27 | 36 | | AllowMantle = allowMantle; |
| | 27 | 37 | | AllowDetachJump = allowDetachJump; |
| | 27 | 38 | | MantleTargetPosition = mantleTargetPosition; |
| | 27 | 39 | | } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Gets the type of climb affordance represented by this instance. |
| | | 43 | | /// </summary> |
| | | 44 | | public ClimbAffordanceKind Kind { get; } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Gets the identifier of the associated affordance, if available. |
| | | 48 | | /// </summary> |
| | | 49 | | public int? AffordanceId { get; } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Gets the position in 3D space where the object is attached. |
| | | 53 | | /// </summary> |
| | | 54 | | public Vector3d AttachmentPoint { get; } |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Gets the normal vector of the surface at the current location. |
| | | 58 | | /// </summary> |
| | | 59 | | public Vector3d SurfaceNormal { get; } |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Gets the upward direction vector for the current coordinate system. |
| | | 63 | | /// </summary> |
| | | 64 | | public Vector3d UpDirection { get; } |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// Gets a value indicating whether climbing can be started based on the current state. |
| | | 68 | | /// </summary> |
| | | 69 | | public bool CanStartClimb { get; } |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// Gets a value indicating whether the climb can continue based on the current state. |
| | | 73 | | /// </summary> |
| | | 74 | | public bool CanContinueClimb { get; } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Gets a value indicating whether lateral traversal is permitted. |
| | | 78 | | /// </summary> |
| | | 79 | | public bool AllowLateralTraverse { get; } |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// Gets a value indicating whether descent is permitted in the current context. |
| | | 83 | | /// </summary> |
| | | 84 | | public bool AllowDescent { get; } |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// Gets a value indicating whether mantle actions are permitted. |
| | | 88 | | /// </summary> |
| | | 89 | | public bool AllowMantle { get; } |
| | | 90 | | |
| | | 91 | | /// <summary> |
| | | 92 | | /// Gets a value indicating whether detach jump operations are permitted. |
| | | 93 | | /// </summary> |
| | | 94 | | public bool AllowDetachJump { get; } |
| | | 95 | | |
| | | 96 | | /// <summary> |
| | | 97 | | /// Gets the target position for the mantle action, if available. |
| | | 98 | | /// </summary> |
| | | 99 | | /// <remarks> |
| | | 100 | | /// The target position is determined when a mantle action is in progress. |
| | | 101 | | /// If no mantle is being performed, the value is null. |
| | | 102 | | /// </remarks> |
| | | 103 | | public Vector3d? MantleTargetPosition { get; } |
| | | 104 | | } |