Bullet Collision Detection & Physics Library
btManifoldPoint.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
16 #ifndef BT_MANIFOLD_CONTACT_POINT_H
17 #define BT_MANIFOLD_CONTACT_POINT_H
18 
19 #include "LinearMath/btVector3.h"
21 
22 #ifdef PFX_USE_FREE_VECTORMATH
23  #include "physics_effects/base_level/solver/pfx_constraint_row.h"
25 #else
26  // Don't change following order of parameters
28  btScalar m_normal[3];
34  };
36 #endif //PFX_USE_FREE_VECTORMATH
37 
39 {
44 };
45 
49  {
50  public:
54  m_appliedImpulse(0.f),
57  m_contactMotion1(0.f),
58  m_contactMotion2(0.f),
59  m_contactCFM(0.f),
60  m_contactERP(0.f),
61  m_frictionCFM(0.f),
62  m_lifeTime(0)
63  {
64  }
65 
66  btManifoldPoint( const btVector3 &pointA, const btVector3 &pointB,
67  const btVector3 &normal,
68  btScalar distance ) :
69  m_localPointA( pointA ),
70  m_localPointB( pointB ),
71  m_normalWorldOnB( normal ),
72  m_distance1( distance ),
79  m_appliedImpulse(0.f),
82  m_contactMotion1(0.f),
83  m_contactMotion2(0.f),
84  m_contactCFM(0.f),
85  m_contactERP(0.f),
86  m_frictionCFM(0.f),
87  m_lifeTime(0)
88  {
89 
90  }
91 
92 
93 
100 
103  btScalar m_combinedRollingFriction;//torsional friction orthogonal to contact normal, useful to make spheres stop rolling forever
104  btScalar m_combinedSpinningFriction;//torsional friction around contact normal, useful for grasping objects
106 
107  //BP mod, store contact triangles.
110  int m_index0;
111  int m_index1;
112 
113  mutable void* m_userPersistentData;
114  //bool m_lateralFrictionInitialized;
116 
122 
123  union
124  {
127  };
128 
129  union
130  {
133  };
134 
136 
137  int m_lifeTime;//lifetime of the contactpoint in frames
138 
141 
142 
143 
144 
146  {
147  return m_distance1;
148  }
149  int getLifeTime() const
150  {
151  return m_lifeTime;
152  }
153 
155  return m_positionWorldOnA;
156 // return m_positionWorldOnB + m_normalWorldOnB * m_distance1;
157  }
158 
160  {
161  return m_positionWorldOnB;
162  }
163 
165  {
166  m_distance1 = dist;
167  }
168 
171  {
172  return m_appliedImpulse;
173  }
174 
175 
176 
177  };
178 
179 #endif //BT_MANIFOLD_CONTACT_POINT_H
const btVector3 & getPositionWorldOnA() const
btScalar m_combinedContactStiffness1
btVector3 m_lateralFrictionDir1
btScalar m_appliedImpulseLateral1
btScalar m_combinedRestitution
btScalar m_appliedImpulse
btConstraintRow PfxConstraintRow
btScalar m_frictionCFM
ManifoldContactPoint collects and maintains persistent contactpoints.
btScalar m_contactMotion1
btManifoldPoint(const btVector3 &pointA, const btVector3 &pointB, const btVector3 &normal, btScalar distance)
btScalar m_combinedRollingFriction
btVector3 m_normalWorldOnB
void * m_userPersistentData
btVector3 m_positionWorldOnB
btVector3 m_localPointA
const btVector3 & getPositionWorldOnB() const
btScalar m_appliedImpulseLateral2
btContactPointFlags
btScalar getAppliedImpulse() const
this returns the most recent applied impulse, to satisfy contact constraints by the constraint solver...
btScalar m_accumImpulse
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity ...
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:65
btScalar m_lowerLimit
btScalar m_combinedContactDamping1
btVector3 m_localPointB
void setDistance(btScalar dist)
btScalar m_contactMotion2
btScalar m_upperLimit
btScalar m_combinedFriction
btScalar m_jacDiagInv
btVector3 m_lateralFrictionDir2
int getLifeTime() const
btScalar getDistance() const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:279
btScalar m_combinedSpinningFriction