Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics/src/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h @ 1963

Last change on this file since 1963 was 1963, checked in by rgrieder, 16 years ago

Added Bullet physics engine.

  • Property svn:eol-style set to native
File size: 2.3 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 CONTACT_SOLVER_INFO
17#define CONTACT_SOLVER_INFO
18
19enum    btSolverMode
20{
21        SOLVER_RANDMIZE_ORDER = 1,
22        SOLVER_FRICTION_SEPARATE = 2,
23        SOLVER_USE_WARMSTARTING = 4,
24        SOLVER_CACHE_FRIENDLY = 8
25};
26
27struct btContactSolverInfoData
28{
29       
30
31        btScalar        m_tau;
32        btScalar        m_damping;
33        btScalar        m_friction;
34        btScalar        m_timeStep;
35        btScalar        m_restitution;
36        int             m_numIterations;
37        btScalar        m_maxErrorReduction;
38        btScalar        m_sor;
39        btScalar        m_erp;//used as Baumgarte factor
40        btScalar        m_erp2;//used in Split Impulse
41        int                     m_splitImpulse;
42        btScalar        m_splitImpulsePenetrationThreshold;
43        btScalar        m_linearSlop;
44        btScalar        m_warmstartingFactor;
45
46        int                     m_solverMode;
47        int     m_restingContactRestitutionThreshold;
48
49
50};
51
52struct btContactSolverInfo : public btContactSolverInfoData
53{
54
55       
56
57        inline btContactSolverInfo()
58        {
59                m_tau = btScalar(0.6);
60                m_damping = btScalar(1.0);
61                m_friction = btScalar(0.3);
62                m_restitution = btScalar(0.);
63                m_maxErrorReduction = btScalar(20.);
64                m_numIterations = 10;
65                m_erp = btScalar(0.2);
66                m_erp2 = btScalar(0.1);
67                m_sor = btScalar(1.3);
68                m_splitImpulse = false;
69                m_splitImpulsePenetrationThreshold = -0.02f;
70                m_linearSlop = btScalar(0.0);
71                m_warmstartingFactor=btScalar(0.85);
72                m_solverMode = SOLVER_RANDMIZE_ORDER | SOLVER_CACHE_FRIENDLY | SOLVER_USE_WARMSTARTING;
73                m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution
74        }
75};
76
77#endif //CONTACT_SOLVER_INFO
Note: See TracBrowser for help on using the repository browser.