mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-28 14:08:25 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
80
Brutal.Jolt/Manual/PInvoke.ContactEvents.cs
Normal file
80
Brutal.Jolt/Manual/PInvoke.ContactEvents.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Brutal.JoltApi;
|
||||
|
||||
// Hand-written LibraryImports for the contact event listener (JoltContactEventsShim.cpp).
|
||||
// These are fixed-shape, not derived from the parse.
|
||||
public static partial class Jolt
|
||||
{
|
||||
public static unsafe partial class PInvoke
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Creates a buffering contact listener holding up to capacity events of the kinds in mask.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerCreate")]
|
||||
public static partial nint ContactEventListenerCreate(uint capacity, uint mask);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Frees a buffering contact listener. It must not be installed on a physics system.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerDestroy")]
|
||||
public static partial void ContactEventListenerDestroy(nint listener);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// The listener as the ContactListener PhysicsSystem.SetContactListener takes; borrowed from it.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerGetBase")]
|
||||
public static partial ContactListener ContactEventListenerGetBase(nint listener);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Copies up to capacity pending events into events, oldest first, and returns how many were copied.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerDrain")]
|
||||
public static partial uint ContactEventListenerDrain(
|
||||
nint listener,
|
||||
ContactEvent* events,
|
||||
uint capacity,
|
||||
uint* remaining
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Throws away every pending event.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerClear")]
|
||||
public static partial void ContactEventListenerClear(nint listener);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// How many events are waiting to be drained.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerGetPending")]
|
||||
public static partial uint ContactEventListenerGetPending(nint listener);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// How many events were dropped over the listener's life because the buffer was full.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerGetDropped")]
|
||||
public static partial uint ContactEventListenerGetDropped(nint listener);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// How many events the buffer holds.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[LibraryImport("jolt", EntryPoint = "Jolt_ContactEventListenerGetCapacity")]
|
||||
public static partial uint ContactEventListenerGetCapacity(nint listener);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue