00001 /* 00002 Bullet Continuous Collision Detection and Physics Library 00003 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 00004 00005 This software is provided 'as-is', without any express or implied warranty. 00006 In no event will the authors be held liable for any damages arising from the use of this software. 00007 Permission is granted to anyone to use this software for any purpose, 00008 including commercial applications, and to alter it and redistribute it freely, 00009 subject to the following restrictions: 00010 00011 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. 00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 00013 3. This notice may not be removed or altered from any source distribution. 00014 */ 00015 00016 #ifndef BT_CONTACT_SOLVER_INFO 00017 #define BT_CONTACT_SOLVER_INFO 00018 00019 enum btSolverMode 00020 { 00021 SOLVER_RANDMIZE_ORDER = 1, 00022 SOLVER_FRICTION_SEPARATE = 2, 00023 SOLVER_USE_WARMSTARTING = 4, 00024 SOLVER_USE_FRICTION_WARMSTARTING = 8, 00025 SOLVER_USE_2_FRICTION_DIRECTIONS = 16, 00026 SOLVER_ENABLE_FRICTION_DIRECTION_CACHING = 32, 00027 SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION = 64, 00028 SOLVER_CACHE_FRIENDLY = 128, 00029 SOLVER_SIMD = 256, //enabled for Windows, the solver innerloop is branchless SIMD, 40% faster than FPU/scalar version 00030 SOLVER_CUDA = 512 //will be open sourced during Game Developers Conference 2009. Much faster. 00031 }; 00032 00033 struct btContactSolverInfoData 00034 { 00035 00036 00037 btScalar m_tau; 00038 btScalar m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'. 00039 btScalar m_friction; 00040 btScalar m_timeStep; 00041 btScalar m_restitution; 00042 int m_numIterations; 00043 btScalar m_maxErrorReduction; 00044 btScalar m_sor; 00045 btScalar m_erp;//used as Baumgarte factor 00046 btScalar m_erp2;//used in Split Impulse 00047 btScalar m_globalCfm;//constraint force mixing 00048 int m_splitImpulse; 00049 btScalar m_splitImpulsePenetrationThreshold; 00050 btScalar m_linearSlop; 00051 btScalar m_warmstartingFactor; 00052 00053 int m_solverMode; 00054 int m_restingContactRestitutionThreshold; 00055 int m_minimumSolverBatchSize; 00056 00057 00058 }; 00059 00060 struct btContactSolverInfo : public btContactSolverInfoData 00061 { 00062 00063 00064 00065 inline btContactSolverInfo() 00066 { 00067 m_tau = btScalar(0.6); 00068 m_damping = btScalar(1.0); 00069 m_friction = btScalar(0.3); 00070 m_restitution = btScalar(0.); 00071 m_maxErrorReduction = btScalar(20.); 00072 m_numIterations = 10; 00073 m_erp = btScalar(0.2); 00074 m_erp2 = btScalar(0.1); 00075 m_globalCfm = btScalar(0.); 00076 m_sor = btScalar(1.); 00077 m_splitImpulse = false; 00078 m_splitImpulsePenetrationThreshold = -0.02f; 00079 m_linearSlop = btScalar(0.0); 00080 m_warmstartingFactor=btScalar(0.85); 00081 m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD;// | SOLVER_RANDMIZE_ORDER; 00082 m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution 00083 m_minimumSolverBatchSize = 128; //try to combine islands until the amount of constraints reaches this limit 00084 } 00085 }; 00086 00087 #endif //BT_CONTACT_SOLVER_INFO