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_SOLVER_CONSTRAINT_H 00017 #define BT_SOLVER_CONSTRAINT_H 00018 00019 class btRigidBody; 00020 #include "LinearMath/btVector3.h" 00021 #include "LinearMath/btMatrix3x3.h" 00022 #include "btJacobianEntry.h" 00023 #include "LinearMath/btAlignedObjectArray.h" 00024 00025 //#define NO_FRICTION_TANGENTIALS 1 00026 #include "btSolverBody.h" 00027 00028 00030 ATTRIBUTE_ALIGNED16 (struct) btSolverConstraint 00031 { 00032 BT_DECLARE_ALIGNED_ALLOCATOR(); 00033 00034 btVector3 m_relpos1CrossNormal; 00035 btVector3 m_contactNormal; 00036 00037 btVector3 m_relpos2CrossNormal; 00038 //btVector3 m_contactNormal2;//usually m_contactNormal2 == -m_contactNormal 00039 00040 btVector3 m_angularComponentA; 00041 btVector3 m_angularComponentB; 00042 00043 mutable btSimdScalar m_appliedPushImpulse; 00044 mutable btSimdScalar m_appliedImpulse; 00045 00046 btScalar m_friction; 00047 btScalar m_jacDiagABInv; 00048 btScalar m_rhs; 00049 btScalar m_cfm; 00050 00051 btScalar m_lowerLimit; 00052 btScalar m_upperLimit; 00053 btScalar m_rhsPenetration; 00054 union 00055 { 00056 void* m_originalContactPoint; 00057 btScalar m_unusedPadding4; 00058 }; 00059 00060 int m_overrideNumSolverIterations; 00061 int m_frictionIndex; 00062 int m_solverBodyIdA; 00063 int m_solverBodyIdB; 00064 00065 00066 enum btSolverConstraintType 00067 { 00068 BT_SOLVER_CONTACT_1D = 0, 00069 BT_SOLVER_FRICTION_1D 00070 }; 00071 }; 00072 00073 typedef btAlignedObjectArray<btSolverConstraint> btConstraintArray; 00074 00075 00076 #endif //BT_SOLVER_CONSTRAINT_H 00077 00078 00079