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