00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef MANIFOLD_CONTACT_POINT_H
00017 #define MANIFOLD_CONTACT_POINT_H
00018
00019 #include "LinearMath/btVector3.h"
00020 #include "LinearMath/btTransformUtil.h"
00021
00022
00023
00024
00025
00028 class btManifoldPoint
00029 {
00030 public:
00031 btManifoldPoint()
00032 :m_userPersistentData(0),
00033 m_appliedImpulse(0.f),
00034 m_lateralFrictionInitialized(false),
00035 m_appliedImpulseLateral1(0.f),
00036 m_appliedImpulseLateral2(0.f),
00037 m_contactMotion1(0.f),
00038 m_contactMotion2(0.f),
00039 m_contactCFM1(0.f),
00040 m_contactCFM2(0.f),
00041 m_lifeTime(0)
00042 {
00043 }
00044
00045 btManifoldPoint( const btVector3 &pointA, const btVector3 &pointB,
00046 const btVector3 &normal,
00047 btScalar distance ) :
00048 m_localPointA( pointA ),
00049 m_localPointB( pointB ),
00050 m_normalWorldOnB( normal ),
00051 m_distance1( distance ),
00052 m_combinedFriction(btScalar(0.)),
00053 m_combinedRestitution(btScalar(0.)),
00054 m_userPersistentData(0),
00055 m_appliedImpulse(0.f),
00056 m_lateralFrictionInitialized(false),
00057 m_appliedImpulseLateral1(0.f),
00058 m_appliedImpulseLateral2(0.f),
00059 m_contactMotion1(0.f),
00060 m_contactMotion2(0.f),
00061 m_contactCFM1(0.f),
00062 m_contactCFM2(0.f),
00063 m_lifeTime(0)
00064 {
00065
00066
00067 }
00068
00069
00070
00071 btVector3 m_localPointA;
00072 btVector3 m_localPointB;
00073 btVector3 m_positionWorldOnB;
00075 btVector3 m_positionWorldOnA;
00076 btVector3 m_normalWorldOnB;
00077
00078 btScalar m_distance1;
00079 btScalar m_combinedFriction;
00080 btScalar m_combinedRestitution;
00081
00082
00083 int m_partId0;
00084 int m_partId1;
00085 int m_index0;
00086 int m_index1;
00087
00088 mutable void* m_userPersistentData;
00089 btScalar m_appliedImpulse;
00090
00091 bool m_lateralFrictionInitialized;
00092 btScalar m_appliedImpulseLateral1;
00093 btScalar m_appliedImpulseLateral2;
00094 btScalar m_contactMotion1;
00095 btScalar m_contactMotion2;
00096 btScalar m_contactCFM1;
00097 btScalar m_contactCFM2;
00098
00099 int m_lifeTime;
00100
00101 btVector3 m_lateralFrictionDir1;
00102 btVector3 m_lateralFrictionDir2;
00103
00104 btScalar getDistance() const
00105 {
00106 return m_distance1;
00107 }
00108 int getLifeTime() const
00109 {
00110 return m_lifeTime;
00111 }
00112
00113 const btVector3& getPositionWorldOnA() const {
00114 return m_positionWorldOnA;
00115
00116 }
00117
00118 const btVector3& getPositionWorldOnB() const
00119 {
00120 return m_positionWorldOnB;
00121 }
00122
00123 void setDistance(btScalar dist)
00124 {
00125 m_distance1 = dist;
00126 }
00127
00129 btScalar getAppliedImpulse() const
00130 {
00131 return m_appliedImpulse;
00132 }
00133
00134
00135
00136 };
00137
00138 #endif //MANIFOLD_CONTACT_POINT_H