Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PhysicsSettings.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10constexpr float cDefaultCollisionTolerance = 1.0e-4f;
11
13constexpr float cDefaultPenetrationTolerance = 1.0e-4f;
14
16constexpr float cDefaultConvexRadius = 0.05f;
17
19constexpr float cCapsuleProjectionSlop = 0.02f;
20
23
25constexpr int cMaxPhysicsJobs = 2048;
26
28constexpr int cMaxPhysicsBarriers = 8;
29
31{
33
37
40
43
45 float mBaumgarte = 0.2f;
46
51
53 float mPenetrationSlop = 0.02f;
54
56 float mLinearCastThreshold = 0.75f;
57
60
62 float mManifoldTolerance = 1.0e-3f;
63
66
69
71 float mBodyPairCacheCosMaxDeltaRotationDiv2 = 0.99984769515639123915701155881391f;
72
74 float mContactNormalCosMaxDeltaRotation = 0.99619469809174553229501040247389f;
75
78
81
85
88
93
95 float mTimeBeforeSleep = 0.5f;
96
103
106
109
112
115
118
121
123 bool mAllowSleeping = true;
124
126 bool mCheckActiveEdges = true;
127
129};
130
unsigned int uint
Definition Core.h:500
#define JPH_NAMESPACE_END
Definition Core.h:425
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
JPH_INLINE constexpr T Square(T inV)
Square a value.
Definition Math.h:55
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:50
constexpr int cMaxPhysicsJobs
Maximum amount of jobs to allow.
Definition PhysicsSettings.h:25
constexpr float cCapsuleProjectionSlop
Used by (Tapered)CapsuleShape to determine when supporting face is an edge rather than a point (unit:...
Definition PhysicsSettings.h:19
constexpr float cDefaultInternalEdgeRemovalVertexToleranceSq
Max squared distance to consider a vertex to be the same as another vertex, used by the internal edge...
Definition PhysicsSettings.h:22
JPH_NAMESPACE_BEGIN constexpr float cDefaultCollisionTolerance
If objects are closer than this distance, they are considered to be colliding (used for GJK) (unit: m...
Definition PhysicsSettings.h:10
constexpr int cMaxPhysicsBarriers
Maximum amount of barriers to allow.
Definition PhysicsSettings.h:28
constexpr float cDefaultPenetrationTolerance
A factor that determines the accuracy of the penetration depth calculation. If the change of the squa...
Definition PhysicsSettings.h:13
constexpr float cDefaultConvexRadius
How much padding to add around objects.
Definition PhysicsSettings.h:16
Definition PhysicsSettings.h:31
float mTimeBeforeSleep
Time before object is allowed to go to sleep (unit: seconds)
Definition PhysicsSettings.h:95
uint mNumPositionSteps
Number of solver position iterations to run.
Definition PhysicsSettings.h:87
float mMinVelocityForRestitution
Definition PhysicsSettings.h:92
JPH_OVERRIDE_NEW_DELETE int mMaxInFlightBodyPairs
Definition PhysicsSettings.h:36
bool mAllowSleeping
If objects can go to sleep or not.
Definition PhysicsSettings.h:123
bool mUseBodyPairContactCache
Whether or not to use the body pair cache, which removes the need for narrow phase collision detectio...
Definition PhysicsSettings.h:114
float mInternalEdgeRemovalVertexToleranceSq
Max squared distance to consider a vertex to be the same as another vertex, used by the internal edge...
Definition PhysicsSettings.h:80
int mStepListenersBatchSize
How many PhysicsStepListeners to notify in 1 batch.
Definition PhysicsSettings.h:39
uint mNumVelocitySteps
Definition PhysicsSettings.h:84
float mContactPointPreserveLambdaMaxDistSq
Maximum allowed distance between old and new contact point to preserve contact forces for warm start ...
Definition PhysicsSettings.h:77
float mBodyPairCacheMaxDeltaPositionSq
Maximum relative delta position for body pairs to be able to reuse collision results from last frame ...
Definition PhysicsSettings.h:68
float mMaxPenetrationDistance
Maximum distance to correct in a single iteration when solving position constraints (unit: meters)
Definition PhysicsSettings.h:65
float mPenetrationSlop
How much bodies are allowed to sink into each other (unit: meters)
Definition PhysicsSettings.h:53
float mSpeculativeContactDistance
Definition PhysicsSettings.h:50
float mLinearCastMaxPenetration
Fraction of its inner radius a body may penetrate another body for the LinearCast motion quality.
Definition PhysicsSettings.h:59
float mPointVelocitySleepThreshold
Definition PhysicsSettings.h:102
float mLinearCastThreshold
Fraction of its inner radius a body must move per step to enable casting for the LinearCast motion qu...
Definition PhysicsSettings.h:56
float mBodyPairCacheCosMaxDeltaRotationDiv2
Maximum relative delta orientation for body pairs to be able to reuse collision results from last fra...
Definition PhysicsSettings.h:71
bool mUseLargeIslandSplitter
If we split up large islands into smaller parallel batches of work (to improve performance)
Definition PhysicsSettings.h:120
bool mConstraintWarmStart
Whether or not to use warm starting for constraints (initially applying previous frames impulses)
Definition PhysicsSettings.h:111
bool mCheckActiveEdges
When false, we prevent collision against non-active (shared) edges. Mainly for debugging the algorith...
Definition PhysicsSettings.h:126
float mBaumgarte
Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update) (unit: dimension...
Definition PhysicsSettings.h:45
float mManifoldTolerance
Max distance to use to determine if two points are on the same plane for determining the contact mani...
Definition PhysicsSettings.h:62
bool mDeterministicSimulation
By default the simulation is deterministic, it is possible to turn this off by setting this setting t...
Definition PhysicsSettings.h:105
float mContactNormalCosMaxDeltaRotation
Maximum angle between normals that allows manifolds between different sub shapes of the same body pai...
Definition PhysicsSettings.h:74
bool mUseManifoldReduction
Whether or not to reduce manifolds with similar contact normals into one contact manifold (see descri...
Definition PhysicsSettings.h:117
int mStepListenerBatchesPerJob
How many step listener batches are needed before spawning another job (set to INT_MAX if no paralleli...
Definition PhysicsSettings.h:42