brutal/Brutal.Jolt/Generated/Structs/PhysicsSettings.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

444 lines
19 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>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L30">Jolt/Physics/PhysicsSettings.h:30</see>
/// <br/>
/// <c>struct PhysicsSettings</c>
/// </para>
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 88)]
public partial struct PhysicsSettings
{
/// <summary>
/// <para>
/// Size of body pairs array, corresponds to the maximum amount of potential body pairs that can be in
/// flight at any time. Setting this to a low value will use less memory but slow down simulation as threads
/// may run out of narrow phase work.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L36">Jolt/Physics/PhysicsSettings.h:36</see>
/// <br/>
/// <c>int mMaxInFlightBodyPairs = 16384</c>
/// </para>
/// </summary>
[FieldOffset(0)]
public int MaxInFlightBodyPairs;
/// <summary>
/// <para>
/// How many PhysicsStepListeners to notify in 1 batch
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L39">Jolt/Physics/PhysicsSettings.h:39</see>
/// <br/>
/// <c>int mStepListenersBatchSize = 8</c>
/// </para>
/// </summary>
[FieldOffset(4)]
public int StepListenersBatchSize;
/// <summary>
/// <para>
/// How many step listener batches are needed before spawning another job (set to INT_MAX if no parallelism
/// is desired)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L42">Jolt/Physics/PhysicsSettings.h:42</see>
/// <br/>
/// <c>int mStepListenerBatchesPerJob = 1</c>
/// </para>
/// </summary>
[FieldOffset(8)]
public int StepListenerBatchesPerJob;
/// <summary>
/// <para>
/// Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update) (unit:
/// dimensionless, 0 = nothing, 1 = 100%)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L45">Jolt/Physics/PhysicsSettings.h:45</see>
/// <br/>
/// <c>float mBaumgarte = 0.2f</c>
/// </para>
/// </summary>
[FieldOffset(12)]
public float Baumgarte;
/// <summary>
/// <para>
/// Radius around objects inside which speculative contact points will be detected. Note that if this is too
/// big you will get ghost collisions as speculative contacts are based on the closest points during the
/// collision detection step which may not be the actual closest points by the time the two objects hit
/// (unit: meters)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L50">Jolt/Physics/PhysicsSettings.h:50</see>
/// <br/>
/// <c>float mSpeculativeContactDistance = 0.02f</c>
/// </para>
/// </summary>
[FieldOffset(16)]
public float SpeculativeContactDistance;
/// <summary>
/// <para>
/// How much bodies are allowed to sink into each other (unit: meters)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L53">Jolt/Physics/PhysicsSettings.h:53</see>
/// <br/>
/// <c>float mPenetrationSlop = 0.02f</c>
/// </para>
/// </summary>
[FieldOffset(20)]
public float PenetrationSlop;
/// <summary>
/// <para>
/// Fraction of its inner radius a body must move per step to enable casting for the LinearCast motion
/// quality
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L56">Jolt/Physics/PhysicsSettings.h:56</see>
/// <br/>
/// <c>float mLinearCastThreshold = 0.75f</c>
/// </para>
/// </summary>
[FieldOffset(24)]
public float LinearCastThreshold;
/// <summary>
/// <para>
/// Fraction of its inner radius a body may penetrate another body for the LinearCast motion quality
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L59">Jolt/Physics/PhysicsSettings.h:59</see>
/// <br/>
/// <c>float mLinearCastMaxPenetration = 0.25f</c>
/// </para>
/// </summary>
[FieldOffset(28)]
public float LinearCastMaxPenetration;
/// <summary>
/// <para>
/// Max distance to use to determine if two points are on the same plane for determining the contact
/// manifold between two shape faces (unit: meter)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L62">Jolt/Physics/PhysicsSettings.h:62</see>
/// <br/>
/// <c>float mManifoldTolerance = 1.0e-3f</c>
/// </para>
/// </summary>
[FieldOffset(32)]
public float ManifoldTolerance;
/// <summary>
/// <para>
/// Maximum distance to correct in a single iteration when solving position constraints (unit: meters)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L65">Jolt/Physics/PhysicsSettings.h:65</see>
/// <br/>
/// <c>float mMaxPenetrationDistance = 0.2f</c>
/// </para>
/// </summary>
[FieldOffset(36)]
public float MaxPenetrationDistance;
/// <summary>
/// <para>
/// 1 mm
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L68">Jolt/Physics/PhysicsSettings.h:68</see>
/// <br/>
/// <c>float mBodyPairCacheMaxDeltaPositionSq = Square(0.001f)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Maximum relative delta position for body pairs to be able to reuse collision results from last frame
/// (units: meter^2)
/// </para>
/// </remarks>
[FieldOffset(40)]
public float BodyPairCacheMaxDeltaPositionSq;
/// <summary>
/// <para>
/// cos(2 degrees / 2)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L71">Jolt/Physics/PhysicsSettings.h:71</see>
/// <br/>
/// <c>float mBodyPairCacheCosMaxDeltaRotationDiv2 = 0.99984769515639123915701155881391f</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Maximum relative delta orientation for body pairs to be able to reuse collision results from last frame,
/// stored as cos(max angle / 2)
/// </para>
/// </remarks>
[FieldOffset(44)]
public float BodyPairCacheCosMaxDeltaRotationDiv2;
/// <summary>
/// <para>
/// cos(5 degree)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L74">Jolt/Physics/PhysicsSettings.h:74</see>
/// <br/>
/// <c>float mContactNormalCosMaxDeltaRotation = 0.99619469809174553229501040247389f</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Maximum angle between normals that allows manifolds between different sub shapes of the same body pair
/// to be combined
/// </para>
/// </remarks>
[FieldOffset(48)]
public float ContactNormalCosMaxDeltaRotation;
/// <summary>
/// <para>
/// 1 cm
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L77">Jolt/Physics/PhysicsSettings.h:77</see>
/// <br/>
/// <c>float mContactPointPreserveLambdaMaxDistSq = Square(0.01f)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Maximum allowed distance between old and new contact point to preserve contact forces for warm start
/// (units: meter^2)
/// </para>
/// </remarks>
[FieldOffset(52)]
public float ContactPointPreserveLambdaMaxDistSq;
/// <summary>
/// <para>
/// Max squared distance to consider a vertex to be the same as another vertex, used by the internal edge
/// removal algorithm to determine if two edges are shared. (unit: meter^2)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L80">Jolt/Physics/PhysicsSettings.h:80</see>
/// <br/>
/// <c>float mInternalEdgeRemovalVertexToleranceSq = cDefaultInternalEdgeRemovalVertexToleranceSq</c>
/// </para>
/// </summary>
[FieldOffset(56)]
public float InternalEdgeRemovalVertexToleranceSq;
/// <summary>
/// <para>
/// Number of solver velocity iterations to run Note that this needs to be &gt;= 2 in order for friction to
/// work (friction is applied using the non-penetration impulse from the previous iteration)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L84">Jolt/Physics/PhysicsSettings.h:84</see>
/// <br/>
/// <c>uint mNumVelocitySteps = 10</c>
/// </para>
/// </summary>
[FieldOffset(60)]
public uint NumVelocitySteps;
/// <summary>
/// <para>
/// Number of solver position iterations to run
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L87">Jolt/Physics/PhysicsSettings.h:87</see>
/// <br/>
/// <c>uint mNumPositionSteps = 2</c>
/// </para>
/// </summary>
[FieldOffset(64)]
public uint NumPositionSteps;
/// <summary>
/// <para>
/// Minimal velocity needed before a collision can be elastic. If the relative velocity between colliding
/// objects in the direction of the contact normal is lower than this, the restitution will be zero
/// regardless of the configured value. This lets an object settle sooner. Must be a positive number. (unit:
/// m)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L92">Jolt/Physics/PhysicsSettings.h:92</see>
/// <br/>
/// <c>float mMinVelocityForRestitution = 1.0f</c>
/// </para>
/// </summary>
[FieldOffset(68)]
public float MinVelocityForRestitution;
/// <summary>
/// <para>
/// Time before object is allowed to go to sleep (unit: seconds)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L95">Jolt/Physics/PhysicsSettings.h:95</see>
/// <br/>
/// <c>float mTimeBeforeSleep = 0.5f</c>
/// </para>
/// </summary>
[FieldOffset(72)]
public float TimeBeforeSleep;
/// <summary>
/// <para>
/// To detect if an object is sleeping, we use 3 points: - The center of mass. - The centers of the faces of
/// the bounding box that are furthest away from the center. The movement of these points is tracked and if
/// the velocity of all 3 points is lower than this value, the object is allowed to go to sleep. Must be a
/// positive number. (unit: m/s)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L102">Jolt/Physics/PhysicsSettings.h:102</see>
/// <br/>
/// <c>float mPointVelocitySleepThreshold = 0.03f</c>
/// </para>
/// </summary>
[FieldOffset(76)]
public float PointVelocitySleepThreshold;
/// <summary>
/// <para>
/// By default the simulation is deterministic, it is possible to turn this off by setting this setting to
/// false. This will make the simulation run faster but it will no longer be deterministic.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L105">Jolt/Physics/PhysicsSettings.h:105</see>
/// <br/>
/// <c>bool mDeterministicSimulation = true</c>
/// </para>
/// </summary>
[FieldOffset(80)]
public Brutal.Bool8 DeterministicSimulation;
/// <summary>
/// <para>
/// Whether or not to use warm starting for constraints (initially applying previous frames impulses)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L111">Jolt/Physics/PhysicsSettings.h:111</see>
/// <br/>
/// <c>bool mConstraintWarmStart = true</c>
/// </para>
/// </summary>
[FieldOffset(81)]
public Brutal.Bool8 ConstraintWarmStart;
/// <summary>
/// <para>
/// Whether or not to use the body pair cache, which removes the need for narrow phase collision detection
/// when orientation between two bodies didn't change
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L114">Jolt/Physics/PhysicsSettings.h:114</see>
/// <br/>
/// <c>bool mUseBodyPairContactCache = true</c>
/// </para>
/// </summary>
[FieldOffset(82)]
public Brutal.Bool8 UseBodyPairContactCache;
/// <summary>
/// <para>
/// Whether or not to reduce manifolds with similar contact normals into one contact manifold (see
/// description at Body::SetUseManifoldReduction)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L117">Jolt/Physics/PhysicsSettings.h:117</see>
/// <br/>
/// <c>bool mUseManifoldReduction = true</c>
/// </para>
/// </summary>
[FieldOffset(83)]
public Brutal.Bool8 UseManifoldReduction;
/// <summary>
/// <para>
/// If we split up large islands into smaller parallel batches of work (to improve performance)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L120">Jolt/Physics/PhysicsSettings.h:120</see>
/// <br/>
/// <c>bool mUseLargeIslandSplitter = true</c>
/// </para>
/// </summary>
[FieldOffset(84)]
public Brutal.Bool8 UseLargeIslandSplitter;
/// <summary>
/// <para>
/// If objects can go to sleep or not
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L123">Jolt/Physics/PhysicsSettings.h:123</see>
/// <br/>
/// <c>bool mAllowSleeping = true</c>
/// </para>
/// </summary>
[FieldOffset(85)]
public Brutal.Bool8 AllowSleeping;
/// <summary>
/// <para>
/// When false, we prevent collision against non-active (shared) edges. Mainly for debugging the algorithm.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/PhysicsSettings.h#L126">Jolt/Physics/PhysicsSettings.h:126</see>
/// <br/>
/// <c>bool mCheckActiveEdges = true</c>
/// </para>
/// </summary>
[FieldOffset(86)]
public Brutal.Bool8 CheckActiveEdges;
}
}