|
Bullet Collision Detection & Physics Library
|
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 00024 //#define NO_FRICTION_TANGENTIALS 1 00025 #include "btSolverBody.h" 00026 00027 00029 ATTRIBUTE_ALIGNED64 (struct) btSolverConstraint 00030 { 00031 BT_DECLARE_ALIGNED_ALLOCATOR(); 00032 00033 btVector3 m_relpos1CrossNormal; 00034 btVector3 m_contactNormal; 00035 00036 btVector3 m_relpos2CrossNormal; 00037 //btVector3 m_contactNormal2;//usually m_contactNormal2 == -m_contactNormal 00038 00039 btVector3 m_angularComponentA; 00040 btVector3 m_angularComponentB; 00041 00042 mutable btSimdScalar m_appliedPushImpulse; 00043 mutable btSimdScalar m_appliedImpulse; 00044 00045 00046 btScalar m_friction; 00047 btScalar m_jacDiagABInv; 00048 union 00049 { 00050 int m_numConsecutiveRowsPerKernel; 00051 btScalar m_unusedPadding0; 00052 }; 00053 00054 int m_overrideNumSolverIterations; 00055 00056 union 00057 { 00058 int m_frictionIndex; 00059 btScalar m_unusedPadding1; 00060 }; 00061 union 00062 { 00063 btRigidBody* m_solverBodyA; 00064 int m_companionIdA; 00065 }; 00066 union 00067 { 00068 btRigidBody* m_solverBodyB; 00069 int m_companionIdB; 00070 }; 00071 00072 union 00073 { 00074 void* m_originalContactPoint; 00075 btScalar m_unusedPadding4; 00076 }; 00077 00078 btScalar m_rhs; 00079 btScalar m_cfm; 00080 btScalar m_lowerLimit; 00081 btScalar m_upperLimit; 00082 00083 btScalar m_rhsPenetration; 00084 00085 enum btSolverConstraintType 00086 { 00087 BT_SOLVER_CONTACT_1D = 0, 00088 BT_SOLVER_FRICTION_1D 00089 }; 00090 }; 00091 00092 typedef btAlignedObjectArray<btSolverConstraint> btConstraintArray; 00093 00094 00095 #endif //BT_SOLVER_CONSTRAINT_H 00096 00097 00098