Bullet Collision Detection & Physics Library
btManifoldPoint.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. 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
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{
45};
46
50 {
51 public:
60 m_contactCFM(0.f),
61 m_contactERP(0.f),
62 m_frictionCFM(0.f),
63 m_lifeTime(0)
64 {
65 }
66
67 btManifoldPoint( const btVector3 &pointA, const btVector3 &pointB,
68 const btVector3 &normal,
69 btScalar distance ) :
70 m_localPointA( pointA ),
71 m_localPointB( pointB ),
72 m_normalWorldOnB( normal ),
73 m_distance1( distance ),
85 m_contactCFM(0.f),
86 m_contactERP(0.f),
87 m_frictionCFM(0.f),
88 m_lifeTime(0)
89 {
90
91 }
92
93
94
101
104 btScalar m_combinedRollingFriction;//torsional friction orthogonal to contact normal, useful to make spheres stop rolling forever
105 btScalar m_combinedSpinningFriction;//torsional friction around contact normal, useful for grasping objects
107
108 //BP mod, store contact triangles.
113
114 mutable void* m_userPersistentData;
115 //bool m_lateralFrictionInitialized;
117
123
124 union
125 {
128 };
129
130 union
131 {
134 };
135
137
138 int m_lifeTime;//lifetime of the contactpoint in frames
139
142
143
144
145
147 {
148 return m_distance1;
149 }
150 int getLifeTime() const
151 {
152 return m_lifeTime;
153 }
154
156 return m_positionWorldOnA;
157// return m_positionWorldOnB + m_normalWorldOnB * m_distance1;
158 }
159
161 {
162 return m_positionWorldOnB;
163 }
164
166 {
167 m_distance1 = dist;
168 }
169
172 {
173 return m_appliedImpulse;
174 }
175
176
177
178 };
179
180#endif //BT_MANIFOLD_CONTACT_POINT_H
btContactPointFlags
@ BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED
@ BT_CONTACT_FLAG_HAS_CONTACT_ERP
@ BT_CONTACT_FLAG_HAS_CONTACT_CFM
@ BT_CONTACT_FLAG_CONTACT_STIFFNESS_DAMPING
@ BT_CONTACT_FLAG_FRICTION_ANCHOR
btConstraintRow PfxConstraintRow
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:292
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:82
ManifoldContactPoint collects and maintains persistent contactpoints.
btScalar m_frictionCFM
btScalar m_combinedSpinningFriction
btScalar m_combinedRollingFriction
btScalar getDistance() const
btScalar m_combinedContactStiffness1
int getLifeTime() const
btScalar m_combinedRestitution
btVector3 m_localPointA
btVector3 m_lateralFrictionDir2
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
btVector3 m_localPointB
btScalar m_combinedContactDamping1
const btVector3 & getPositionWorldOnB() const
btScalar m_appliedImpulseLateral2
const btVector3 & getPositionWorldOnA() const
btScalar m_appliedImpulse
void setDistance(btScalar dist)
void * m_userPersistentData
btScalar m_appliedImpulseLateral1
btVector3 m_normalWorldOnB
btScalar m_combinedFriction
btVector3 m_positionWorldOnB
btScalar m_contactMotion2
btScalar getAppliedImpulse() const
this returns the most recent applied impulse, to satisfy contact constraints by the constraint solver
btVector3 m_lateralFrictionDir1
btScalar m_contactMotion1
btManifoldPoint(const btVector3 &pointA, const btVector3 &pointB, const btVector3 &normal, btScalar distance)
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:84
btScalar m_jacDiagInv
btScalar m_upperLimit
btScalar m_lowerLimit
btScalar m_accumImpulse