//
// 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
{
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:30
///
/// struct PhysicsSettings
///
///
[StructLayout(LayoutKind.Explicit, Size = 88)]
public partial struct PhysicsSettings
{
///
///
/// 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.
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:36
///
/// int mMaxInFlightBodyPairs = 16384
///
///
[FieldOffset(0)]
public int MaxInFlightBodyPairs;
///
///
/// How many PhysicsStepListeners to notify in 1 batch
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:39
///
/// int mStepListenersBatchSize = 8
///
///
[FieldOffset(4)]
public int StepListenersBatchSize;
///
///
/// How many step listener batches are needed before spawning another job (set to INT_MAX if no parallelism
/// is desired)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:42
///
/// int mStepListenerBatchesPerJob = 1
///
///
[FieldOffset(8)]
public int StepListenerBatchesPerJob;
///
///
/// Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update) (unit:
/// dimensionless, 0 = nothing, 1 = 100%)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:45
///
/// float mBaumgarte = 0.2f
///
///
[FieldOffset(12)]
public float Baumgarte;
///
///
/// 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)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:50
///
/// float mSpeculativeContactDistance = 0.02f
///
///
[FieldOffset(16)]
public float SpeculativeContactDistance;
///
///
/// How much bodies are allowed to sink into each other (unit: meters)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:53
///
/// float mPenetrationSlop = 0.02f
///
///
[FieldOffset(20)]
public float PenetrationSlop;
///
///
/// Fraction of its inner radius a body must move per step to enable casting for the LinearCast motion
/// quality
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:56
///
/// float mLinearCastThreshold = 0.75f
///
///
[FieldOffset(24)]
public float LinearCastThreshold;
///
///
/// Fraction of its inner radius a body may penetrate another body for the LinearCast motion quality
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:59
///
/// float mLinearCastMaxPenetration = 0.25f
///
///
[FieldOffset(28)]
public float LinearCastMaxPenetration;
///
///
/// 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)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:62
///
/// float mManifoldTolerance = 1.0e-3f
///
///
[FieldOffset(32)]
public float ManifoldTolerance;
///
///
/// Maximum distance to correct in a single iteration when solving position constraints (unit: meters)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:65
///
/// float mMaxPenetrationDistance = 0.2f
///
///
[FieldOffset(36)]
public float MaxPenetrationDistance;
///
///
/// 1 mm
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:68
///
/// float mBodyPairCacheMaxDeltaPositionSq = Square(0.001f)
///
///
///
///
/// Maximum relative delta position for body pairs to be able to reuse collision results from last frame
/// (units: meter^2)
///
///
[FieldOffset(40)]
public float BodyPairCacheMaxDeltaPositionSq;
///
///
/// cos(2 degrees / 2)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:71
///
/// float mBodyPairCacheCosMaxDeltaRotationDiv2 = 0.99984769515639123915701155881391f
///
///
///
///
/// Maximum relative delta orientation for body pairs to be able to reuse collision results from last frame,
/// stored as cos(max angle / 2)
///
///
[FieldOffset(44)]
public float BodyPairCacheCosMaxDeltaRotationDiv2;
///
///
/// cos(5 degree)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:74
///
/// float mContactNormalCosMaxDeltaRotation = 0.99619469809174553229501040247389f
///
///
///
///
/// Maximum angle between normals that allows manifolds between different sub shapes of the same body pair
/// to be combined
///
///
[FieldOffset(48)]
public float ContactNormalCosMaxDeltaRotation;
///
///
/// 1 cm
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:77
///
/// float mContactPointPreserveLambdaMaxDistSq = Square(0.01f)
///
///
///
///
/// Maximum allowed distance between old and new contact point to preserve contact forces for warm start
/// (units: meter^2)
///
///
[FieldOffset(52)]
public float ContactPointPreserveLambdaMaxDistSq;
///
///
/// 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)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:80
///
/// float mInternalEdgeRemovalVertexToleranceSq = cDefaultInternalEdgeRemovalVertexToleranceSq
///
///
[FieldOffset(56)]
public float InternalEdgeRemovalVertexToleranceSq;
///
///
/// Number of solver velocity iterations to run Note that this needs to be >= 2 in order for friction to
/// work (friction is applied using the non-penetration impulse from the previous iteration)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:84
///
/// uint mNumVelocitySteps = 10
///
///
[FieldOffset(60)]
public uint NumVelocitySteps;
///
///
/// Number of solver position iterations to run
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:87
///
/// uint mNumPositionSteps = 2
///
///
[FieldOffset(64)]
public uint NumPositionSteps;
///
///
/// 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)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:92
///
/// float mMinVelocityForRestitution = 1.0f
///
///
[FieldOffset(68)]
public float MinVelocityForRestitution;
///
///
/// Time before object is allowed to go to sleep (unit: seconds)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:95
///
/// float mTimeBeforeSleep = 0.5f
///
///
[FieldOffset(72)]
public float TimeBeforeSleep;
///
///
/// 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)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:102
///
/// float mPointVelocitySleepThreshold = 0.03f
///
///
[FieldOffset(76)]
public float PointVelocitySleepThreshold;
///
///
/// 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.
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:105
///
/// bool mDeterministicSimulation = true
///
///
[FieldOffset(80)]
public Brutal.Bool8 DeterministicSimulation;
///
///
/// Whether or not to use warm starting for constraints (initially applying previous frames impulses)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:111
///
/// bool mConstraintWarmStart = true
///
///
[FieldOffset(81)]
public Brutal.Bool8 ConstraintWarmStart;
///
///
/// 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
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:114
///
/// bool mUseBodyPairContactCache = true
///
///
[FieldOffset(82)]
public Brutal.Bool8 UseBodyPairContactCache;
///
///
/// Whether or not to reduce manifolds with similar contact normals into one contact manifold (see
/// description at Body::SetUseManifoldReduction)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:117
///
/// bool mUseManifoldReduction = true
///
///
[FieldOffset(83)]
public Brutal.Bool8 UseManifoldReduction;
///
///
/// If we split up large islands into smaller parallel batches of work (to improve performance)
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:120
///
/// bool mUseLargeIslandSplitter = true
///
///
[FieldOffset(84)]
public Brutal.Bool8 UseLargeIslandSplitter;
///
///
/// If objects can go to sleep or not
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:123
///
/// bool mAllowSleeping = true
///
///
[FieldOffset(85)]
public Brutal.Bool8 AllowSleeping;
///
///
/// When false, we prevent collision against non-active (shared) edges. Mainly for debugging the algorithm.
///
///
/// C++:
/// Jolt/Physics/PhysicsSettings.h:126
///
/// bool mCheckActiveEdges = true
///
///
[FieldOffset(86)]
public Brutal.Bool8 CheckActiveEdges;
}
}