2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
16 #ifndef BT_CONTACT_SOLVER_INFO
17 #define BT_CONTACT_SOLVER_INFO
21 SOLVER_RANDMIZE_ORDER = 1,
22 SOLVER_FRICTION_SEPARATE = 2,
23 SOLVER_USE_WARMSTARTING = 4,
24 SOLVER_USE_FRICTION_WARMSTARTING = 8,
25 SOLVER_USE_2_FRICTION_DIRECTIONS = 16,
26 SOLVER_ENABLE_FRICTION_DIRECTION_CACHING = 32,
27 SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION = 64,
28 SOLVER_CACHE_FRIENDLY = 128,
29 SOLVER_SIMD = 256, //enabled for Windows, the solver innerloop is branchless SIMD, 40% faster than FPU/scalar version
30 SOLVER_CUDA = 512 //will be open sourced during Game Developers Conference 2009. Much faster.
33 struct btContactSolverInfoData
38 btScalar m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
41 btScalar m_restitution;
43 btScalar m_maxErrorReduction;
45 btScalar m_erp;//used as Baumgarte factor
46 btScalar m_erp2;//used in Split Impulse
47 btScalar m_globalCfm;//constraint force mixing
49 btScalar m_splitImpulsePenetrationThreshold;
50 btScalar m_linearSlop;
51 btScalar m_warmstartingFactor;
54 int m_restingContactRestitutionThreshold;
55 int m_minimumSolverBatchSize;
60 struct btContactSolverInfo : public btContactSolverInfoData
65 inline btContactSolverInfo()
67 m_tau = btScalar(0.6);
68 m_damping = btScalar(1.0);
69 m_friction = btScalar(0.3);
70 m_restitution = btScalar(0.);
71 m_maxErrorReduction = btScalar(20.);
73 m_erp = btScalar(0.2);
74 m_erp2 = btScalar(0.1);
75 m_globalCfm = btScalar(0.);
77 m_splitImpulse = false;
78 m_splitImpulsePenetrationThreshold = -0.02f;
79 m_linearSlop = btScalar(0.0);
80 m_warmstartingFactor=btScalar(0.85);
81 m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD;// | SOLVER_RANDMIZE_ORDER;
82 m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution
83 m_minimumSolverBatchSize = 128; //try to combine islands until the amount of constraints reaches this limit
87 #endif //BT_CONTACT_SOLVER_INFO