Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h @ 9962

Last change on this file since 9962 was 8393, checked in by rgrieder, 14 years ago

Updated Bullet from v2.77 to v2.78.
(I'm not going to make a branch for that since the update from 2.74 to 2.77 hasn't been tested that much either).

You will HAVE to do a complete RECOMPILE! I tested with MSVC and MinGW and they both threw linker errors at me.

  • Property svn:eol-style set to native
File size: 3.0 KB
Line 
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_CONTACT_SOLVER_INFO
17#define BT_CONTACT_SOLVER_INFO
18
19enum    btSolverMode
20{
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.
31};
32
33struct btContactSolverInfoData
34{
35       
36
37        btScalar        m_tau;
38        btScalar        m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
39        btScalar        m_friction;
40        btScalar        m_timeStep;
41        btScalar        m_restitution;
42        int             m_numIterations;
43        btScalar        m_maxErrorReduction;
44        btScalar        m_sor;
45        btScalar        m_erp;//used as Baumgarte factor
46        btScalar        m_erp2;//used in Split Impulse
47        btScalar        m_globalCfm;//constraint force mixing
48        int                     m_splitImpulse;
49        btScalar        m_splitImpulsePenetrationThreshold;
50        btScalar        m_linearSlop;
51        btScalar        m_warmstartingFactor;
52
53        int                     m_solverMode;
54        int     m_restingContactRestitutionThreshold;
55        int                     m_minimumSolverBatchSize;
56
57
58};
59
60struct btContactSolverInfo : public btContactSolverInfoData
61{
62
63       
64
65        inline btContactSolverInfo()
66        {
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.);
72                m_numIterations = 10;
73                m_erp = btScalar(0.2);
74                m_erp2 = btScalar(0.1);
75                m_globalCfm = btScalar(0.);
76                m_sor = btScalar(1.);
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
84        }
85};
86
87#endif //BT_CONTACT_SOLVER_INFO
Note: See TracBrowser for help on using the repository browser.