//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:28
///
/// class MotionProperties
///
///
///
///
/// The Body class only keeps track of state for static bodies, the MotionProperties class keeps the additional
/// state needed for a moving Body. It has a 1-on-1 relationship with the body.
///
///
[InteropHandle]
public readonly partial struct MotionProperties
{
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:34
///
/// EMotionQuality GetMotionQuality() const
///
///
///
///
/// Motion quality, or how well it detects collisions when it has a high velocity
///
///
public EMotionQuality GetMotionQuality() => Jolt.PInvoke.MotionProperties_GetMotionQuality(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:37
///
/// inline EAllowedDOFs GetAllowedDOFs() const
///
///
///
///
/// Get the allowed degrees of freedom that this body has (this can be changed by calling SetMassProperties)
///
///
public EAllowedDOFs GetAllowedDOFs() => Jolt.PInvoke.MotionProperties_GetAllowedDOFs(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:40
///
/// inline bool GetAllowSleeping() const
///
///
///
///
/// If this body can go to sleep.
///
///
public bool GetAllowSleeping() => Jolt.PInvoke.MotionProperties_GetAllowSleeping(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:43
///
/// inline Vec3 GetLinearVelocity() const
///
///
///
///
/// Get world space linear velocity of the center of mass
///
///
public float3 GetLinearVelocity() => Jolt.PInvoke.MotionProperties_GetLinearVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:46
///
/// void SetLinearVelocity(Vec3Arg inLinearVelocity)
///
///
///
///
/// Set world space linear velocity of the center of mass
///
///
public void SetLinearVelocity(float3 linearVelocity) => Jolt.PInvoke.MotionProperties_SetLinearVelocity(this, linearVelocity);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:49
///
/// void SetLinearVelocityClamped(Vec3Arg inLinearVelocity)
///
///
///
///
/// Set world space linear velocity of the center of mass, will make sure the value is clamped against the
/// maximum linear velocity
///
///
public void SetLinearVelocityClamped(float3 linearVelocity) => Jolt.PInvoke.MotionProperties_SetLinearVelocityClamped(this, linearVelocity);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:52
///
/// inline Vec3 GetAngularVelocity() const
///
///
///
///
/// Get world space angular velocity of the center of mass
///
///
public float3 GetAngularVelocity() => Jolt.PInvoke.MotionProperties_GetAngularVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:55
///
/// void SetAngularVelocity(Vec3Arg inAngularVelocity)
///
///
///
///
/// Set world space angular velocity of the center of mass
///
///
public void SetAngularVelocity(float3 angularVelocity) => Jolt.PInvoke.MotionProperties_SetAngularVelocity(this, angularVelocity);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:58
///
/// void SetAngularVelocityClamped(Vec3Arg inAngularVelocity)
///
///
///
///
/// Set world space angular velocity of the center of mass, will make sure the value is clamped against the
/// maximum angular velocity
///
///
public void SetAngularVelocityClamped(float3 angularVelocity) => Jolt.PInvoke.MotionProperties_SetAngularVelocityClamped(this, angularVelocity);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:61
///
/// inline void MoveKinematic(Vec3Arg inDeltaPosition, QuatArg inDeltaRotation, float inDeltaTime)
///
///
///
///
/// Set velocity of body such that it will be rotate/translate by inDeltaPosition/Rotation in inDeltaTime
/// seconds.
///
///
public void MoveKinematic(float3 deltaPosition, floatQuat deltaRotation, float deltaTime) => Jolt.PInvoke.MotionProperties_MoveKinematic(this, deltaPosition, deltaRotation, deltaTime);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:67
///
/// inline float GetMaxLinearVelocity() const
///
///
///
///
/// Maximum linear velocity that a body can achieve. Used to prevent the system from exploding.
///
///
public float GetMaxLinearVelocity() => Jolt.PInvoke.MotionProperties_GetMaxLinearVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:68
///
/// inline void SetMaxLinearVelocity(float inLinearVelocity)
///
///
public void SetMaxLinearVelocity(float linearVelocity) => Jolt.PInvoke.MotionProperties_SetMaxLinearVelocity(this, linearVelocity);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:71
///
/// inline float GetMaxAngularVelocity() const
///
///
///
///
/// Maximum angular velocity that a body can achieve. Used to prevent the system from exploding.
///
///
public float GetMaxAngularVelocity() => Jolt.PInvoke.MotionProperties_GetMaxAngularVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:72
///
/// inline void SetMaxAngularVelocity(float inAngularVelocity)
///
///
public void SetMaxAngularVelocity(float angularVelocity) => Jolt.PInvoke.MotionProperties_SetMaxAngularVelocity(this, angularVelocity);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:76
///
/// inline void ClampLinearVelocity()
///
///
///
///
/// Clamp velocity according to limit
///
///
public void ClampLinearVelocity() => Jolt.PInvoke.MotionProperties_ClampLinearVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:77
///
/// inline void ClampAngularVelocity()
///
///
public void ClampAngularVelocity() => Jolt.PInvoke.MotionProperties_ClampAngularVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:80
///
/// inline float GetLinearDamping() const
///
///
///
///
/// Get linear damping: dv/dt = -c * v. c. Value should be zero or positive and is usually close to 0.
///
///
public float GetLinearDamping() => Jolt.PInvoke.MotionProperties_GetLinearDamping(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:81
///
/// void SetLinearDamping(float inLinearDamping)
///
///
public void SetLinearDamping(float linearDamping) => Jolt.PInvoke.MotionProperties_SetLinearDamping(this, linearDamping);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:84
///
/// inline float GetAngularDamping() const
///
///
///
///
/// Get angular damping: dw/dt = -c * w. c. Value should be zero or positive and is usually close to 0.
///
///
public float GetAngularDamping() => Jolt.PInvoke.MotionProperties_GetAngularDamping(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:85
///
/// void SetAngularDamping(float inAngularDamping)
///
///
public void SetAngularDamping(float angularDamping) => Jolt.PInvoke.MotionProperties_SetAngularDamping(this, angularDamping);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:88
///
/// inline float GetGravityFactor() const
///
///
///
///
/// Get gravity factor (1 = normal gravity, 0 = no gravity)
///
///
public float GetGravityFactor() => Jolt.PInvoke.MotionProperties_GetGravityFactor(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:89
///
/// void SetGravityFactor(float inGravityFactor)
///
///
public void SetGravityFactor(float gravityFactor) => Jolt.PInvoke.MotionProperties_SetGravityFactor(this, gravityFactor);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:92
///
/// void SetMassProperties(EAllowedDOFs inAllowedDOFs, const MassProperties &inMassProperties)
///
///
///
///
/// Set the mass and inertia tensor
///
///
public void SetMassProperties(EAllowedDOFs allowedDOFs, MassProperties massProperties) => Jolt.PInvoke.MotionProperties_SetMassProperties(this, allowedDOFs, massProperties);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:95
///
/// inline float GetInverseMass() const
///
///
///
///
/// Get inverse mass (1 / mass). Should only be called on a dynamic object (static or kinematic bodies have
/// infinite mass so should be treated as 1 / mass = 0)
///
///
public float GetInverseMass() => Jolt.PInvoke.MotionProperties_GetInverseMass(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:96
///
/// inline float GetInverseMassUnchecked() const
///
///
public float GetInverseMassUnchecked() => Jolt.PInvoke.MotionProperties_GetInverseMassUnchecked(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:102
///
/// void SetInverseMass(float inInverseMass)
///
///
///
///
/// Set the inverse mass (1 / mass).
/// Note that mass and inertia are linearly related (e.g. inertia of a sphere with mass m and radius r is \f$2/5 \: m \: r^2\f$).
/// If you change mass, inertia should probably change as well. You can use ScaleToMass to update mass and inertia at the same time.
/// If all your translation degrees of freedom are restricted, make sure this is zero (see EAllowedDOFs).
///
///
public void SetInverseMass(float inverseMass) => Jolt.PInvoke.MotionProperties_SetInverseMass(this, inverseMass);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:105
///
/// inline Vec3 GetInverseInertiaDiagonal() const
///
///
///
///
/// Diagonal of inverse inertia matrix: D. Should only be called on a dynamic object (static or kinematic
/// bodies have infinite mass so should be treated as D = 0)
///
///
public float3 GetInverseInertiaDiagonal() => Jolt.PInvoke.MotionProperties_GetInverseInertiaDiagonal(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:108
///
/// inline Quat GetInertiaRotation() const
///
///
///
///
/// Rotation (R) that takes inverse inertia diagonal to local space: \f$I_{body}^{-1} = R \: D \: R^{-1}\f$
///
///
public floatQuat GetInertiaRotation() => Jolt.PInvoke.MotionProperties_GetInertiaRotation(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:114
///
/// void SetInverseInertia(Vec3Arg inDiagonal, QuatArg inRot)
///
///
///
///
/// Set the inverse inertia tensor in local space by setting the diagonal and the rotation: \f$I_{body}^{-1} = R \: D \: R^{-1}\f$.
/// Note that mass and inertia are linearly related (e.g. inertia of a sphere with mass m and radius r is \f$2/5 \: m \: r^2\f$).
/// If you change inertia, mass should probably change as well. You can use ScaleToMass to update mass and inertia at the same time.
/// If all your rotation degrees of freedom are restricted, make sure this is zero (see EAllowedDOFs).
///
///
public void SetInverseInertia(float3 diagonal, floatQuat rot) => Jolt.PInvoke.MotionProperties_SetInverseInertia(this, diagonal, rot);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:118
///
/// void ScaleToMass(float inMass)
///
///
///
///
/// Sets the mass to inMass and scale the inertia tensor based on the ratio between the old and new mass.
/// Note that this only works when the current mass is finite (i.e. the body is dynamic and translational degrees of freedom are not restricted).
///
///
public void ScaleToMass(float mass) => Jolt.PInvoke.MotionProperties_ScaleToMass(this, mass);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:121
///
/// inline Mat44 GetLocalSpaceInverseInertia() const
///
///
///
///
/// Get inverse inertia matrix (\f$I_{body}^{-1}\f$). Will be a matrix of zeros for a static or kinematic
/// object.
///
///
public float4x4 GetLocalSpaceInverseInertia() => Jolt.PInvoke.MotionProperties_GetLocalSpaceInverseInertia(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:124
///
/// inline Mat44 GetLocalSpaceInverseInertiaUnchecked() const
///
///
///
///
/// Same as GetLocalSpaceInverseInertia() but doesn't check if the body is dynamic
///
///
public float4x4 GetLocalSpaceInverseInertiaUnchecked() => Jolt.PInvoke.MotionProperties_GetLocalSpaceInverseInertiaUnchecked(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:127
///
/// inline Mat44 GetInverseInertiaForRotation(Mat44Arg inRotation) const
///
///
///
///
/// Get inverse inertia matrix (\f$I^{-1}\f$) for a given object rotation (translation will be ignored).
/// Zero if object is static or kinematic.
///
///
public float4x4 GetInverseInertiaForRotation(float4x4 rotation) => Jolt.PInvoke.MotionProperties_GetInverseInertiaForRotation(this, rotation);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:130
///
/// Vec3 MultiplyWorldSpaceInverseInertiaByVector(QuatArg inBodyRotation, Vec3Arg inV) const
///
///
///
///
/// Multiply a vector with the inverse world space inertia tensor (\f$I_{world}^{-1}\f$). Zero if object is
/// static or kinematic.
///
///
public float3 MultiplyWorldSpaceInverseInertiaByVector(floatQuat bodyRotation, float3 v) => Jolt.PInvoke.MotionProperties_MultiplyWorldSpaceInverseInertiaByVector(this, bodyRotation, v);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:133
///
/// Vec3 GetPointVelocityCOM(Vec3Arg inPointRelativeToCOM) const
///
///
///
///
/// Velocity of point inPoint (in center of mass space, e.g. on the surface of the body) of the body (unit:
/// m/s)
///
///
public float3 GetPointVelocityCOM(float3 pointRelativeToCOM) => Jolt.PInvoke.MotionProperties_GetPointVelocityCOM(this, pointRelativeToCOM);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:136
///
/// Vec3 GetAccumulatedForce() const
///
///
///
///
/// Get the total amount of force applied to the center of mass this time step (through Body::AddForce
/// calls). Note that it will reset to zero after PhysicsSystem::Update.
///
///
public float3 GetAccumulatedForce() => Jolt.PInvoke.MotionProperties_GetAccumulatedForce(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:139
///
/// Vec3 GetAccumulatedTorque() const
///
///
///
///
/// Get the total amount of torque applied to the center of mass this time step (through
/// Body::AddForce/Body::AddTorque calls). Note that it will reset to zero after PhysicsSystem::Update.
///
///
public float3 GetAccumulatedTorque() => Jolt.PInvoke.MotionProperties_GetAccumulatedTorque(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:142
///
/// void ResetForce()
///
///
///
///
/// Reset the total accumulated force, note that this will be done automatically after every time step.
///
///
public void ResetForce() => Jolt.PInvoke.MotionProperties_ResetForce(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:145
///
/// void ResetTorque()
///
///
///
///
/// Reset the total accumulated torque, note that this will be done automatically after every time step.
///
///
public void ResetTorque() => Jolt.PInvoke.MotionProperties_ResetTorque(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:148
///
/// void ResetMotion()
///
///
///
///
/// Reset the current velocity and accumulated force and torque.
///
///
public void ResetMotion() => Jolt.PInvoke.MotionProperties_ResetMotion(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:163
///
/// Vec3 LockTranslation(Vec3Arg inV) const
///
///
///
///
/// Takes a translation vector inV and returns a vector where the components that are not allowed by
/// mAllowedDOFs are set to 0
///
///
public float3 LockTranslation(float3 v) => Jolt.PInvoke.MotionProperties_LockTranslation(this, v);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:176
///
/// Vec3 LockAngular(Vec3Arg inV) const
///
///
///
///
/// Takes an angular velocity / torque vector inV and returns a vector where the components that are not
/// allowed by mAllowedDOFs are set to 0
///
///
public float3 LockAngular(float3 v) => Jolt.PInvoke.MotionProperties_LockAngular(this, v);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:182
///
/// void SetNumVelocityStepsOverride(uint inN)
///
///
///
///
/// Used only when this body is dynamic and colliding. Override for the number of solver velocity iterations
/// to run, 0 means use the default in PhysicsSettings::mNumVelocitySteps. The number of iterations to use
/// is the max of all contacts and constraints in the island.
///
///
public void SetNumVelocityStepsOverride(uint n) => Jolt.PInvoke.MotionProperties_SetNumVelocityStepsOverride(this, n);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:183
///
/// uint GetNumVelocityStepsOverride() const
///
///
public uint GetNumVelocityStepsOverride() => Jolt.PInvoke.MotionProperties_GetNumVelocityStepsOverride(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:186
///
/// void SetNumPositionStepsOverride(uint inN)
///
///
///
///
/// Used only when this body is dynamic and colliding. Override for the number of solver position iterations
/// to run, 0 means use the default in PhysicsSettings::mNumPositionSteps. The number of iterations to use
/// is the max of all contacts and constraints in the island.
///
///
public void SetNumPositionStepsOverride(uint n) => Jolt.PInvoke.MotionProperties_SetNumPositionStepsOverride(this, n);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:187
///
/// uint GetNumPositionStepsOverride() const
///
///
public uint GetNumPositionStepsOverride() => Jolt.PInvoke.MotionProperties_GetNumPositionStepsOverride(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:217
///
/// inline void AddLinearVelocityStep(Vec3Arg inLinearVelocityChange)
///
///
///
///
/// @name Update linear and angular velocity (used during constraint solving)
/// @{
///
///
public void AddLinearVelocityStep(float3 linearVelocityChange) => Jolt.PInvoke.MotionProperties_AddLinearVelocityStep(this, linearVelocityChange);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:218
///
/// inline void SubLinearVelocityStep(Vec3Arg inLinearVelocityChange)
///
///
public void SubLinearVelocityStep(float3 linearVelocityChange) => Jolt.PInvoke.MotionProperties_SubLinearVelocityStep(this, linearVelocityChange);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:219
///
/// inline void AddAngularVelocityStep(Vec3Arg inAngularVelocityChange)
///
///
public void AddAngularVelocityStep(float3 angularVelocityChange) => Jolt.PInvoke.MotionProperties_AddAngularVelocityStep(this, angularVelocityChange);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:220
///
/// inline void SubAngularVelocityStep(Vec3Arg inAngularVelocityChange)
///
///
public void SubAngularVelocityStep(float3 angularVelocityChange) => Jolt.PInvoke.MotionProperties_SubAngularVelocityStep(this, angularVelocityChange);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:224
///
/// inline void ApplyGyroscopicForceInternal(QuatArg inBodyRotation, float inDeltaTime)
///
///
///
///
/// Apply the gyroscopic force (aka Dzhanibekov effect, see
/// https://en.wikipedia.org/wiki/Tennis_racket_theorem)
///
///
public void ApplyGyroscopicForceInternal(floatQuat bodyRotation, float deltaTime) => Jolt.PInvoke.MotionProperties_ApplyGyroscopicForceInternal(this, bodyRotation, deltaTime);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:227
///
/// inline void ApplyForceTorqueAndDragInternal(QuatArg inBodyRotation, Vec3Arg inGravity, float inDeltaTime)
///
///
///
///
/// Apply all accumulated forces, torques and drag (should only be called by the PhysicsSystem)
///
///
public void ApplyForceTorqueAndDragInternal(floatQuat bodyRotation, float3 gravity, float deltaTime) => Jolt.PInvoke.MotionProperties_ApplyForceTorqueAndDragInternal(this, bodyRotation, gravity, deltaTime);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:230
///
/// uint32 GetIslandIndexInternal() const
///
///
///
///
/// Access to the island index
///
///
public uint GetIslandIndexInternal() => Jolt.PInvoke.MotionProperties_GetIslandIndexInternal(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:231
///
/// void SetIslandIndexInternal(uint32 inIndex)
///
///
public void SetIslandIndexInternal(uint index) => Jolt.PInvoke.MotionProperties_SetIslandIndexInternal(this, index);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:234
///
/// uint32 GetIndexInActiveBodiesInternal() const
///
///
///
///
/// Access to the index in the active bodies array
///
///
public uint GetIndexInActiveBodiesInternal() => Jolt.PInvoke.MotionProperties_GetIndexInActiveBodiesInternal(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:244
///
/// inline void ResetSleepTestTimer()
///
///
///
///
/// Reset the sleep test timer without resetting the sleep test spheres
///
///
public void ResetSleepTestTimer() => Jolt.PInvoke.MotionProperties_ResetSleepTestTimer(this);
///
///
/// C++:
/// Jolt/Physics/Body/MotionProperties.h:247
///
/// inline ECanSleep AccumulateSleepTime(float inDeltaTime, float inTimeBeforeSleep)
///
///
///
///
/// Accumulate sleep time and return if a body can go to sleep
///
///
public ECanSleep AccumulateSleepTime(float deltaTime, float timeBeforeSleep) => Jolt.PInvoke.MotionProperties_AccumulateSleepTime(this, deltaTime, timeBeforeSleep);
}
}