mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
1249 lines
61 KiB
C#
1249 lines
61 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using System.Runtime.CompilerServices;
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// This class contains the runtime information of a soft body.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L34">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:34</see>
|
|
/// <br/>
|
|
/// <c>class SoftBodyMotionProperties : public MotionProperties</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct SoftBodyMotionProperties : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Return code for ParallelUpdate
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L166">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:166</see>
|
|
/// <br/>
|
|
/// <c>enum class EStatus</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[Flags]
|
|
public enum Status : int
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// No work was done because other threads were still working on a batch that cannot run concurrently
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L168">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:168</see>
|
|
/// <br/>
|
|
/// <c>NoWork = 1 << 0</c>
|
|
/// </para>
|
|
/// </summary>
|
|
NoWork = 1,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Work was done to progress the update
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L169">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:169</see>
|
|
/// <br/>
|
|
/// <c>DidWork = 1 << 1</c>
|
|
/// </para>
|
|
/// </summary>
|
|
DidWork = 2,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// All work is done
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L170">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:170</see>
|
|
/// <br/>
|
|
/// <c>Done = 1 << 2</c>
|
|
/// </para>
|
|
/// </summary>
|
|
Done = 4,
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Information about a leaf shape that we're colliding with
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L187">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:187</see>
|
|
/// <br/>
|
|
/// <c>struct LeafShape</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 96)]
|
|
public partial struct LeafShape
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Transform of the shape relative to the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L192">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:192</see>
|
|
/// <br/>
|
|
/// <c>Mat44 mTransform</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public float4x4 Transform;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Scale of the shape
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L193">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:193</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mScale</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(64)]
|
|
public float3 Scale;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Shape
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L194">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:194</see>
|
|
/// <br/>
|
|
/// <c>RefConst<Shape> mShape</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(80)]
|
|
public Shape Shape;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Information about the current state of a rod.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L232">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:232</see>
|
|
/// <br/>
|
|
/// <c>struct RodState</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
|
public partial struct RodState
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Rotation of the rod, relative to center of mass transform
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L234">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:234</see>
|
|
/// <br/>
|
|
/// <c>Quat mRotation</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public floatQuat Rotation;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Information about the state of all skinned vertices
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L243">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:243</see>
|
|
/// <br/>
|
|
/// <c>struct SkinState</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
|
public partial struct SkinState
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Previous position of the skinned vertex, used to interpolate between the previous and current
|
|
/// position
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L245">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:245</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mPreviousPosition = Vec3::sZero()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public float3 PreviousPosition;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Current position of the skinned vertex
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L246">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:246</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mPosition = Vec3::sNaN()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(16)]
|
|
public float3 Position;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Normal of the skinned vertex
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L247">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:247</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mNormal = Vec3::sNaN()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(32)]
|
|
public float3 Normal;
|
|
}
|
|
|
|
public static SoftBodyMotionProperties Create() => Jolt.PInvoke.SoftBodyMotionProperties_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Initialize the soft body motion properties
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L50">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:50</see>
|
|
/// <br/>
|
|
/// <c>void Initialize(const SoftBodyCreationSettings &inSettings)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Initialize(SoftBodyCreationSettings settings) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_Initialize(this, settings);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the shared settings of the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L53">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:53</see>
|
|
/// <br/>
|
|
/// <c>const SoftBodySharedSettings * GetSettings() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The returned handle carries its own reference; Dispose it once when you're done.
|
|
/// </para>
|
|
/// </remarks>
|
|
public SoftBodySharedSettings GetSettings() => Jolt.PInvoke.SoftBodyMotionProperties_GetSettings(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L57">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:57</see>
|
|
/// <br/>
|
|
/// <c>Array<Vertex> & GetVertices()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The span is a view of the container's own storage, not a copy, so it costs nothing to take. It's only
|
|
/// valid until that container is resized or its owner is destroyed.
|
|
/// </para>
|
|
/// </remarks>
|
|
[return: Brutal.Attributes.Fixed]
|
|
public unsafe ReadOnlySpan<SoftBodyVertex> GetVertices()
|
|
{
|
|
Jolt.PInvoke.SoftBodyMotionProperties_GetVertices(this, out var _outResult);
|
|
return new ReadOnlySpan<SoftBodyVertex>((void*)_outResult.Data, checked((int)_outResult.Count));
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Access an individual vertex
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L60">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:60</see>
|
|
/// <br/>
|
|
/// <c>const Vertex & GetVertex(uint inIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public SoftBodyVertex GetVertex(uint index)
|
|
{
|
|
var _result = Jolt.PInvoke.SoftBodyMotionProperties_GetVertex(this, index, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of vertices."
|
|
);
|
|
return _result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L61">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:61</see>
|
|
/// <br/>
|
|
/// <c>Vertex & GetVertex(uint inIndex)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Writes value into the element GetVertex returns, in place. The C++ getter hands out a reference; the C#
|
|
/// GetVertex can only return a copy, so this is how an edit reaches the object.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetVertex(uint index, in SoftBodyVertex value)
|
|
{
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetVertex(this, index, in value, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of vertices."
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Writes a run of elements through GetVertex in one call, starting at startIndex - the same per-element
|
|
/// write SetVertex does, without a boundary crossing each. Writes value.Length elements, and throws
|
|
/// ArgumentOutOfRangeException if that run would reach past the last of the vertices.
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void SetVertices(ReadOnlySpan<SoftBodyVertex> value, uint startIndex = 0)
|
|
{
|
|
fixed (SoftBodyVertex* value_fixed = value)
|
|
{
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetVertices(
|
|
this,
|
|
value_fixed,
|
|
(nuint)value.Length,
|
|
startIndex,
|
|
out var _inRange
|
|
);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(startIndex),
|
|
startIndex,
|
|
"Expected startIndex and value.Length to describe a run inside the vertices."
|
|
);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Access to the state of rods
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L64">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:64</see>
|
|
/// <br/>
|
|
/// <c>Quat GetRodRotation(uint inIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public floatQuat GetRodRotation(uint index)
|
|
{
|
|
var _result = Jolt.PInvoke.SoftBodyMotionProperties_GetRodRotation(this, index, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of rods."
|
|
);
|
|
return _result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L65">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:65</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetRodAngularVelocity(uint inIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float3 GetRodAngularVelocity(uint index)
|
|
{
|
|
var _result = Jolt.PInvoke.SoftBodyMotionProperties_GetRodAngularVelocity(this, index, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of rods."
|
|
);
|
|
return _result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the materials of the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L68">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:68</see>
|
|
/// <br/>
|
|
/// <c>const PhysicsMaterialList & GetMaterials() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Returns an owned native buffer - read it through AsSpan() and Dispose it when you are done with it. The
|
|
/// handles in it are borrowed views into the buffer: they stay valid until Dispose and must not be disposed
|
|
/// themselves.
|
|
/// </para>
|
|
/// </remarks>
|
|
public NativeArray<PhysicsMaterial> GetMaterials() =>
|
|
new NativeArray<PhysicsMaterial>(Jolt.PInvoke.SoftBodyMotionProperties_GetMaterials(this));
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the faces of the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L71">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:71</see>
|
|
/// <br/>
|
|
/// <c>const Array<Face> & GetFaces() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The span is a view of the container's own storage, not a copy, so it costs nothing to take. It's only
|
|
/// valid until that container is resized or its owner is destroyed.
|
|
/// </para>
|
|
/// </remarks>
|
|
[return: Brutal.Attributes.Fixed]
|
|
public unsafe ReadOnlySpan<SoftBodySharedSettings.Face> GetFaces()
|
|
{
|
|
Jolt.PInvoke.SoftBodyMotionProperties_GetFaces(this, out var _outResult);
|
|
return new ReadOnlySpan<SoftBodySharedSettings.Face>(
|
|
(void*)_outResult.Data,
|
|
checked((int)_outResult.Count)
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Access to an individual face
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L74">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:74</see>
|
|
/// <br/>
|
|
/// <c>const Face & GetFace(uint inIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public SoftBodySharedSettings.Face GetFace(uint index)
|
|
{
|
|
Jolt.PInvoke.SoftBodyMotionProperties_GetFace(this, index, out var _inRange, out var _outResult);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of faces."
|
|
);
|
|
return _outResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the number of solver iterations
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L77">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:77</see>
|
|
/// <br/>
|
|
/// <c>uint32 GetNumIterations() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint GetNumIterations() => Jolt.PInvoke.SoftBodyMotionProperties_GetNumIterations(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L78">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:78</see>
|
|
/// <br/>
|
|
/// <c>void SetNumIterations(uint32 inNumIterations)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetNumIterations(uint numIterations) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetNumIterations(this, numIterations);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the pressure of the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L81">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:81</see>
|
|
/// <br/>
|
|
/// <c>float GetPressure() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetPressure() => Jolt.PInvoke.SoftBodyMotionProperties_GetPressure(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L82">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:82</see>
|
|
/// <br/>
|
|
/// <c>void SetPressure(float inPressure)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetPressure(float pressure) => Jolt.PInvoke.SoftBodyMotionProperties_SetPressure(this, pressure);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Update the position of the body while simulating (set to false for something that is attached to the
|
|
/// static world)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L85">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:85</see>
|
|
/// <br/>
|
|
/// <c>bool GetUpdatePosition() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool GetUpdatePosition() => Jolt.PInvoke.SoftBodyMotionProperties_GetUpdatePosition(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L86">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:86</see>
|
|
/// <br/>
|
|
/// <c>void SetUpdatePosition(bool inUpdatePosition)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetUpdatePosition(bool updatePosition) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetUpdatePosition(this, updatePosition);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 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)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L89">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:89</see>
|
|
/// <br/>
|
|
/// <c>bool GetFacesDoubleSided() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool GetFacesDoubleSided() => Jolt.PInvoke.SoftBodyMotionProperties_GetFacesDoubleSided(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L90">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:90</see>
|
|
/// <br/>
|
|
/// <c>void SetFacesDoubleSided(bool inDoubleSided)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetFacesDoubleSided(bool doubleSided) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetFacesDoubleSided(this, doubleSided);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Global setting to turn on/off skin constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L93">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:93</see>
|
|
/// <br/>
|
|
/// <c>bool GetEnableSkinConstraints() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool GetEnableSkinConstraints() => Jolt.PInvoke.SoftBodyMotionProperties_GetEnableSkinConstraints(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L94">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:94</see>
|
|
/// <br/>
|
|
/// <c>void SetEnableSkinConstraints(bool inEnableSkinConstraints)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetEnableSkinConstraints(bool enableSkinConstraints) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetEnableSkinConstraints(this, enableSkinConstraints);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Multiplier applied to Skinned::mMaxDistance to allow tightening or loosening of the skin constraints. 0
|
|
/// to hard skin all vertices.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L97">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:97</see>
|
|
/// <br/>
|
|
/// <c>float GetSkinnedMaxDistanceMultiplier() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetSkinnedMaxDistanceMultiplier() =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_GetSkinnedMaxDistanceMultiplier(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L98">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:98</see>
|
|
/// <br/>
|
|
/// <c>void SetSkinnedMaxDistanceMultiplier(float inSkinnedMaxDistanceMultiplier)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetSkinnedMaxDistanceMultiplier(float skinnedMaxDistanceMultiplier) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetSkinnedMaxDistanceMultiplier(this, skinnedMaxDistanceMultiplier);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 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
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L101">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:101</see>
|
|
/// <br/>
|
|
/// <c>float GetVertexRadius() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetVertexRadius() => Jolt.PInvoke.SoftBodyMotionProperties_GetVertexRadius(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L102">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:102</see>
|
|
/// <br/>
|
|
/// <c>void SetVertexRadius(float inVertexRadius)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetVertexRadius(float vertexRadius) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SetVertexRadius(this, vertexRadius);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get local bounding box
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L105">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:105</see>
|
|
/// <br/>
|
|
/// <c>const AABox & GetLocalBounds() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public AABox GetLocalBounds() => Jolt.PInvoke.SoftBodyMotionProperties_GetLocalBounds(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the volume of the soft body. Note can become negative if the shape is inside out!
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L108">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:108</see>
|
|
/// <br/>
|
|
/// <c>float GetVolume() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetVolume() => Jolt.PInvoke.SoftBodyMotionProperties_GetVolume(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate the total mass and inertia of this body based on the current state of the vertices
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L111">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:111</see>
|
|
/// <br/>
|
|
/// <c>void CalculateMassAndInertia()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void CalculateMassAndInertia() => Jolt.PInvoke.SoftBodyMotionProperties_CalculateMassAndInertia(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Draw the state of a soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L115">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:115</see>
|
|
/// <br/>
|
|
/// <c>void DrawVertices(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawVertices(DebugRenderer renderer, in float4x4 centerOfMassTransform) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawVertices(this, renderer, in centerOfMassTransform);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L116">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:116</see>
|
|
/// <br/>
|
|
/// <c>void DrawVertexVelocities(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawVertexVelocities(DebugRenderer renderer, in float4x4 centerOfMassTransform) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawVertexVelocities(this, renderer, in centerOfMassTransform);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L117">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:117</see>
|
|
/// <br/>
|
|
/// <c>void DrawEdgeConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawEdgeConstraints(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawEdgeConstraints(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L118">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:118</see>
|
|
/// <br/>
|
|
/// <c>void DrawRods(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawRods(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) => Jolt.PInvoke.SoftBodyMotionProperties_DrawRods(this, renderer, in centerOfMassTransform, constraintColor);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L119">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:119</see>
|
|
/// <br/>
|
|
/// <c>void DrawRodStates(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawRodStates(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawRodStates(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L120">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:120</see>
|
|
/// <br/>
|
|
/// <c>void DrawRodBendTwistConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawRodBendTwistConstraints(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawRodBendTwistConstraints(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L121">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:121</see>
|
|
/// <br/>
|
|
/// <c>void DrawBendConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawBendConstraints(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawBendConstraints(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L122">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:122</see>
|
|
/// <br/>
|
|
/// <c>void DrawVolumeConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawVolumeConstraints(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawVolumeConstraints(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L123">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:123</see>
|
|
/// <br/>
|
|
/// <c>void DrawSkinConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawSkinConstraints(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawSkinConstraints(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L124">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:124</see>
|
|
/// <br/>
|
|
/// <c>void DrawLRAConstraints(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, ESoftBodyConstraintColor inConstraintColor) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawLRAConstraints(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
SoftBodyConstraintColor constraintColor
|
|
) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawLRAConstraints(
|
|
this,
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
constraintColor
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L125">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:125</see>
|
|
/// <br/>
|
|
/// <c>void DrawPredictedBounds(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawPredictedBounds(DebugRenderer renderer, in float4x4 centerOfMassTransform) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_DrawPredictedBounds(this, renderer, in centerOfMassTransform);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Skin vertices to supplied joints, information is used by the skinned constraints.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L140">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:140</see>
|
|
/// <br/>
|
|
/// <c>void SkinVertices(RMat44Arg inCenterOfMassTransform, const Mat44 *inJointMatrices, uint inNumJoints, bool inHardSkinAll, TempAllocator &ioTempAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Skin vertices to supplied joints, information is used by the skinned constraints.
|
|
/// @param inCenterOfMassTransform Value of Body::GetCenterOfMassTransform().
|
|
/// @param inJointMatrices The joint matrices must be expressed relative to inCenterOfMassTransform.
|
|
/// @param inNumJoints Indicates how large the inJointMatrices array is (used only for validating out of bounds).
|
|
/// @param inHardSkinAll Can be used to position all vertices on the skinned vertices and can be used to hard reset the soft body.
|
|
/// @param ioTempAllocator Allocator.
|
|
/// </code>
|
|
/// <para>
|
|
/// jointMatrices must hold at least one element per joint the skin's inverse bind matrices reference - the
|
|
/// native count is read from the object itself and a span that doesn't match it throws
|
|
/// ArgumentOutOfRangeException. The span is only used for the duration of the call. Throws
|
|
/// InvalidOperationException: "The motion properties have no soft body settings."
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe void SkinVertices(
|
|
in float4x4 centerOfMassTransform,
|
|
ReadOnlySpan<float4x4> jointMatrices,
|
|
bool hardSkinAll,
|
|
TempAllocator tempAllocator
|
|
)
|
|
{
|
|
fixed (float4x4* jointMatrices_fixed = jointMatrices)
|
|
{
|
|
Jolt.PInvoke.SoftBodyMotionProperties_SkinVertices(
|
|
this,
|
|
in centerOfMassTransform,
|
|
jointMatrices_fixed,
|
|
(uint)jointMatrices.Length,
|
|
hardSkinAll,
|
|
tempAllocator,
|
|
out var _bufferCheck
|
|
);
|
|
if (_bufferCheck == 1)
|
|
throw new InvalidOperationException("The motion properties have no soft body settings.");
|
|
if (_bufferCheck == 2)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(jointMatrices),
|
|
jointMatrices.Length,
|
|
"Expected at least one element per joint the skin's inverse bind matrices reference."
|
|
);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 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.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L153">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:153</see>
|
|
/// <br/>
|
|
/// <c>void CustomUpdate(float inDeltaTime, Body &ioSoftBody, PhysicsSystem &inSystem)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void CustomUpdate(float deltaTime, Body softBody, PhysicsSystem system) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_CustomUpdate(this, deltaTime, softBody, system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Initialize the update context. Not part of the public API.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L160">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:160</see>
|
|
/// <br/>
|
|
/// <c>void InitializeUpdateContext(float inDeltaTime, Body &inSoftBody, const PhysicsSystem &inSystem, SoftBodyUpdateContext &ioContext)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void InitializeUpdateContext(
|
|
float deltaTime,
|
|
Body softBody,
|
|
PhysicsSystem system,
|
|
SoftBodyUpdateContext context
|
|
) => Jolt.PInvoke.SoftBodyMotionProperties_InitializeUpdateContext(this, deltaTime, softBody, system, context);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Do a broad phase check and collect all bodies that can possibly collide with this soft body. Not part of
|
|
/// the public API.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L163">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:163</see>
|
|
/// <br/>
|
|
/// <c>void DetermineCollidingShapes(const SoftBodyUpdateContext &inContext, const PhysicsSystem &inSystem, const BodyLockInterface &inBodyLockInterface)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DetermineCollidingShapes(
|
|
SoftBodyUpdateContext context,
|
|
PhysicsSystem system,
|
|
BodyLockInterface bodyLockInterface
|
|
) => Jolt.PInvoke.SoftBodyMotionProperties_DetermineCollidingShapes(this, context, system, bodyLockInterface);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Update the soft body, will process a batch of work. Not part of the public API.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L174">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:174</see>
|
|
/// <br/>
|
|
/// <c>EStatus ParallelUpdate(SoftBodyUpdateContext &ioContext, const PhysicsSettings &inPhysicsSettings)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public SoftBodyMotionProperties.Status ParallelUpdate(
|
|
SoftBodyUpdateContext context,
|
|
in PhysicsSettings physicsSettings
|
|
) => Jolt.PInvoke.SoftBodyMotionProperties_ParallelUpdate(this, context, in physicsSettings);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Update the velocities of all rigid bodies that we collided with. Not part of the public API.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L177">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:177</see>
|
|
/// <br/>
|
|
/// <c>void UpdateRigidBodyVelocities(const SoftBodyUpdateContext &inContext, BodyInterface &inBodyInterface)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void UpdateRigidBodyVelocities(SoftBodyUpdateContext context, BodyInterface bodyInterface) =>
|
|
Jolt.PInvoke.SoftBodyMotionProperties_UpdateRigidBodyVelocities(this, context, bodyInterface);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set a flag to indicate that the ContactListener::OnSoftBodyContactAdded should be called
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyMotionProperties.h#L180">Jolt/Physics/SoftBody/SoftBodyMotionProperties.h:180</see>
|
|
/// <br/>
|
|
/// <c>inline void RequestContactCallback()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void RequestContactCallback() => Jolt.PInvoke.SoftBodyMotionProperties_RequestContactCallback(this);
|
|
|
|
public static implicit operator MotionProperties(SoftBodyMotionProperties value) =>
|
|
Unsafe.BitCast<SoftBodyMotionProperties, MotionProperties>(value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.SoftBodyMotionProperties_Destroy(this);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetMotionQuality()"/>
|
|
public MotionQuality GetMotionQuality() => ((MotionProperties)this).GetMotionQuality();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAllowedDOFs()"/>
|
|
public AllowedDOFs GetAllowedDOFs() => ((MotionProperties)this).GetAllowedDOFs();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAllowSleeping()"/>
|
|
public bool GetAllowSleeping() => ((MotionProperties)this).GetAllowSleeping();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetLinearVelocity()"/>
|
|
public float3 GetLinearVelocity() => ((MotionProperties)this).GetLinearVelocity();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetLinearVelocity(float3)"/>
|
|
public void SetLinearVelocity(float3 linearVelocity) =>
|
|
((MotionProperties)this).SetLinearVelocity(linearVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetLinearVelocityClamped(float3)"/>
|
|
public void SetLinearVelocityClamped(float3 linearVelocity) =>
|
|
((MotionProperties)this).SetLinearVelocityClamped(linearVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAngularVelocity()"/>
|
|
public float3 GetAngularVelocity() => ((MotionProperties)this).GetAngularVelocity();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetAngularVelocity(float3)"/>
|
|
public void SetAngularVelocity(float3 angularVelocity) =>
|
|
((MotionProperties)this).SetAngularVelocity(angularVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetAngularVelocityClamped(float3)"/>
|
|
public void SetAngularVelocityClamped(float3 angularVelocity) =>
|
|
((MotionProperties)this).SetAngularVelocityClamped(angularVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.MoveKinematic(float3, floatQuat, float)"/>
|
|
public void MoveKinematic(float3 deltaPosition, floatQuat deltaRotation, float deltaTime) =>
|
|
((MotionProperties)this).MoveKinematic(deltaPosition, deltaRotation, deltaTime);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetMaxLinearVelocity()"/>
|
|
public float GetMaxLinearVelocity() => ((MotionProperties)this).GetMaxLinearVelocity();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetMaxLinearVelocity(float)"/>
|
|
public void SetMaxLinearVelocity(float linearVelocity) =>
|
|
((MotionProperties)this).SetMaxLinearVelocity(linearVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetMaxAngularVelocity()"/>
|
|
public float GetMaxAngularVelocity() => ((MotionProperties)this).GetMaxAngularVelocity();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetMaxAngularVelocity(float)"/>
|
|
public void SetMaxAngularVelocity(float angularVelocity) =>
|
|
((MotionProperties)this).SetMaxAngularVelocity(angularVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.ClampLinearVelocity()"/>
|
|
public void ClampLinearVelocity() => ((MotionProperties)this).ClampLinearVelocity();
|
|
|
|
/// <inheritdoc cref="MotionProperties.ClampAngularVelocity()"/>
|
|
public void ClampAngularVelocity() => ((MotionProperties)this).ClampAngularVelocity();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetLinearDamping()"/>
|
|
public float GetLinearDamping() => ((MotionProperties)this).GetLinearDamping();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetLinearDamping(float)"/>
|
|
public void SetLinearDamping(float linearDamping) => ((MotionProperties)this).SetLinearDamping(linearDamping);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAngularDamping()"/>
|
|
public float GetAngularDamping() => ((MotionProperties)this).GetAngularDamping();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetAngularDamping(float)"/>
|
|
public void SetAngularDamping(float angularDamping) =>
|
|
((MotionProperties)this).SetAngularDamping(angularDamping);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetGravityFactor()"/>
|
|
public float GetGravityFactor() => ((MotionProperties)this).GetGravityFactor();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetGravityFactor(float)"/>
|
|
public void SetGravityFactor(float gravityFactor) => ((MotionProperties)this).SetGravityFactor(gravityFactor);
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetMassProperties(AllowedDOFs, MassProperties)"/>
|
|
public void SetMassProperties(AllowedDOFs allowedDOFs, MassProperties massProperties) =>
|
|
((MotionProperties)this).SetMassProperties(allowedDOFs, massProperties);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetInverseMass()"/>
|
|
public float GetInverseMass() => ((MotionProperties)this).GetInverseMass();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetInverseMassUnchecked()"/>
|
|
public float GetInverseMassUnchecked() => ((MotionProperties)this).GetInverseMassUnchecked();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetInverseMass(float)"/>
|
|
public void SetInverseMass(float inverseMass) => ((MotionProperties)this).SetInverseMass(inverseMass);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetInverseInertiaDiagonal()"/>
|
|
public float3 GetInverseInertiaDiagonal() => ((MotionProperties)this).GetInverseInertiaDiagonal();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetInertiaRotation()"/>
|
|
public floatQuat GetInertiaRotation() => ((MotionProperties)this).GetInertiaRotation();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetInverseInertia(float3, floatQuat)"/>
|
|
public void SetInverseInertia(float3 diagonal, floatQuat rot) =>
|
|
((MotionProperties)this).SetInverseInertia(diagonal, rot);
|
|
|
|
/// <inheritdoc cref="MotionProperties.ScaleToMass(float)"/>
|
|
public void ScaleToMass(float mass) => ((MotionProperties)this).ScaleToMass(mass);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetLocalSpaceInverseInertia()"/>
|
|
public float4x4 GetLocalSpaceInverseInertia() => ((MotionProperties)this).GetLocalSpaceInverseInertia();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetLocalSpaceInverseInertiaUnchecked()"/>
|
|
public float4x4 GetLocalSpaceInverseInertiaUnchecked() =>
|
|
((MotionProperties)this).GetLocalSpaceInverseInertiaUnchecked();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetInverseInertiaForRotation(in float4x4)"/>
|
|
public float4x4 GetInverseInertiaForRotation(in float4x4 rotation) =>
|
|
((MotionProperties)this).GetInverseInertiaForRotation(in rotation);
|
|
|
|
/// <inheritdoc cref="MotionProperties.MultiplyWorldSpaceInverseInertiaByVector(floatQuat, float3)"/>
|
|
public float3 MultiplyWorldSpaceInverseInertiaByVector(floatQuat bodyRotation, float3 v) =>
|
|
((MotionProperties)this).MultiplyWorldSpaceInverseInertiaByVector(bodyRotation, v);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetPointVelocityCOM(float3)"/>
|
|
public float3 GetPointVelocityCOM(float3 pointRelativeToCOM) =>
|
|
((MotionProperties)this).GetPointVelocityCOM(pointRelativeToCOM);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAccumulatedForce()"/>
|
|
public float3 GetAccumulatedForce() => ((MotionProperties)this).GetAccumulatedForce();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAccumulatedTorque()"/>
|
|
public float3 GetAccumulatedTorque() => ((MotionProperties)this).GetAccumulatedTorque();
|
|
|
|
/// <inheritdoc cref="MotionProperties.ResetForce()"/>
|
|
public void ResetForce() => ((MotionProperties)this).ResetForce();
|
|
|
|
/// <inheritdoc cref="MotionProperties.ResetTorque()"/>
|
|
public void ResetTorque() => ((MotionProperties)this).ResetTorque();
|
|
|
|
/// <inheritdoc cref="MotionProperties.ResetMotion()"/>
|
|
public void ResetMotion() => ((MotionProperties)this).ResetMotion();
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetLinearDOFsMask()"/>
|
|
public uint4 GetLinearDOFsMask() => ((MotionProperties)this).GetLinearDOFsMask();
|
|
|
|
/// <inheritdoc cref="MotionProperties.LockTranslation(float3)"/>
|
|
public float3 LockTranslation(float3 v) => ((MotionProperties)this).LockTranslation(v);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetAngularDOFsMask()"/>
|
|
public uint4 GetAngularDOFsMask() => ((MotionProperties)this).GetAngularDOFsMask();
|
|
|
|
/// <inheritdoc cref="MotionProperties.LockAngular(float3)"/>
|
|
public float3 LockAngular(float3 v) => ((MotionProperties)this).LockAngular(v);
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetNumVelocityStepsOverride(uint)"/>
|
|
public void SetNumVelocityStepsOverride(uint n) => ((MotionProperties)this).SetNumVelocityStepsOverride(n);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetNumVelocityStepsOverride()"/>
|
|
public uint GetNumVelocityStepsOverride() => ((MotionProperties)this).GetNumVelocityStepsOverride();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetNumPositionStepsOverride(uint)"/>
|
|
public void SetNumPositionStepsOverride(uint n) => ((MotionProperties)this).SetNumPositionStepsOverride(n);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetNumPositionStepsOverride()"/>
|
|
public uint GetNumPositionStepsOverride() => ((MotionProperties)this).GetNumPositionStepsOverride();
|
|
|
|
/// <inheritdoc cref="MotionProperties.ApplyLinearVelocityStep(float3)"/>
|
|
public void ApplyLinearVelocityStep(float3 linearVelocity) =>
|
|
((MotionProperties)this).ApplyLinearVelocityStep(linearVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.AddLinearVelocityStep(float3)"/>
|
|
public void AddLinearVelocityStep(float3 linearVelocityChange) =>
|
|
((MotionProperties)this).AddLinearVelocityStep(linearVelocityChange);
|
|
|
|
/// <inheritdoc cref="MotionProperties.SubLinearVelocityStep(float3)"/>
|
|
public void SubLinearVelocityStep(float3 linearVelocityChange) =>
|
|
((MotionProperties)this).SubLinearVelocityStep(linearVelocityChange);
|
|
|
|
/// <inheritdoc cref="MotionProperties.ApplyAngularVelocityStep(float3)"/>
|
|
public void ApplyAngularVelocityStep(float3 angularVelocity) =>
|
|
((MotionProperties)this).ApplyAngularVelocityStep(angularVelocity);
|
|
|
|
/// <inheritdoc cref="MotionProperties.AddAngularVelocityStep(float3)"/>
|
|
public void AddAngularVelocityStep(float3 angularVelocityChange) =>
|
|
((MotionProperties)this).AddAngularVelocityStep(angularVelocityChange);
|
|
|
|
/// <inheritdoc cref="MotionProperties.SubAngularVelocityStep(float3)"/>
|
|
public void SubAngularVelocityStep(float3 angularVelocityChange) =>
|
|
((MotionProperties)this).SubAngularVelocityStep(angularVelocityChange);
|
|
|
|
/// <inheritdoc cref="MotionProperties.ApplyGyroscopicForceInternal(floatQuat, float)"/>
|
|
public void ApplyGyroscopicForceInternal(floatQuat bodyRotation, float deltaTime) =>
|
|
((MotionProperties)this).ApplyGyroscopicForceInternal(bodyRotation, deltaTime);
|
|
|
|
/// <inheritdoc cref="MotionProperties.ApplyForceTorqueAndDragInternal(floatQuat, float3, float)"/>
|
|
public void ApplyForceTorqueAndDragInternal(floatQuat bodyRotation, float3 gravity, float deltaTime) =>
|
|
((MotionProperties)this).ApplyForceTorqueAndDragInternal(bodyRotation, gravity, deltaTime);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetIslandIndexInternal()"/>
|
|
public uint GetIslandIndexInternal() => ((MotionProperties)this).GetIslandIndexInternal();
|
|
|
|
/// <inheritdoc cref="MotionProperties.SetIslandIndexInternal(uint)"/>
|
|
public void SetIslandIndexInternal(uint index) => ((MotionProperties)this).SetIslandIndexInternal(index);
|
|
|
|
/// <inheritdoc cref="MotionProperties.GetIndexInActiveBodiesInternal()"/>
|
|
public uint GetIndexInActiveBodiesInternal() => ((MotionProperties)this).GetIndexInActiveBodiesInternal();
|
|
|
|
/// <inheritdoc cref="MotionProperties.ResetSleepTestTimer()"/>
|
|
public void ResetSleepTestTimer() => ((MotionProperties)this).ResetSleepTestTimer();
|
|
|
|
/// <inheritdoc cref="MotionProperties.AccumulateSleepTime(float, float)"/>
|
|
public CanSleep AccumulateSleepTime(float deltaTime, float timeBeforeSleep) =>
|
|
((MotionProperties)this).AccumulateSleepTime(deltaTime, timeBeforeSleep);
|
|
|
|
/// <inheritdoc cref="MotionProperties.ResetSleepTestSpheres(ReadOnlySpan{float3})"/>
|
|
public unsafe void ResetSleepTestSpheres(ReadOnlySpan<float3> points) =>
|
|
((MotionProperties)this).ResetSleepTestSpheres(points);
|
|
}
|
|
}
|