//
// 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
{
///
///
/// Base class for character class
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:53
///
/// class CharacterBase : public RefTarget<CharacterBase>, public NonCopyable
///
///
[InteropHandle]
public readonly partial struct CharacterBase : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:87
///
/// enum class EGroundState
///
///
public enum GroundState : int
{
///
///
/// Character is on the ground and can move freely.
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:89
///
/// OnGround
///
///
OnGround,
///
///
/// Character is on a slope that is too steep and can't climb up any further. The caller should start
/// applying downward velocity if sliding from the slope is desired.
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:90
///
/// OnSteepGround
///
///
OnSteepGround,
///
///
/// Character is touching an object, but is not supported by it and should fall. The GetGroundXXX
/// functions will return information about the touched object.
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:91
///
/// NotSupported
///
///
NotSupported,
///
///
/// Character is in the air and is not touching anything.
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:92
///
/// InAir
///
///
InAir,
}
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:59
///
/// CharacterBase(const CharacterBaseSettings *inSettings, PhysicsSystem *inSystem)
///
///
public static CharacterBase Create(CharacterBaseSettings settings, PhysicsSystem system) =>
Jolt.PInvoke.CharacterBase_Create(settings, system);
///
///
/// Set the maximum angle of slope that character can still walk on (radians)
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:65
///
/// void SetMaxSlopeAngle(float inMaxSlopeAngle)
///
///
public void SetMaxSlopeAngle(float maxSlopeAngle) =>
Jolt.PInvoke.CharacterBase_SetMaxSlopeAngle(this, maxSlopeAngle);
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:66
///
/// float GetCosMaxSlopeAngle() const
///
///
public float GetCosMaxSlopeAngle() => Jolt.PInvoke.CharacterBase_GetCosMaxSlopeAngle(this);
///
///
/// Set the up vector for the character
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:69
///
/// void SetUp(Vec3Arg inUp)
///
///
public void SetUp(float3 up) => Jolt.PInvoke.CharacterBase_SetUp(this, up);
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:70
///
/// Vec3 GetUp() const
///
///
public float3 GetUp() => Jolt.PInvoke.CharacterBase_GetUp(this);
///
///
/// Every contact behind this plane can support the character
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:73
///
/// const Plane & GetSupportingVolume() const
///
///
public Plane GetSupportingVolume() => Jolt.PInvoke.CharacterBase_GetSupportingVolume(this);
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:74
///
/// void SetSupportingVolume(const Plane &inPlane)
///
///
public void SetSupportingVolume(in Plane plane) =>
Jolt.PInvoke.CharacterBase_SetSupportingVolume(this, in plane);
///
///
/// Check if the normal of the ground surface is too steep to walk on
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:77
///
/// bool IsSlopeTooSteep(Vec3Arg inNormal) const
///
///
public bool IsSlopeTooSteep(float3 normal) => Jolt.PInvoke.CharacterBase_IsSlopeTooSteep(this, normal);
///
///
/// Get the current shape that the character is using.
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:85
///
/// const Shape * GetShape() const
///
///
///
///
/// The returned handle carries its own reference; Dispose it once when you're done.
///
///
public Shape GetShape() => Jolt.PInvoke.CharacterBase_GetShape(this);
///
///
/// Debug function to convert enum values to string
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:96
///
/// static const char * sToString(EGroundState inState)
///
///
public static unsafe RefString8 ToDisplayString(CharacterBase.GroundState state) =>
(Ptr)Jolt.PInvoke.CharacterBase_ToDisplayString(state);
///
///
/// Current ground state
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:101
///
/// EGroundState GetGroundState() const
///
///
public CharacterBase.GroundState GetGroundState() => Jolt.PInvoke.CharacterBase_GetGroundState(this);
///
///
/// Returns true if the player is supported by normal or steep ground
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:104
///
/// bool IsSupported() const
///
///
public bool IsSupported() => Jolt.PInvoke.CharacterBase_IsSupported(this);
///
///
/// Get the contact point with the ground
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:107
///
/// RVec3 GetGroundPosition() const
///
///
public float3 GetGroundPosition() => Jolt.PInvoke.CharacterBase_GetGroundPosition(this);
///
///
/// Get the contact normal with the ground
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:110
///
/// Vec3 GetGroundNormal() const
///
///
public float3 GetGroundNormal() => Jolt.PInvoke.CharacterBase_GetGroundNormal(this);
///
///
/// Velocity in world space of ground
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:113
///
/// Vec3 GetGroundVelocity() const
///
///
public float3 GetGroundVelocity() => Jolt.PInvoke.CharacterBase_GetGroundVelocity(this);
///
///
/// Material that the character is standing on
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:116
///
/// const PhysicsMaterial * GetGroundMaterial() const
///
///
///
///
/// The returned handle carries its own reference; Dispose it once when you're done.
///
///
public PhysicsMaterial GetGroundMaterial() => Jolt.PInvoke.CharacterBase_GetGroundMaterial(this);
///
///
/// BodyID of the object the character is standing on. Note may have been removed!
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:119
///
/// BodyID GetGroundBodyID() const
///
///
public uint GetGroundBodyID() => Jolt.PInvoke.CharacterBase_GetGroundBodyID(this);
///
///
/// Sub part of the body that we're standing on.
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:122
///
/// SubShapeID GetGroundSubShapeID() const
///
///
public uint GetGroundSubShapeID() => Jolt.PInvoke.CharacterBase_GetGroundSubShapeID(this);
///
///
/// User data value of the body that we're standing on
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:125
///
/// uint64 GetGroundUserData() const
///
///
public ulong GetGroundUserData() => Jolt.PInvoke.CharacterBase_GetGroundUserData(this);
///
///
/// Saving / restoring state for replay
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:128
///
/// virtual void SaveState(StateRecorder &inStream) const
///
///
public void SaveState(StateRecorder stream) => Jolt.PInvoke.CharacterBase_SaveState(this, stream);
///
///
/// C++:
/// Jolt/Physics/Character/CharacterBase.h:129
///
/// virtual void RestoreState(StateRecorder &inStream)
///
///
public void RestoreState(StateRecorder stream) => Jolt.PInvoke.CharacterBase_RestoreState(this, stream);
public void AddRef() => Jolt.PInvoke.CharacterBase_AddRef(this);
public void Release() => Jolt.PInvoke.CharacterBase_Release(this);
public uint GetRefCount() => Jolt.PInvoke.CharacterBase_GetRefCount(this);
public void Dispose()
{
if (IsNull())
return;
Release();
}
}
}