//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:34
///
/// class SoftBodyMotionProperties : public MotionProperties
///
///
///
///
/// This class contains the runtime information of a soft body.
///
/// Based on: XPBD, Extended Position Based Dynamics, Matthias Muller, Ten Minute Physics
/// See: https://matthias-research.github.io/pages/tenMinutePhysics/09-xpbd.pdf
///
///
[InteropHandle]
public readonly partial struct SoftBodyMotionProperties : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:166
///
/// enum class EStatus
///
///
///
///
/// Return code for ParallelUpdate
///
///
[Flags]
public enum EStatus : int
{
///
///
/// No work was done because other threads were still working on a batch that cannot run concurrently
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:168
///
/// NoWork = 1 << 0
///
///
NoWork = 1 << 0,
///
///
/// Work was done to progress the update
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:169
///
/// DidWork = 1 << 1
///
///
DidWork = 1 << 1,
///
///
/// All work is done
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:170
///
/// Done = 1 << 2
///
///
Done = 1 << 2,
}
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:184
///
/// struct LeafShape
///
///
///
///
/// Information about a leaf shape that we're colliding with
///
///
[StructLayout(LayoutKind.Explicit, Size = 96)]
public struct LeafShape
{
///
///
/// Transform of the shape relative to the soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:189
///
/// Mat44 mTransform
///
///
[FieldOffset(0)]
public float4x4 mTransform;
///
///
/// Scale of the shape
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:190
///
/// Vec3 mScale
///
///
[FieldOffset(64)]
public float3 mScale;
///
///
/// Shape
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:191
///
/// RefConst<Shape> mShape
///
///
[FieldOffset(80)]
public Shape mShape;
}
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:229
///
/// struct RodState
///
///
///
///
/// Information about the current state of a rod.
///
///
[StructLayout(LayoutKind.Explicit, Size = 32)]
public struct RodState
{
///
///
/// Rotation of the rod, relative to center of mass transform
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:231
///
/// Quat mRotation
///
///
[FieldOffset(0)]
public floatQuat mRotation;
}
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:240
///
/// struct SkinState
///
///
///
///
/// Information about the state of all skinned vertices
///
///
[StructLayout(LayoutKind.Explicit, Size = 48)]
public struct SkinState
{
///
///
/// Previous position of the skinned vertex, used to interpolate between the previous and current
/// position
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:242
///
/// Vec3 mPreviousPosition = Vec3::sZero()
///
///
[FieldOffset(0)]
public float3 mPreviousPosition;
///
///
/// Current position of the skinned vertex
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:243
///
/// Vec3 mPosition = Vec3::sNaN()
///
///
[FieldOffset(16)]
public float3 mPosition;
///
///
/// Normal of the skinned vertex
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:244
///
/// Vec3 mNormal = Vec3::sNaN()
///
///
[FieldOffset(32)]
public float3 mNormal;
}
public static SoftBodyMotionProperties Create() => Jolt.PInvoke.SoftBodyMotionProperties_Create();
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:50
///
/// void Initialize(const SoftBodyCreationSettings &inSettings)
///
///
///
///
/// Initialize the soft body motion properties
///
///
public void Initialize(SoftBodyCreationSettings settings) => Jolt.PInvoke.SoftBodyMotionProperties_Initialize(this, settings);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:53
///
/// const SoftBodySharedSettings * GetSettings() const
///
///
///
///
/// Get the shared settings of the soft body
///
///
public SoftBodySharedSettings GetSettings() => Jolt.PInvoke.SoftBodyMotionProperties_GetSettings(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:64
///
/// Quat GetRodRotation(uint inIndex) const
///
///
///
///
/// Access to the state of rods
///
///
public floatQuat GetRodRotation(uint index) => Jolt.PInvoke.SoftBodyMotionProperties_GetRodRotation(this, index);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:65
///
/// Vec3 GetRodAngularVelocity(uint inIndex) const
///
///
public float3 GetRodAngularVelocity(uint index) => Jolt.PInvoke.SoftBodyMotionProperties_GetRodAngularVelocity(this, index);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:77
///
/// uint32 GetNumIterations() const
///
///
///
///
/// Get the number of solver iterations
///
///
public uint GetNumIterations() => Jolt.PInvoke.SoftBodyMotionProperties_GetNumIterations(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:78
///
/// void SetNumIterations(uint32 inNumIterations)
///
///
public void SetNumIterations(uint numIterations) => Jolt.PInvoke.SoftBodyMotionProperties_SetNumIterations(this, numIterations);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:81
///
/// float GetPressure() const
///
///
///
///
/// Get the pressure of the soft body
///
///
public float GetPressure() => Jolt.PInvoke.SoftBodyMotionProperties_GetPressure(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:82
///
/// void SetPressure(float inPressure)
///
///
public void SetPressure(float pressure) => Jolt.PInvoke.SoftBodyMotionProperties_SetPressure(this, pressure);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:85
///
/// bool GetUpdatePosition() const
///
///
///
///
/// Update the position of the body while simulating (set to false for something that is attached to the
/// static world)
///
///
public bool GetUpdatePosition() => Jolt.PInvoke.SoftBodyMotionProperties_GetUpdatePosition(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:86
///
/// void SetUpdatePosition(bool inUpdatePosition)
///
///
public void SetUpdatePosition(bool updatePosition) => Jolt.PInvoke.SoftBodyMotionProperties_SetUpdatePosition(this, updatePosition);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:89
///
/// bool GetFacesDoubleSided() const
///
///
///
///
/// If the faces in this soft body should be treated as double sided for the purpose of collision detection
/// (ray cast / collide shape / cast shape)
///
///
public bool GetFacesDoubleSided() => Jolt.PInvoke.SoftBodyMotionProperties_GetFacesDoubleSided(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:90
///
/// void SetFacesDoubleSided(bool inDoubleSided)
///
///
public void SetFacesDoubleSided(bool doubleSided) => Jolt.PInvoke.SoftBodyMotionProperties_SetFacesDoubleSided(this, doubleSided);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:93
///
/// bool GetEnableSkinConstraints() const
///
///
///
///
/// Global setting to turn on/off skin constraints
///
///
public bool GetEnableSkinConstraints() => Jolt.PInvoke.SoftBodyMotionProperties_GetEnableSkinConstraints(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:94
///
/// void SetEnableSkinConstraints(bool inEnableSkinConstraints)
///
///
public void SetEnableSkinConstraints(bool enableSkinConstraints) => Jolt.PInvoke.SoftBodyMotionProperties_SetEnableSkinConstraints(this, enableSkinConstraints);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:97
///
/// float GetSkinnedMaxDistanceMultiplier() const
///
///
///
///
/// Multiplier applied to Skinned::mMaxDistance to allow tightening or loosening of the skin constraints. 0
/// to hard skin all vertices.
///
///
public float GetSkinnedMaxDistanceMultiplier() => Jolt.PInvoke.SoftBodyMotionProperties_GetSkinnedMaxDistanceMultiplier(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:98
///
/// void SetSkinnedMaxDistanceMultiplier(float inSkinnedMaxDistanceMultiplier)
///
///
public void SetSkinnedMaxDistanceMultiplier(float skinnedMaxDistanceMultiplier) => Jolt.PInvoke.SoftBodyMotionProperties_SetSkinnedMaxDistanceMultiplier(this, skinnedMaxDistanceMultiplier);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:101
///
/// float GetVertexRadius() const
///
///
///
///
/// How big the particles are, can be used to push the vertices a little bit away from the surface of other
/// bodies to prevent z-fighting
///
///
public float GetVertexRadius() => Jolt.PInvoke.SoftBodyMotionProperties_GetVertexRadius(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:102
///
/// void SetVertexRadius(float inVertexRadius)
///
///
public void SetVertexRadius(float vertexRadius) => Jolt.PInvoke.SoftBodyMotionProperties_SetVertexRadius(this, vertexRadius);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:105
///
/// const AABox & GetLocalBounds() const
///
///
///
///
/// Get local bounding box
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public AABox GetLocalBounds() => Jolt.PInvoke.SoftBodyMotionProperties_GetLocalBounds(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:108
///
/// float GetVolume() const
///
///
///
///
/// Get the volume of the soft body. Note can become negative if the shape is inside out!
///
///
public float GetVolume() => Jolt.PInvoke.SoftBodyMotionProperties_GetVolume(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:111
///
/// void CalculateMassAndInertia()
///
///
///
///
/// Calculate the total mass and inertia of this body based on the current state of the vertices
///
///
public void CalculateMassAndInertia() => Jolt.PInvoke.SoftBodyMotionProperties_CalculateMassAndInertia(this);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:115
///
/// void DrawVertices(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform) const
///
///
///
///
/// Draw the state of a soft body
///
///
public void DrawVertices(DebugRenderer renderer, float4x4 centerOfMassTransform) => Jolt.PInvoke.SoftBodyMotionProperties_DrawVertices(this, renderer, centerOfMassTransform);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:116
///
/// void DrawVertexVelocities(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform) const
///
///
public void DrawVertexVelocities(DebugRenderer renderer, float4x4 centerOfMassTransform) => Jolt.PInvoke.SoftBodyMotionProperties_DrawVertexVelocities(this, renderer, centerOfMassTransform);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:117
///
/// void DrawEdgeConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawEdgeConstraints(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawEdgeConstraints(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:118
///
/// void DrawRods(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawRods(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawRods(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:119
///
/// void DrawRodStates(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawRodStates(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawRodStates(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:120
///
/// void DrawRodBendTwistConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawRodBendTwistConstraints(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawRodBendTwistConstraints(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:121
///
/// void DrawBendConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawBendConstraints(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawBendConstraints(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:122
///
/// void DrawVolumeConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawVolumeConstraints(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawVolumeConstraints(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:123
///
/// void DrawSkinConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawSkinConstraints(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawSkinConstraints(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:124
///
/// void DrawLRAConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const
///
///
public void DrawLRAConstraints(DebugRenderer renderer, float4x4 centerOfMassTransform, ESoftBodyConstraintColor constraintColor) => Jolt.PInvoke.SoftBodyMotionProperties_DrawLRAConstraints(this, renderer, centerOfMassTransform, constraintColor);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:125
///
/// void DrawPredictedBounds(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform) const
///
///
public void DrawPredictedBounds(DebugRenderer renderer, float4x4 centerOfMassTransform) => Jolt.PInvoke.SoftBodyMotionProperties_DrawPredictedBounds(this, renderer, centerOfMassTransform);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:153
///
/// void CustomUpdate(float inDeltaTime, Body &ioSoftBody, PhysicsSystem &inSystem)
///
///
///
///
/// This function allows you to update the soft body immediately without going through the PhysicsSystem.
/// This is useful if the soft body is teleported and needs to 'settle' or it can be used if a the soft body
/// is not added to the PhysicsSystem and needs to be updated manually. One reason for not adding it to the
/// PhysicsSystem is that you might want to update a soft body immediately after updating an animated object
/// that has the soft body attached to it. If the soft body is added to the PhysicsSystem it will be updated
/// by it, so calling this function will effectively update it twice. Note that when you use this function,
/// only the current thread will be used, whereas if you update through the PhysicsSystem, multiple threads may
/// be used.
/// Note that this will bypass any sleep checks. Since the dynamic objects that the soft body touches
/// will not move during this call, there can be simulation artifacts if you call this function multiple times
/// without running the physics simulation step.
///
///
public void CustomUpdate(float deltaTime, Body softBody, PhysicsSystem system) => Jolt.PInvoke.SoftBodyMotionProperties_CustomUpdate(this, deltaTime, softBody, system);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:160
///
/// void InitializeUpdateContext(float inDeltaTime, Body &inSoftBody, const PhysicsSystem &inSystem, SoftBodyUpdateContext &ioContext)
///
///
///
///
/// Initialize the update context. Not part of the public API.
///
///
public void InitializeUpdateContext(float deltaTime, Body softBody, PhysicsSystem system, SoftBodyUpdateContext context) => Jolt.PInvoke.SoftBodyMotionProperties_InitializeUpdateContext(this, deltaTime, softBody, system, context);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:163
///
/// void DetermineCollidingShapes(const SoftBodyUpdateContext &inContext, const PhysicsSystem &inSystem, const BodyLockInterface &inBodyLockInterface)
///
///
///
///
/// Do a broad phase check and collect all bodies that can possibly collide with this soft body. Not part of
/// the public API.
///
///
public void DetermineCollidingShapes(SoftBodyUpdateContext context, PhysicsSystem system, BodyLockInterface bodyLockInterface) => Jolt.PInvoke.SoftBodyMotionProperties_DetermineCollidingShapes(this, context, system, bodyLockInterface);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:174
///
/// EStatus ParallelUpdate(SoftBodyUpdateContext &ioContext, const PhysicsSettings &inPhysicsSettings)
///
///
///
///
/// Update the soft body, will process a batch of work. Not part of the public API.
///
///
public SoftBodyMotionProperties.EStatus ParallelUpdate(SoftBodyUpdateContext context, ref PhysicsSettings physicsSettings) => Jolt.PInvoke.SoftBodyMotionProperties_ParallelUpdate(this, context, ref physicsSettings);
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:177
///
/// void UpdateRigidBodyVelocities(const SoftBodyUpdateContext &inContext, BodyInterface &inBodyInterface)
///
///
///
///
/// Update the velocities of all rigid bodies that we collided with. Not part of the public API.
///
///
public void UpdateRigidBodyVelocities(SoftBodyUpdateContext context, BodyInterface bodyInterface) => Jolt.PInvoke.SoftBodyMotionProperties_UpdateRigidBodyVelocities(this, context, bodyInterface);
public static implicit operator MotionProperties(SoftBodyMotionProperties value) => Jolt.PInvoke.SoftBodyMotionProperties_AsMotionProperties(value);
public void Dispose() => Jolt.PInvoke.SoftBodyMotionProperties_Destroy(this);
}
}