| | | 1 | | //======================================================================= |
| | | 2 | | // RagdollLinkDefinition3D.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2026-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | using Gravitas.Colliders; |
| | | 9 | | |
| | | 10 | | namespace Gravitas.Constraints; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Authored link entry for a deterministic 3D ragdoll articulation. |
| | | 14 | | /// </summary> |
| | | 15 | | public readonly struct RagdollLinkDefinition3D |
| | | 16 | | { |
| | | 17 | | /// <summary> |
| | | 18 | | /// Creates a ragdoll link definition. |
| | | 19 | | /// </summary> |
| | | 20 | | public RagdollLinkDefinition3D(int linkId, SolidBody body) |
| | | 21 | | { |
| | 106 | 22 | | SwiftThrowHelper.ThrowIfNull(body, nameof(body)); |
| | | 23 | | |
| | 105 | 24 | | LinkId = linkId; |
| | 105 | 25 | | Body = body; |
| | 105 | 26 | | Collider = body.Collider; |
| | 105 | 27 | | } |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Gets the stable authored link ID. |
| | | 31 | | /// </summary> |
| | | 32 | | public int LinkId { get; } |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Gets the body represented by this ragdoll link. |
| | | 36 | | /// </summary> |
| | | 37 | | public SolidBody Body { get; } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// Gets the collider represented by this ragdoll link. |
| | | 41 | | /// </summary> |
| | | 42 | | public LSCollider Collider { get; } |
| | | 43 | | } |