mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
444 lines
19 KiB
C#
444 lines
19 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L27">Jolt/Physics/PhysicsSettings.h:27</see>
|
|
/// <br/>
|
|
/// <c>struct PhysicsSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 84)]
|
|
public struct PhysicsSettings
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L33">Jolt/Physics/PhysicsSettings.h:33</see>
|
|
/// <br/>
|
|
/// <c>int mMaxInFlightBodyPairs = 16384</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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.
|
|
/// </code>
|
|
/// </remarks>
|
|
[FieldOffset(0)]
|
|
public int mMaxInFlightBodyPairs;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L36">Jolt/Physics/PhysicsSettings.h:36</see>
|
|
/// <br/>
|
|
/// <c>int mStepListenersBatchSize = 8</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// How many PhysicsStepListeners to notify in 1 batch
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(4)]
|
|
public int mStepListenersBatchSize;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L39">Jolt/Physics/PhysicsSettings.h:39</see>
|
|
/// <br/>
|
|
/// <c>int mStepListenerBatchesPerJob = 1</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// How many step listener batches are needed before spawning another job (set to INT_MAX if no parallelism
|
|
/// is desired)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(8)]
|
|
public int mStepListenerBatchesPerJob;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L42">Jolt/Physics/PhysicsSettings.h:42</see>
|
|
/// <br/>
|
|
/// <c>float mBaumgarte = 0.2f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update) (unit:
|
|
/// dimensionless, 0 = nothing, 1 = 100%)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(12)]
|
|
public float mBaumgarte;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L47">Jolt/Physics/PhysicsSettings.h:47</see>
|
|
/// <br/>
|
|
/// <c>float mSpeculativeContactDistance = 0.02f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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)
|
|
/// </code>
|
|
/// </remarks>
|
|
[FieldOffset(16)]
|
|
public float mSpeculativeContactDistance;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L50">Jolt/Physics/PhysicsSettings.h:50</see>
|
|
/// <br/>
|
|
/// <c>float mPenetrationSlop = 0.02f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// How much bodies are allowed to sink into each other (unit: meters)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(20)]
|
|
public float mPenetrationSlop;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L53">Jolt/Physics/PhysicsSettings.h:53</see>
|
|
/// <br/>
|
|
/// <c>float mLinearCastThreshold = 0.75f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Fraction of its inner radius a body must move per step to enable casting for the LinearCast motion
|
|
/// quality
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(24)]
|
|
public float mLinearCastThreshold;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L56">Jolt/Physics/PhysicsSettings.h:56</see>
|
|
/// <br/>
|
|
/// <c>float mLinearCastMaxPenetration = 0.25f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Fraction of its inner radius a body may penetrate another body for the LinearCast motion quality
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(28)]
|
|
public float mLinearCastMaxPenetration;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L59">Jolt/Physics/PhysicsSettings.h:59</see>
|
|
/// <br/>
|
|
/// <c>float mManifoldTolerance = 1.0e-3f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <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>
|
|
/// </remarks>
|
|
[FieldOffset(32)]
|
|
public float mManifoldTolerance;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L62">Jolt/Physics/PhysicsSettings.h:62</see>
|
|
/// <br/>
|
|
/// <c>float mMaxPenetrationDistance = 0.2f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Maximum distance to correct in a single iteration when solving position constraints (unit: meters)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(36)]
|
|
public float mMaxPenetrationDistance;
|
|
/// <summary>
|
|
/// <para>
|
|
/// 1 mm
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L65">Jolt/Physics/PhysicsSettings.h:65</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 mBodyPairCacheMaxDeltaPositionSq;
|
|
/// <summary>
|
|
/// <para>
|
|
/// cos(2 degrees / 2)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L68">Jolt/Physics/PhysicsSettings.h:68</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 mBodyPairCacheCosMaxDeltaRotationDiv2;
|
|
/// <summary>
|
|
/// <para>
|
|
/// cos(5 degree)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L71">Jolt/Physics/PhysicsSettings.h:71</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 mContactNormalCosMaxDeltaRotation;
|
|
/// <summary>
|
|
/// <para>
|
|
/// 1 cm
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L74">Jolt/Physics/PhysicsSettings.h:74</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 mContactPointPreserveLambdaMaxDistSq;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L78">Jolt/Physics/PhysicsSettings.h:78</see>
|
|
/// <br/>
|
|
/// <c>uint mNumVelocitySteps = 10</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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)
|
|
/// </code>
|
|
/// </remarks>
|
|
[FieldOffset(56)]
|
|
public uint mNumVelocitySteps;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L81">Jolt/Physics/PhysicsSettings.h:81</see>
|
|
/// <br/>
|
|
/// <c>uint mNumPositionSteps = 2</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Number of solver position iterations to run
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(60)]
|
|
public uint mNumPositionSteps;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L86">Jolt/Physics/PhysicsSettings.h:86</see>
|
|
/// <br/>
|
|
/// <c>float mMinVelocityForRestitution = 1.0f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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)
|
|
/// </code>
|
|
/// </remarks>
|
|
[FieldOffset(64)]
|
|
public float mMinVelocityForRestitution;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L89">Jolt/Physics/PhysicsSettings.h:89</see>
|
|
/// <br/>
|
|
/// <c>float mTimeBeforeSleep = 0.5f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Time before object is allowed to go to sleep (unit: seconds)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(68)]
|
|
public float mTimeBeforeSleep;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L96">Jolt/Physics/PhysicsSettings.h:96</see>
|
|
/// <br/>
|
|
/// <c>float mPointVelocitySleepThreshold = 0.03f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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)
|
|
/// </code>
|
|
/// </remarks>
|
|
[FieldOffset(72)]
|
|
public float mPointVelocitySleepThreshold;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L99">Jolt/Physics/PhysicsSettings.h:99</see>
|
|
/// <br/>
|
|
/// <c>bool mDeterministicSimulation = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <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>
|
|
/// </remarks>
|
|
[FieldOffset(76)]
|
|
public Brutal.Bool8 mDeterministicSimulation;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L105">Jolt/Physics/PhysicsSettings.h:105</see>
|
|
/// <br/>
|
|
/// <c>bool mConstraintWarmStart = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Whether or not to use warm starting for constraints (initially applying previous frames impulses)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(77)]
|
|
public Brutal.Bool8 mConstraintWarmStart;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L108">Jolt/Physics/PhysicsSettings.h:108</see>
|
|
/// <br/>
|
|
/// <c>bool mUseBodyPairContactCache = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <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>
|
|
/// </remarks>
|
|
[FieldOffset(78)]
|
|
public Brutal.Bool8 mUseBodyPairContactCache;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L111">Jolt/Physics/PhysicsSettings.h:111</see>
|
|
/// <br/>
|
|
/// <c>bool mUseManifoldReduction = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Whether or not to reduce manifolds with similar contact normals into one contact manifold (see
|
|
/// description at Body::SetUseManifoldReduction)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(79)]
|
|
public Brutal.Bool8 mUseManifoldReduction;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L114">Jolt/Physics/PhysicsSettings.h:114</see>
|
|
/// <br/>
|
|
/// <c>bool mUseLargeIslandSplitter = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If we split up large islands into smaller parallel batches of work (to improve performance)
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(80)]
|
|
public Brutal.Bool8 mUseLargeIslandSplitter;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L117">Jolt/Physics/PhysicsSettings.h:117</see>
|
|
/// <br/>
|
|
/// <c>bool mAllowSleeping = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If objects can go to sleep or not
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(81)]
|
|
public Brutal.Bool8 mAllowSleeping;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/PhysicsSettings.h#L120">Jolt/Physics/PhysicsSettings.h:120</see>
|
|
/// <br/>
|
|
/// <c>bool mCheckActiveEdges = true</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// When false, we prevent collision against non-active (shared) edges. Mainly for debugging the algorithm.
|
|
/// </para>
|
|
/// </remarks>
|
|
[FieldOffset(82)]
|
|
public Brutal.Bool8 mCheckActiveEdges;
|
|
}
|
|
}
|