mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
1067 lines
60 KiB
C#
1067 lines
60 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/CharacterVirtual.h#L204">Jolt/Physics/Character/CharacterVirtual.h:204</see>
|
|
/// <br/>
|
|
/// <c>class CharacterVirtual : public CharacterBase</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Runtime character object.
|
|
/// This object usually represents the player. Contrary to the Character class it doesn't use a rigid body but moves doing collision checks only (hence the name virtual).
|
|
/// The advantage of this is that you can determine when the character moves in the frame (usually this has to happen at a very particular point in the frame)
|
|
/// but the downside is that other objects don't see this virtual character. To make a CharacterVirtual visible to the simulation, you can optionally create an inner
|
|
/// rigid body through CharacterVirtualSettings::mInnerBodyShape. A CharacterVirtual is not tracked by the PhysicsSystem so you need to update it yourself. This also means
|
|
/// that a call to PhysicsSystem::SaveState will not save its state, you need to call CharacterVirtual::SaveState yourself.
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct CharacterVirtual : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L365">Jolt/Physics/Character/CharacterVirtual.h:365</see>
|
|
/// <br/>
|
|
/// <c>struct ExtendedUpdateSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Settings struct with settings for ExtendedUpdate
|
|
/// </para>
|
|
/// </remarks>
|
|
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
|
public struct ExtendedUpdateSettings
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// See StickToFloor inStepDown parameter. Can be zero to turn off.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L367">Jolt/Physics/Character/CharacterVirtual.h:367</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mStickToFloorStepDown { 0, -0.5f, 0 }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public float3 mStickToFloorStepDown;
|
|
/// <summary>
|
|
/// <para>
|
|
/// See WalkStairs inStepUp parameter. Can be zero to turn off.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L368">Jolt/Physics/Character/CharacterVirtual.h:368</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mWalkStairsStepUp { 0, 0.4f, 0 }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(16)]
|
|
public float3 mWalkStairsStepUp;
|
|
/// <summary>
|
|
/// <para>
|
|
/// See WalkStairs inStepForward parameter. Note that the parameter only indicates a magnitude,
|
|
/// direction is taken from current velocity.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L369">Jolt/Physics/Character/CharacterVirtual.h:369</see>
|
|
/// <br/>
|
|
/// <c>float mWalkStairsMinStepForward { 0.02f }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(32)]
|
|
public float mWalkStairsMinStepForward;
|
|
/// <summary>
|
|
/// <para>
|
|
/// See WalkStairs inStepForwardTest parameter. Note that the parameter only indicates a magnitude,
|
|
/// direction is taken from current velocity.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L370">Jolt/Physics/Character/CharacterVirtual.h:370</see>
|
|
/// <br/>
|
|
/// <c>float mWalkStairsStepForwardTest { 0.15f }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(36)]
|
|
public float mWalkStairsStepForwardTest;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Cos(angle) where angle is the maximum angle between the ground normal in the horizontal plane and
|
|
/// the character forward vector where we're willing to adjust the step forward test towards the contact
|
|
/// normal.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L371">Jolt/Physics/Character/CharacterVirtual.h:371</see>
|
|
/// <br/>
|
|
/// <c>float mWalkStairsCosAngleForwardContact { Cos(DegreesToRadians(75.0f)) }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(40)]
|
|
public float mWalkStairsCosAngleForwardContact;
|
|
/// <summary>
|
|
/// <para>
|
|
/// See WalkStairs inStepDownExtra
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L372">Jolt/Physics/Character/CharacterVirtual.h:372</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mWalkStairsStepDownExtra { Vec3::sZero() }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(48)]
|
|
public float3 mWalkStairsStepDownExtra;
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L483">Jolt/Physics/Character/CharacterVirtual.h:483</see>
|
|
/// <br/>
|
|
/// <c>struct Contact : public ContactKey</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Encapsulates a collision contact
|
|
/// </para>
|
|
/// </remarks>
|
|
[StructLayout(LayoutKind.Explicit, Size = 128)]
|
|
public struct Contact
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Position where the character makes contact
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L489">Jolt/Physics/Character/CharacterVirtual.h:489</see>
|
|
/// <br/>
|
|
/// <c>RVec3 mPosition</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(16)]
|
|
public float3 mPosition;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Velocity of the contact point
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L490">Jolt/Physics/Character/CharacterVirtual.h:490</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mLinearVelocity</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(32)]
|
|
public float3 mLinearVelocity;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Contact normal, pointing towards the character
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L491">Jolt/Physics/Character/CharacterVirtual.h:491</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mContactNormal</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(48)]
|
|
public float3 mContactNormal;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Surface normal of the contact
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L492">Jolt/Physics/Character/CharacterVirtual.h:492</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mSurfaceNormal</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(64)]
|
|
public float3 mSurfaceNormal;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Distance to the contact <= 0 means that it is an actual contact, > 0 means predictive
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L493">Jolt/Physics/Character/CharacterVirtual.h:493</see>
|
|
/// <br/>
|
|
/// <c>float mDistance</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(80)]
|
|
public float mDistance;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Fraction along the path where this contact takes place
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L494">Jolt/Physics/Character/CharacterVirtual.h:494</see>
|
|
/// <br/>
|
|
/// <c>float mFraction</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(84)]
|
|
public float mFraction;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Motion type of B, used to determine the priority of the contact
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L495">Jolt/Physics/Character/CharacterVirtual.h:495</see>
|
|
/// <br/>
|
|
/// <c>EMotionType mMotionTypeB</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(88)]
|
|
public EMotionType mMotionTypeB;
|
|
/// <summary>
|
|
/// <para>
|
|
/// If B is a sensor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L496">Jolt/Physics/Character/CharacterVirtual.h:496</see>
|
|
/// <br/>
|
|
/// <c>bool mIsSensorB</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(89)]
|
|
public Brutal.Bool8 mIsSensorB;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Character we're colliding with (if not nullptr). Note that this may be a dangling pointer when
|
|
/// accessed through GetActiveContacts(), use mCharacterIDB instead.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L497">Jolt/Physics/Character/CharacterVirtual.h:497</see>
|
|
/// <br/>
|
|
/// <c>const CharacterVirtual * mCharacterB = nullptr</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(96)]
|
|
public CharacterVirtual mCharacterB;
|
|
/// <summary>
|
|
/// <para>
|
|
/// User data of B
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L498">Jolt/Physics/Character/CharacterVirtual.h:498</see>
|
|
/// <br/>
|
|
/// <c>uint64 mUserData</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(104)]
|
|
public ulong mUserData;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Material of B
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L499">Jolt/Physics/Character/CharacterVirtual.h:499</see>
|
|
/// <br/>
|
|
/// <c>const PhysicsMaterial * mMaterial</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(112)]
|
|
public PhysicsMaterial mMaterial;
|
|
/// <summary>
|
|
/// <para>
|
|
/// If the character actually collided with the contact (can be false if a predictive contact never
|
|
/// becomes a real one)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L500">Jolt/Physics/Character/CharacterVirtual.h:500</see>
|
|
/// <br/>
|
|
/// <c>bool mHadCollision = false</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(120)]
|
|
public Brutal.Bool8 mHadCollision;
|
|
/// <summary>
|
|
/// <para>
|
|
/// If the contact validate callback chose to discard this contact or when the body is a sensor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L501">Jolt/Physics/Character/CharacterVirtual.h:501</see>
|
|
/// <br/>
|
|
/// <c>bool mWasDiscarded = false</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(121)]
|
|
public Brutal.Bool8 mWasDiscarded;
|
|
/// <summary>
|
|
/// <para>
|
|
/// When true, the velocity of the contact point can push the character
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L502">Jolt/Physics/Character/CharacterVirtual.h:502</see>
|
|
/// <br/>
|
|
/// <c>bool mCanPushCharacter = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(122)]
|
|
public Brutal.Bool8 mCanPushCharacter;
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L215">Jolt/Physics/Character/CharacterVirtual.h:215</see>
|
|
/// <br/>
|
|
/// <c>CharacterVirtual(const CharacterVirtualSettings *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 the up-axis)
|
|
/// @param inUserData Application specific value
|
|
/// @param inSystem Physics system that this character will be added to
|
|
/// </code>
|
|
/// </remarks>
|
|
public static CharacterVirtual Create(CharacterVirtualSettings settings, float3 position, floatQuat rotation, ulong userData, PhysicsSystem system) => Jolt.PInvoke.CharacterVirtual_Create(settings, position, rotation, userData, system);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L218">Jolt/Physics/Character/CharacterVirtual.h:218</see>
|
|
/// <br/>
|
|
/// <c>CharacterVirtual(const CharacterVirtualSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, PhysicsSystem *inSystem)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Constructor without user data
|
|
/// </para>
|
|
/// </remarks>
|
|
public static CharacterVirtual Create(CharacterVirtualSettings settings, float3 position, floatQuat rotation, PhysicsSystem system) => Jolt.PInvoke.CharacterVirtual_Create_2(settings, position, rotation, system);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L224">Jolt/Physics/Character/CharacterVirtual.h:224</see>
|
|
/// <br/>
|
|
/// <c>inline const CharacterID & GetID() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The ID of this character
|
|
/// </para>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public CharacterID GetID() => Jolt.PInvoke.CharacterVirtual_GetID(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L227">Jolt/Physics/Character/CharacterVirtual.h:227</see>
|
|
/// <br/>
|
|
/// <c>void SetListener(CharacterContactListener *inListener)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the contact listener
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetListener(CharacterContactListener listener) => Jolt.PInvoke.CharacterVirtual_SetListener(this, listener);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L230">Jolt/Physics/Character/CharacterVirtual.h:230</see>
|
|
/// <br/>
|
|
/// <c>CharacterContactListener * GetListener() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the current contact listener
|
|
/// </para>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public CharacterContactListener GetListener() => Jolt.PInvoke.CharacterVirtual_GetListener(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L233">Jolt/Physics/Character/CharacterVirtual.h:233</see>
|
|
/// <br/>
|
|
/// <c>void SetCharacterVsCharacterCollision(CharacterVsCharacterCollision *inCharacterVsCharacterCollision)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the character vs character collision interface
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetCharacterVsCharacterCollision(CharacterVsCharacterCollision characterVsCharacterCollision) => Jolt.PInvoke.CharacterVirtual_SetCharacterVsCharacterCollision(this, characterVsCharacterCollision);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L236">Jolt/Physics/Character/CharacterVirtual.h:236</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetLinearVelocity() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the linear velocity of the character (m / s)
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetLinearVelocity() => Jolt.PInvoke.CharacterVirtual_GetLinearVelocity(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L239">Jolt/Physics/Character/CharacterVirtual.h:239</see>
|
|
/// <br/>
|
|
/// <c>void SetLinearVelocity(Vec3Arg inLinearVelocity)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the linear velocity of the character (m / s)
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetLinearVelocity(float3 linearVelocity) => Jolt.PInvoke.CharacterVirtual_SetLinearVelocity(this, linearVelocity);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L242">Jolt/Physics/Character/CharacterVirtual.h:242</see>
|
|
/// <br/>
|
|
/// <c>RVec3 GetPosition() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the position of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetPosition() => Jolt.PInvoke.CharacterVirtual_GetPosition(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L245">Jolt/Physics/Character/CharacterVirtual.h:245</see>
|
|
/// <br/>
|
|
/// <c>void SetPosition(RVec3Arg inPosition)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the position of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetPosition(float3 position) => Jolt.PInvoke.CharacterVirtual_SetPosition(this, position);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L248">Jolt/Physics/Character/CharacterVirtual.h:248</see>
|
|
/// <br/>
|
|
/// <c>Quat GetRotation() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the rotation of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public floatQuat GetRotation() => Jolt.PInvoke.CharacterVirtual_GetRotation(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L251">Jolt/Physics/Character/CharacterVirtual.h:251</see>
|
|
/// <br/>
|
|
/// <c>void SetRotation(QuatArg inRotation)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set the rotation of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetRotation(floatQuat rotation) => Jolt.PInvoke.CharacterVirtual_SetRotation(this, rotation);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L254">Jolt/Physics/Character/CharacterVirtual.h:254</see>
|
|
/// <br/>
|
|
/// <c>inline RVec3 GetCenterOfMassPosition() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the center of mass position of the shape
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetCenterOfMassPosition() => Jolt.PInvoke.CharacterVirtual_GetCenterOfMassPosition(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L257">Jolt/Physics/Character/CharacterVirtual.h:257</see>
|
|
/// <br/>
|
|
/// <c>RMat44 GetWorldTransform() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Calculate the world transform of the character
|
|
/// </para>
|
|
/// </remarks>
|
|
public float4x4 GetWorldTransform() => Jolt.PInvoke.CharacterVirtual_GetWorldTransform(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L260">Jolt/Physics/Character/CharacterVirtual.h:260</see>
|
|
/// <br/>
|
|
/// <c>RMat44 GetCenterOfMassTransform() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Calculates the transform for this character's center of mass
|
|
/// </para>
|
|
/// </remarks>
|
|
public float4x4 GetCenterOfMassTransform() => Jolt.PInvoke.CharacterVirtual_GetCenterOfMassTransform(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L263">Jolt/Physics/Character/CharacterVirtual.h:263</see>
|
|
/// <br/>
|
|
/// <c>float GetMass() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Character mass (kg)
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetMass() => Jolt.PInvoke.CharacterVirtual_GetMass(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L264">Jolt/Physics/Character/CharacterVirtual.h:264</see>
|
|
/// <br/>
|
|
/// <c>void SetMass(float inMass)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetMass(float mass) => Jolt.PInvoke.CharacterVirtual_SetMass(this, mass);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L267">Jolt/Physics/Character/CharacterVirtual.h:267</see>
|
|
/// <br/>
|
|
/// <c>float GetMaxStrength() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Maximum force with which the character can push other bodies (N)
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetMaxStrength() => Jolt.PInvoke.CharacterVirtual_GetMaxStrength(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L268">Jolt/Physics/Character/CharacterVirtual.h:268</see>
|
|
/// <br/>
|
|
/// <c>void SetMaxStrength(float inMaxStrength)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetMaxStrength(float maxStrength) => Jolt.PInvoke.CharacterVirtual_SetMaxStrength(this, maxStrength);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L271">Jolt/Physics/Character/CharacterVirtual.h:271</see>
|
|
/// <br/>
|
|
/// <c>float GetPenetrationRecoverySpeed() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in
|
|
/// one update
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetPenetrationRecoverySpeed() => Jolt.PInvoke.CharacterVirtual_GetPenetrationRecoverySpeed(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L272">Jolt/Physics/Character/CharacterVirtual.h:272</see>
|
|
/// <br/>
|
|
/// <c>void SetPenetrationRecoverySpeed(float inSpeed)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetPenetrationRecoverySpeed(float speed) => Jolt.PInvoke.CharacterVirtual_SetPenetrationRecoverySpeed(this, speed);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L275">Jolt/Physics/Character/CharacterVirtual.h:275</see>
|
|
/// <br/>
|
|
/// <c>bool GetEnhancedInternalEdgeRemoval() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Set to indicate that extra effort should be made to try to remove ghost contacts (collisions with
|
|
/// internal edges of a mesh). This is more expensive but makes bodies move smoother over a mesh with convex
|
|
/// edges.
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool GetEnhancedInternalEdgeRemoval() => Jolt.PInvoke.CharacterVirtual_GetEnhancedInternalEdgeRemoval(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L276">Jolt/Physics/Character/CharacterVirtual.h:276</see>
|
|
/// <br/>
|
|
/// <c>void SetEnhancedInternalEdgeRemoval(bool inApply)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetEnhancedInternalEdgeRemoval(bool apply) => Jolt.PInvoke.CharacterVirtual_SetEnhancedInternalEdgeRemoval(this, apply);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L279">Jolt/Physics/Character/CharacterVirtual.h:279</see>
|
|
/// <br/>
|
|
/// <c>float GetCharacterPadding() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Character padding
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetCharacterPadding() => Jolt.PInvoke.CharacterVirtual_GetCharacterPadding(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L282">Jolt/Physics/Character/CharacterVirtual.h:282</see>
|
|
/// <br/>
|
|
/// <c>uint GetMaxNumHits() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Max num hits to collect in order to avoid excess of contact points collection
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetMaxNumHits() => Jolt.PInvoke.CharacterVirtual_GetMaxNumHits(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L283">Jolt/Physics/Character/CharacterVirtual.h:283</see>
|
|
/// <br/>
|
|
/// <c>void SetMaxNumHits(uint inMaxHits)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetMaxNumHits(uint maxHits) => Jolt.PInvoke.CharacterVirtual_SetMaxNumHits(this, maxHits);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L286">Jolt/Physics/Character/CharacterVirtual.h:286</see>
|
|
/// <br/>
|
|
/// <c>float GetHitReductionCosMaxAngle() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Cos(angle) where angle is the maximum angle between two hits contact normals that are allowed to be
|
|
/// merged during hit reduction. Default is around 2.5 degrees. Set to -1 to turn off.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetHitReductionCosMaxAngle() => Jolt.PInvoke.CharacterVirtual_GetHitReductionCosMaxAngle(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L287">Jolt/Physics/Character/CharacterVirtual.h:287</see>
|
|
/// <br/>
|
|
/// <c>void SetHitReductionCosMaxAngle(float inCosMaxAngle)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetHitReductionCosMaxAngle(float cosMaxAngle) => Jolt.PInvoke.CharacterVirtual_SetHitReductionCosMaxAngle(this, cosMaxAngle);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L293">Jolt/Physics/Character/CharacterVirtual.h:293</see>
|
|
/// <br/>
|
|
/// <c>bool GetMaxHitsExceeded() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Returns if we exceeded the maximum number of hits during the last collision check and had to discard hits based on distance.
|
|
/// This can be used to find areas that have too complex geometry for the character to navigate properly.
|
|
/// To solve you can either increase the max number of hits or simplify the geometry. Note that the character simulation will
|
|
/// try to do its best to select the most relevant contacts to avoid the character from getting stuck.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool GetMaxHitsExceeded() => Jolt.PInvoke.CharacterVirtual_GetMaxHitsExceeded(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L296">Jolt/Physics/Character/CharacterVirtual.h:296</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetShapeOffset() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// An extra offset applied to the shape in local space. This allows applying an extra offset to the shape
|
|
/// in local space. Note that setting it on the fly can cause the shape to teleport into collision.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetShapeOffset() => Jolt.PInvoke.CharacterVirtual_GetShapeOffset(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L297">Jolt/Physics/Character/CharacterVirtual.h:297</see>
|
|
/// <br/>
|
|
/// <c>void SetShapeOffset(Vec3Arg inShapeOffset)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetShapeOffset(float3 shapeOffset) => Jolt.PInvoke.CharacterVirtual_SetShapeOffset(this, shapeOffset);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L300">Jolt/Physics/Character/CharacterVirtual.h:300</see>
|
|
/// <br/>
|
|
/// <c>uint64 GetUserData() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Access to the user data, can be used for anything by the application
|
|
/// </para>
|
|
/// </remarks>
|
|
public ulong GetUserData() => Jolt.PInvoke.CharacterVirtual_GetUserData(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L301">Jolt/Physics/Character/CharacterVirtual.h:301</see>
|
|
/// <br/>
|
|
/// <c>void SetUserData(uint64 inUserData)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetUserData(ulong userData) => Jolt.PInvoke.CharacterVirtual_SetUserData(this, userData);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L304">Jolt/Physics/Character/CharacterVirtual.h:304</see>
|
|
/// <br/>
|
|
/// <c>BodyID GetInnerBodyID() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Optional inner rigid body that proxies the character in the world. Can be used to update body
|
|
/// properties.
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetInnerBodyID() => Jolt.PInvoke.CharacterVirtual_GetInnerBodyID(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L310">Jolt/Physics/Character/CharacterVirtual.h:310</see>
|
|
/// <br/>
|
|
/// <c>Vec3 CancelVelocityTowardsSteepSlopes(Vec3Arg inDesiredVelocity) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// This function can be called prior to calling Update() to convert a desired velocity into a velocity that won't make the character move further onto steep slopes.
|
|
/// This velocity can then be set on the character using SetLinearVelocity()
|
|
/// @param inDesiredVelocity Velocity to clamp against steep walls
|
|
/// @return A new velocity vector that won't make the character move up steep slopes
|
|
/// </code>
|
|
/// </remarks>
|
|
public float3 CancelVelocityTowardsSteepSlopes(float3 desiredVelocity) => Jolt.PInvoke.CharacterVirtual_CancelVelocityTowardsSteepSlopes(this, desiredVelocity);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L316">Jolt/Physics/Character/CharacterVirtual.h:316</see>
|
|
/// <br/>
|
|
/// <c>void StartTrackingContactChanges()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// This function is internally called by Update, WalkStairs, StickToFloor and ExtendedUpdate and is responsible for tracking if contacts are added, persisted or removed.
|
|
/// If you want to do multiple operations on a character (e.g. first Update then WalkStairs), you can surround the code with a StartTrackingContactChanges and FinishTrackingContactChanges pair
|
|
/// to only receive a single callback per contact on the CharacterContactListener. If you don't do this then you could for example receive a contact added callback during the Update and a
|
|
/// contact persisted callback during WalkStairs.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void StartTrackingContactChanges() => Jolt.PInvoke.CharacterVirtual_StartTrackingContactChanges(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L319">Jolt/Physics/Character/CharacterVirtual.h:319</see>
|
|
/// <br/>
|
|
/// <c>void FinishTrackingContactChanges()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This call triggers contact removal callbacks and is used in conjunction with
|
|
/// StartTrackingContactChanges.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void FinishTrackingContactChanges() => Jolt.PInvoke.CharacterVirtual_FinishTrackingContactChanges(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L331">Jolt/Physics/Character/CharacterVirtual.h:331</see>
|
|
/// <br/>
|
|
/// <c>void Update(float inDeltaTime, Vec3Arg inGravity, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// This is the main update function. It moves the character according to its current velocity (the character is similar to a kinematic body in the sense
|
|
/// that you set the velocity and the character will follow unless collision is blocking the way). Note it's your own responsibility to apply gravity to the character velocity!
|
|
/// Different surface materials (like ice) can be emulated by getting the ground material and adjusting the velocity and/or the max slope angle accordingly every frame.
|
|
/// @param inDeltaTime Time step to simulate.
|
|
/// @param inGravity Gravity vector (m/s^2). This gravity vector is only used when the character is standing on top of another object to apply downward force.
|
|
/// @param inBroadPhaseLayerFilter Filter that is used to check if the character collides with something in the broadphase.
|
|
/// @param inObjectLayerFilter Filter that is used to check if a character collides with a layer.
|
|
/// @param inBodyFilter Filter that is used to check if a character collides with a body.
|
|
/// @param inShapeFilter Filter that is used to check if a character collides with a subshape.
|
|
/// @param inAllocator An allocator for temporary allocations. All memory will be freed by the time this function returns.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void Update(float deltaTime, float3 gravity, BroadPhaseLayerFilter broadPhaseLayerFilter, ObjectLayerFilter objectLayerFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter, TempAllocator allocator) => Jolt.PInvoke.CharacterVirtual_Update(this, deltaTime, gravity, broadPhaseLayerFilter, objectLayerFilter, bodyFilter, shapeFilter, allocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L336">Jolt/Physics/Character/CharacterVirtual.h:336</see>
|
|
/// <br/>
|
|
/// <c>bool CanWalkStairs(Vec3Arg inLinearVelocity) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// This function will return true if the character has moved into a slope that is too steep (e.g. a vertical wall).
|
|
/// You would call WalkStairs to attempt to step up stairs.
|
|
/// @param inLinearVelocity The linear velocity that the player desired. This is used to determine if we're pushing into a step.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool CanWalkStairs(float3 linearVelocity) => Jolt.PInvoke.CharacterVirtual_CanWalkStairs(this, linearVelocity);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L350">Jolt/Physics/Character/CharacterVirtual.h:350</see>
|
|
/// <br/>
|
|
/// <c>bool WalkStairs(float inDeltaTime, Vec3Arg inStepUp, Vec3Arg inStepForward, Vec3Arg inStepForwardTest, Vec3Arg inStepDownExtra, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// When stair walking is needed, you can call the WalkStairs function to cast up, forward and down again to try to find a valid position
|
|
/// @param inDeltaTime Time step to simulate.
|
|
/// @param inStepUp The direction and distance to step up (this corresponds to the max step height)
|
|
/// @param inStepForward The direction and distance to step forward after the step up
|
|
/// @param inStepForwardTest When running at a high frequency, inStepForward can be very small and it's likely that you hit the side of the stairs on the way down. This could produce a normal that violates the max slope angle. If this happens, we test again using this distance from the up position to see if we find a valid slope.
|
|
/// @param inStepDownExtra An additional translation that is added when stepping down at the end. Allows you to step further down than up. Set to zero if you don't want this. Should be in the opposite direction of up.
|
|
/// @param inBroadPhaseLayerFilter Filter that is used to check if the character collides with something in the broadphase.
|
|
/// @param inObjectLayerFilter Filter that is used to check if a character collides with a layer.
|
|
/// @param inBodyFilter Filter that is used to check if a character collides with a body.
|
|
/// @param inShapeFilter Filter that is used to check if a character collides with a subshape.
|
|
/// @param inAllocator An allocator for temporary allocations. All memory will be freed by the time this function returns.
|
|
/// @return true if the stair walk was successful
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool WalkStairs(float deltaTime, float3 stepUp, float3 stepForward, float3 stepForwardTest, float3 stepDownExtra, BroadPhaseLayerFilter broadPhaseLayerFilter, ObjectLayerFilter objectLayerFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter, TempAllocator allocator) => Jolt.PInvoke.CharacterVirtual_WalkStairs(this, deltaTime, stepUp, stepForward, stepForwardTest, stepDownExtra, broadPhaseLayerFilter, objectLayerFilter, bodyFilter, shapeFilter, allocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L362">Jolt/Physics/Character/CharacterVirtual.h:362</see>
|
|
/// <br/>
|
|
/// <c>bool StickToFloor(Vec3Arg inStepDown, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// This function can be used to artificially keep the character to the floor. Normally when a character is on a small step and starts moving horizontally, the character will
|
|
/// lose contact with the floor because the initial vertical velocity is zero while the horizontal velocity is quite high. To prevent the character from losing contact with the floor,
|
|
/// we do an additional collision check downwards and if we find the floor within a certain distance, we project the character onto the floor.
|
|
/// @param inStepDown Max amount to project the character downwards (if no floor is found within this distance, the function will return false)
|
|
/// @param inBroadPhaseLayerFilter Filter that is used to check if the character collides with something in the broadphase.
|
|
/// @param inObjectLayerFilter Filter that is used to check if a character collides with a layer.
|
|
/// @param inBodyFilter Filter that is used to check if a character collides with a body.
|
|
/// @param inShapeFilter Filter that is used to check if a character collides with a subshape.
|
|
/// @param inAllocator An allocator for temporary allocations. All memory will be freed by the time this function returns.
|
|
/// @return True if the character was successfully projected onto the floor.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool StickToFloor(float3 stepDown, BroadPhaseLayerFilter broadPhaseLayerFilter, ObjectLayerFilter objectLayerFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter, TempAllocator allocator) => Jolt.PInvoke.CharacterVirtual_StickToFloor(this, stepDown, broadPhaseLayerFilter, objectLayerFilter, bodyFilter, shapeFilter, allocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L387">Jolt/Physics/Character/CharacterVirtual.h:387</see>
|
|
/// <br/>
|
|
/// <c>void ExtendedUpdate(float inDeltaTime, Vec3Arg inGravity, const ExtendedUpdateSettings &inSettings, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// This function combines Update, StickToFloor and WalkStairs. This function serves as an example of how these functions could be combined.
|
|
/// Before calling, call SetLinearVelocity to update the horizontal/vertical speed of the character, typically this is:
|
|
/// - When on OnGround and not moving away from ground: velocity = GetGroundVelocity() + horizontal speed as input by player + optional vertical jump velocity + delta time * gravity
|
|
/// - Else: velocity = current vertical velocity + horizontal speed as input by player + delta time * gravity
|
|
/// @param inDeltaTime Time step to simulate.
|
|
/// @param inGravity Gravity vector (m/s^2). This gravity vector is only used when the character is standing on top of another object to apply downward force.
|
|
/// @param inSettings A structure containing settings for the algorithm.
|
|
/// @param inBroadPhaseLayerFilter Filter that is used to check if the character collides with something in the broadphase.
|
|
/// @param inObjectLayerFilter Filter that is used to check if a character collides with a layer.
|
|
/// @param inBodyFilter Filter that is used to check if a character collides with a body.
|
|
/// @param inShapeFilter Filter that is used to check if a character collides with a subshape.
|
|
/// @param inAllocator An allocator for temporary allocations. All memory will be freed by the time this function returns.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void ExtendedUpdate(float deltaTime, float3 gravity, ref CharacterVirtual.ExtendedUpdateSettings settings, BroadPhaseLayerFilter broadPhaseLayerFilter, ObjectLayerFilter objectLayerFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter, TempAllocator allocator) => Jolt.PInvoke.CharacterVirtual_ExtendedUpdate(this, deltaTime, gravity, ref settings, broadPhaseLayerFilter, objectLayerFilter, bodyFilter, shapeFilter, allocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L390">Jolt/Physics/Character/CharacterVirtual.h:390</see>
|
|
/// <br/>
|
|
/// <c>void RefreshContacts(const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function can be used after a character has teleported to determine the new contacts with the world.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void RefreshContacts(BroadPhaseLayerFilter broadPhaseLayerFilter, ObjectLayerFilter objectLayerFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter, TempAllocator allocator) => Jolt.PInvoke.CharacterVirtual_RefreshContacts(this, broadPhaseLayerFilter, objectLayerFilter, bodyFilter, shapeFilter, allocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L394">Jolt/Physics/Character/CharacterVirtual.h:394</see>
|
|
/// <br/>
|
|
/// <c>void UpdateGroundVelocity()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Use the ground body ID to get an updated estimate of the ground velocity. This function can be used if the ground body has moved / changed velocity and you want a new estimate of the ground velocity.
|
|
/// It will not perform collision detection, so is less accurate than RefreshContacts but a lot faster.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void UpdateGroundVelocity() => Jolt.PInvoke.CharacterVirtual_UpdateGroundVelocity(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L405">Jolt/Physics/Character/CharacterVirtual.h:405</see>
|
|
/// <br/>
|
|
/// <c>bool SetShape(const Shape *inShape, float inMaxPenetrationDepth, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Switch the shape of the character (e.g. for stance).
|
|
/// @param inShape The shape to switch to.
|
|
/// @param inMaxPenetrationDepth When inMaxPenetrationDepth is not FLT_MAX, it checks if the new shape collides before switching shape. This is the max penetration we're willing to accept after the switch.
|
|
/// @param inBroadPhaseLayerFilter Filter that is used to check if the character collides with something in the broadphase.
|
|
/// @param inObjectLayerFilter Filter that is used to check if a character collides with a layer.
|
|
/// @param inBodyFilter Filter that is used to check if a character collides with a body.
|
|
/// @param inShapeFilter Filter that is used to check if a character collides with a subshape.
|
|
/// @param inAllocator An allocator for temporary allocations. All memory will be freed by the time this function returns.
|
|
/// @return Returns true if the switch succeeded.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool SetShape(Shape shape, float maxPenetrationDepth, BroadPhaseLayerFilter broadPhaseLayerFilter, ObjectLayerFilter objectLayerFilter, BodyFilter bodyFilter, ShapeFilter shapeFilter, TempAllocator allocator) => Jolt.PInvoke.CharacterVirtual_SetShape(this, shape, maxPenetrationDepth, broadPhaseLayerFilter, objectLayerFilter, bodyFilter, shapeFilter, allocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L408">Jolt/Physics/Character/CharacterVirtual.h:408</see>
|
|
/// <br/>
|
|
/// <c>void SetInnerBodyShape(const Shape *inShape)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Updates the shape of the inner rigid body. Should be called after a successful call to SetShape.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetInnerBodyShape(Shape shape) => Jolt.PInvoke.CharacterVirtual_SetInnerBodyShape(this, shape);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L513">Jolt/Physics/Character/CharacterVirtual.h:513</see>
|
|
/// <br/>
|
|
/// <c>bool HasCollidedWith(const BodyID &inBody) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Check if the character is currently in contact with or has collided with another body in the last
|
|
/// operation (e.g. Update or WalkStairs)
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool HasCollidedWith(uint body) => Jolt.PInvoke.CharacterVirtual_HasCollidedWith(this, body);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L522">Jolt/Physics/Character/CharacterVirtual.h:522</see>
|
|
/// <br/>
|
|
/// <c>bool HasCollidedWith(const CharacterID &inCharacterID) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Check if the character is currently in contact with or has collided with another character in the last
|
|
/// time step (e.g. Update or WalkStairs)
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool HasCollidedWith(CharacterID characterID) => Jolt.PInvoke.CharacterVirtual_HasCollidedWith_2(this, characterID);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Character/CharacterVirtual.h#L531">Jolt/Physics/Character/CharacterVirtual.h:531</see>
|
|
/// <br/>
|
|
/// <c>bool HasCollidedWith(const CharacterVirtual *inCharacter) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Check if the character is currently in contact with or has collided with another character in the last
|
|
/// time step (e.g. Update or WalkStairs)
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool HasCollidedWith(CharacterVirtual character) => Jolt.PInvoke.CharacterVirtual_HasCollidedWith_3(this, character);
|
|
public void AddRef() => Jolt.PInvoke.CharacterVirtual_AddRef(this);
|
|
public void Release() => Jolt.PInvoke.CharacterVirtual_Release(this);
|
|
public uint GetRefCount() => Jolt.PInvoke.CharacterVirtual_GetRefCount(this);
|
|
public static implicit operator CharacterBase(CharacterVirtual value) => Jolt.PInvoke.CharacterVirtual_AsCharacterBase(value);
|
|
public void Dispose()
|
|
{
|
|
if (IsNull()) return;
|
|
Release();
|
|
}
|
|
}
|
|
}
|