mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
354 lines
18 KiB
C#
354 lines
18 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L46">Jolt/Physics/Character/Character.h:46</see>
|
|
/// <br/>
|
|
/// <c>class Character : public CharacterBase</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Runtime character object.
|
|
/// This object usually represents the player or a humanoid AI. It uses a single rigid body,
|
|
/// usually with a capsule shape to simulate movement and collision for the character.
|
|
/// The character is a keyframed object, the application controls it by setting the velocity.
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct Character : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L57">Jolt/Physics/Character/Character.h:57</see>
|
|
/// <br/>
|
|
/// <c>Character(const CharacterSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, uint64 inUserData, PhysicsSystem *inSystem)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Constructor
|
|
/// @param inSettings The settings for the character
|
|
/// @param inPosition Initial position for the character
|
|
/// @param inRotation Initial rotation for the character (usually only around Y)
|
|
/// @param inUserData Application specific value
|
|
/// @param inSystem Physics system that this character will be added to later
|
|
/// </code>
|
|
/// </remarks>
|
|
public static Character Create(CharacterSettings settings, float3 position, floatQuat rotation, ulong userData, PhysicsSystem system) => Jolt.PInvoke.Character_Create(settings, position, rotation, userData, system);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L63">Jolt/Physics/Character/Character.h:63</see>
|
|
/// <br/>
|
|
/// <c>void AddToPhysicsSystem(EActivation inActivationMode = EActivation::Activate, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Add bodies and constraints to the system and optionally activate the bodies
|
|
/// </para>
|
|
/// </remarks>
|
|
public void AddToPhysicsSystem(EActivation activationMode, bool lockBodies) => Jolt.PInvoke.Character_AddToPhysicsSystem(this, activationMode, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L66">Jolt/Physics/Character/Character.h:66</see>
|
|
/// <br/>
|
|
/// <c>void RemoveFromPhysicsSystem(bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Remove bodies and constraints from the system
|
|
/// </para>
|
|
/// </remarks>
|
|
public void RemoveFromPhysicsSystem(bool lockBodies) => Jolt.PInvoke.Character_RemoveFromPhysicsSystem(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L69">Jolt/Physics/Character/Character.h:69</see>
|
|
/// <br/>
|
|
/// <c>void Activate(bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Wake up the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public void Activate(bool lockBodies) => Jolt.PInvoke.Character_Activate(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L74">Jolt/Physics/Character/Character.h:74</see>
|
|
/// <br/>
|
|
/// <c>void PostSimulation(float inMaxSeparationDistance, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Needs to be called after every PhysicsSystem::Update
|
|
/// @param inMaxSeparationDistance Max distance between the floor and the character to still consider the character standing on the floor
|
|
/// @param inLockBodies If the collision query should use the locking body interface (true) or the non locking body interface (false)
|
|
/// </code>
|
|
/// </remarks>
|
|
public void PostSimulation(float maxSeparationDistance, bool lockBodies) => Jolt.PInvoke.Character_PostSimulation(this, maxSeparationDistance, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L77">Jolt/Physics/Character/Character.h:77</see>
|
|
/// <br/>
|
|
/// <c>void SetLinearAndAngularVelocity(Vec3Arg inLinearVelocity, Vec3Arg inAngularVelocity, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Control the velocity of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetLinearAndAngularVelocity(float3 linearVelocity, float3 angularVelocity, bool lockBodies) => Jolt.PInvoke.Character_SetLinearAndAngularVelocity(this, linearVelocity, angularVelocity, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L80">Jolt/Physics/Character/Character.h:80</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetLinearVelocity(bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the linear velocity of the character (m / s)
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetLinearVelocity(bool lockBodies) => Jolt.PInvoke.Character_GetLinearVelocity(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L83">Jolt/Physics/Character/Character.h:83</see>
|
|
/// <br/>
|
|
/// <c>void SetLinearVelocity(Vec3Arg inLinearVelocity, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the linear velocity of the character (m / s)
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetLinearVelocity(float3 linearVelocity, bool lockBodies) => Jolt.PInvoke.Character_SetLinearVelocity(this, linearVelocity, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L86">Jolt/Physics/Character/Character.h:86</see>
|
|
/// <br/>
|
|
/// <c>void AddLinearVelocity(Vec3Arg inLinearVelocity, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Add world space linear velocity to current velocity (m / s)
|
|
/// </para>
|
|
/// </remarks>
|
|
public void AddLinearVelocity(float3 linearVelocity, bool lockBodies) => Jolt.PInvoke.Character_AddLinearVelocity(this, linearVelocity, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L89">Jolt/Physics/Character/Character.h:89</see>
|
|
/// <br/>
|
|
/// <c>void AddImpulse(Vec3Arg inImpulse, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Add impulse to the center of mass of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public void AddImpulse(float3 impulse, bool lockBodies) => Jolt.PInvoke.Character_AddImpulse(this, impulse, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L92">Jolt/Physics/Character/Character.h:92</see>
|
|
/// <br/>
|
|
/// <c>BodyID GetBodyID() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the body associated with this character
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetBodyID() => Jolt.PInvoke.Character_GetBodyID(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L95">Jolt/Physics/Character/Character.h:95</see>
|
|
/// <br/>
|
|
/// <c>void GetPositionAndRotation(RVec3 &outPosition, Quat &outRotation, bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get position / rotation of the body
|
|
/// </para>
|
|
/// </remarks>
|
|
public void GetPositionAndRotation(out float3 position, out floatQuat rotation, bool lockBodies) => Jolt.PInvoke.Character_GetPositionAndRotation(this, out position, out rotation, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L98">Jolt/Physics/Character/Character.h:98</see>
|
|
/// <br/>
|
|
/// <c>void SetPositionAndRotation(RVec3Arg inPosition, QuatArg inRotation, EActivation inActivationMode = EActivation::Activate, bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the position / rotation of the body, optionally activating it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetPositionAndRotation(float3 position, floatQuat rotation, EActivation activationMode, bool lockBodies) => Jolt.PInvoke.Character_SetPositionAndRotation(this, position, rotation, activationMode, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L101">Jolt/Physics/Character/Character.h:101</see>
|
|
/// <br/>
|
|
/// <c>RVec3 GetPosition(bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the position of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetPosition(bool lockBodies) => Jolt.PInvoke.Character_GetPosition(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L104">Jolt/Physics/Character/Character.h:104</see>
|
|
/// <br/>
|
|
/// <c>void SetPosition(RVec3Arg inPosition, EActivation inActivationMode = EActivation::Activate, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the position of the character, optionally activating it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetPosition(float3 position, EActivation activationMode, bool lockBodies) => Jolt.PInvoke.Character_SetPosition(this, position, activationMode, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L107">Jolt/Physics/Character/Character.h:107</see>
|
|
/// <br/>
|
|
/// <c>Quat GetRotation(bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the rotation of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public floatQuat GetRotation(bool lockBodies) => Jolt.PInvoke.Character_GetRotation(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L110">Jolt/Physics/Character/Character.h:110</see>
|
|
/// <br/>
|
|
/// <c>void SetRotation(QuatArg inRotation, EActivation inActivationMode = EActivation::Activate, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the rotation of the character, optionally activating it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetRotation(floatQuat rotation, EActivation activationMode, bool lockBodies) => Jolt.PInvoke.Character_SetRotation(this, rotation, activationMode, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L113">Jolt/Physics/Character/Character.h:113</see>
|
|
/// <br/>
|
|
/// <c>RVec3 GetCenterOfMassPosition(bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Position of the center of mass of the underlying rigid body
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetCenterOfMassPosition(bool lockBodies) => Jolt.PInvoke.Character_GetCenterOfMassPosition(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L116">Jolt/Physics/Character/Character.h:116</see>
|
|
/// <br/>
|
|
/// <c>RMat44 GetWorldTransform(bool inLockBodies = true) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Calculate the world transform of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public float4x4 GetWorldTransform(bool lockBodies) => Jolt.PInvoke.Character_GetWorldTransform(this, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L119">Jolt/Physics/Character/Character.h:119</see>
|
|
/// <br/>
|
|
/// <c>ObjectLayer GetLayer() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the layer of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public ushort GetLayer() => Jolt.PInvoke.Character_GetLayer(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L122">Jolt/Physics/Character/Character.h:122</see>
|
|
/// <br/>
|
|
/// <c>void SetLayer(ObjectLayer inLayer, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Update the layer of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetLayer(ushort layer, bool lockBodies) => Jolt.PInvoke.Character_SetLayer(this, layer, lockBodies);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/Character.h#L126">Jolt/Physics/Character/Character.h:126</see>
|
|
/// <br/>
|
|
/// <c>bool SetShape(const Shape *inShape, float inMaxPenetrationDepth, bool inLockBodies = true)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Switch the shape of the character (e.g. for stance). When inMaxPenetrationDepth is not FLT_MAX, it checks
|
|
/// if the new shape collides before switching shape. Returns true if the switch succeeded.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool SetShape(Shape shape, float maxPenetrationDepth, bool lockBodies) => Jolt.PInvoke.Character_SetShape(this, shape, maxPenetrationDepth, lockBodies);
|
|
public void AddRef() => Jolt.PInvoke.Character_AddRef(this);
|
|
public void Release() => Jolt.PInvoke.Character_Release(this);
|
|
public uint GetRefCount() => Jolt.PInvoke.Character_GetRefCount(this);
|
|
public static implicit operator CharacterBase(Character value) => Jolt.PInvoke.Character_AsCharacterBase(value);
|
|
public void Dispose()
|
|
{
|
|
if (IsNull()) return;
|
|
Release();
|
|
}
|
|
}
|
|
}
|