mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
141 lines
6.2 KiB
C#
141 lines
6.2 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>
|
|
/// An interface to query which vertices of a soft body are colliding with other bodies
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L12">Jolt/Physics/SoftBody/SoftBodyManifold.h:12</see>
|
|
/// <br/>
|
|
/// <c>class SoftBodyManifold</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct SoftBodyManifold
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the vertices of the soft body for iterating
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L16">Jolt/Physics/SoftBody/SoftBodyManifold.h:16</see>
|
|
/// <br/>
|
|
/// <c>const Array<SoftBodyVertex> & GetVertices() 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<SoftBodyVertex> GetVertices()
|
|
{
|
|
Jolt.PInvoke.SoftBodyManifold_GetVertices(this, out var _outResult);
|
|
return new ReadOnlySpan<SoftBodyVertex>((void*)_outResult.Data, checked((int)_outResult.Count));
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if a vertex has collided with something in this update
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L19">Jolt/Physics/SoftBody/SoftBodyManifold.h:19</see>
|
|
/// <br/>
|
|
/// <c>bool HasContact(const SoftBodyVertex &inVertex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool HasContact(in SoftBodyVertex vertex) => Jolt.PInvoke.SoftBodyManifold_HasContact(this, in vertex);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the local space contact point (multiply by GetCenterOfMassTransform() of the soft body to get world
|
|
/// space)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L25">Jolt/Physics/SoftBody/SoftBodyManifold.h:25</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetLocalContactPoint(const SoftBodyVertex &inVertex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float3 GetLocalContactPoint(in SoftBodyVertex vertex) =>
|
|
Jolt.PInvoke.SoftBodyManifold_GetLocalContactPoint(this, in vertex);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the contact normal for the vertex (assumes there is a contact).
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L31">Jolt/Physics/SoftBody/SoftBodyManifold.h:31</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetContactNormal(const SoftBodyVertex &inVertex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float3 GetContactNormal(in SoftBodyVertex vertex) =>
|
|
Jolt.PInvoke.SoftBodyManifold_GetContactNormal(this, in vertex);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the body with which the vertex has collided in this update
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L37">Jolt/Physics/SoftBody/SoftBodyManifold.h:37</see>
|
|
/// <br/>
|
|
/// <c>BodyID GetContactBodyID(const SoftBodyVertex &inVertex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint GetContactBodyID(in SoftBodyVertex vertex) =>
|
|
Jolt.PInvoke.SoftBodyManifold_GetContactBodyID(this, in vertex);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the number of sensors that are in contact with the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L51">Jolt/Physics/SoftBody/SoftBodyManifold.h:51</see>
|
|
/// <br/>
|
|
/// <c>uint GetNumSensorContacts() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint GetNumSensorContacts() => Jolt.PInvoke.SoftBodyManifold_GetNumSensorContacts(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the i-th sensor that is in contact with the soft body
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/SoftBody/SoftBodyManifold.h#L57">Jolt/Physics/SoftBody/SoftBodyManifold.h:57</see>
|
|
/// <br/>
|
|
/// <c>BodyID GetSensorContactBodyID(uint inIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint GetSensorContactBodyID(uint index)
|
|
{
|
|
var _result = Jolt.PInvoke.SoftBodyManifold_GetSensorContactBodyID(this, index, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of sensor contacts."
|
|
);
|
|
return _result;
|
|
}
|
|
}
|
|
}
|