//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// Uniquely identifies a contact between a character and another body or character
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:85
///
/// class CharacterContactKey
///
///
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct CharacterContactKey
{
///
///
/// ID of body we're colliding with (if not invalid)
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:123
///
/// BodyID mBodyB
///
///
[FieldOffset(0)]
public uint BodyB;
///
///
/// Character we're colliding with (if not invalid)
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:124
///
/// CharacterID mCharacterIDB
///
///
[FieldOffset(4)]
public uint CharacterIDB;
///
///
/// Sub shape ID of body or character we're colliding with
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:125
///
/// SubShapeID mSubShapeIDB
///
///
[FieldOffset(8)]
public uint SubShapeIDB;
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:89
///
/// CharacterContactKey() = default
///
///
public static CharacterContactKey Create()
{
Jolt.PInvoke.CharacterContactKey_Create(out var _outResult);
return _outResult;
}
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:91
///
/// CharacterContactKey(const BodyID &inBodyB, const SubShapeID &inSubShapeID)
///
///
public static CharacterContactKey Create(uint bodyB, uint subShapeID)
{
Jolt.PInvoke.CharacterContactKey_Create_2(bodyB, subShapeID, out var _outResult);
return _outResult;
}
///
///
/// Checks if two contacts refer to the same body (or virtual character)
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:96
///
/// inline bool IsSameBody(const CharacterContactKey &inOther) const
///
///
public readonly bool IsSameBody(in CharacterContactKey other) =>
Jolt.PInvoke.CharacterContactKey_IsSameBody(ref Unsafe.AsRef(in this), in other);
///
///
/// Hash of this structure
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:113
///
/// inline uint64 GetHash() const
///
///
public readonly ulong GetHash() => Jolt.PInvoke.CharacterContactKey_GetHash(ref Unsafe.AsRef(in this));
///
///
/// Saving / restoring state for replay
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:120
///
/// void SaveState(StateRecorder &inStream) const
///
///
public readonly void SaveState(StateRecorder stream) =>
Jolt.PInvoke.CharacterContactKey_SaveState(ref Unsafe.AsRef(in this), stream);
///
///
/// C++:
/// Jolt/Physics/Character/CharacterVirtual.h:121
///
/// void RestoreState(StateRecorder &inStream)
///
///
public void RestoreState(StateRecorder stream) =>
Jolt.PInvoke.CharacterContactKey_RestoreState(ref this, stream);
}
}