Bullet Collision Detection & Physics Library: btSliderConstraint.h Source File

Bullet Collision Detection & Physics Library

btSliderConstraint.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
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/*
17Added by Roman Ponomarev (rponom@gmail.com)
18April 04, 2008
19
20TODO:
21 - add clamping od accumulated impulse to improve stability
22 - add conversion for ODE constraint solver
23*/
24
25#ifndef BT_SLIDER_CONSTRAINT_H
26#define BT_SLIDER_CONSTRAINT_H
27
28#include "LinearMath/btScalar.h" //for BT_USE_DOUBLE_PRECISION
29
30#ifdef BT_USE_DOUBLE_PRECISION
31#define btSliderConstraintData2 btSliderConstraintDoubleData
32#define btSliderConstraintDataName "btSliderConstraintDoubleData"
33#else
34#define btSliderConstraintData2 btSliderConstraintData
35#define btSliderConstraintDataName "btSliderConstraintData"
36#endif //BT_USE_DOUBLE_PRECISION
37
38#include "LinearMath/btVector3.h"
39#include "btJacobianEntry.h"
40#include "btTypedConstraint.h"
41
42class btRigidBody;
43
44#define SLIDER_CONSTRAINT_DEF_SOFTNESS (btScalar(1.0))
45#define SLIDER_CONSTRAINT_DEF_DAMPING (btScalar(1.0))
46#define SLIDER_CONSTRAINT_DEF_RESTITUTION (btScalar(0.7))
47#define SLIDER_CONSTRAINT_DEF_CFM (btScalar(0.f))
48
49 enum btSliderFlags
50{
51 BT_SLIDER_FLAGS_CFM_DIRLIN = (1 << 0),
52 BT_SLIDER_FLAGS_ERP_DIRLIN = (1 << 1),
53 BT_SLIDER_FLAGS_CFM_DIRANG = (1 << 2),
54 BT_SLIDER_FLAGS_ERP_DIRANG = (1 << 3),
55 BT_SLIDER_FLAGS_CFM_ORTLIN = (1 << 4),
56 BT_SLIDER_FLAGS_ERP_ORTLIN = (1 << 5),
57 BT_SLIDER_FLAGS_CFM_ORTANG = (1 << 6),
58 BT_SLIDER_FLAGS_ERP_ORTANG = (1 << 7),
59 BT_SLIDER_FLAGS_CFM_LIMLIN = (1 << 8),
60 BT_SLIDER_FLAGS_ERP_LIMLIN = (1 << 9),
61 BT_SLIDER_FLAGS_CFM_LIMANG = (1 << 10),
62 BT_SLIDER_FLAGS_ERP_LIMANG = (1 << 11)
63};
64
65 ATTRIBUTE_ALIGNED16(class)
66 btSliderConstraint : public btTypedConstraint
67{
68protected:
70 bool m_useSolveConstraintObsolete;
71 bool m_useOffsetForConstraintFrame;
72 btTransform m_frameInA;
73 btTransform m_frameInB;
74 // use frameA fo define limits, if true
75 bool m_useLinearReferenceFrameA;
76 // linear limits
77 btScalar m_lowerLinLimit;
78 btScalar m_upperLinLimit;
79 // angular limits
80 btScalar m_lowerAngLimit;
81 btScalar m_upperAngLimit;
82 // softness, restitution and damping for different cases
83 // DirLin - moving inside linear limits
84 // LimLin - hitting linear limit
85 // DirAng - moving inside angular limits
86 // LimAng - hitting angular limit
87 // OrthoLin, OrthoAng - against constraint axis
88 btScalar m_softnessDirLin;
89 btScalar m_restitutionDirLin;
90 btScalar m_dampingDirLin;
91 btScalar m_cfmDirLin;
92
93 btScalar m_softnessDirAng;
94 btScalar m_restitutionDirAng;
95 btScalar m_dampingDirAng;
96 btScalar m_cfmDirAng;
97
98 btScalar m_softnessLimLin;
99 btScalar m_restitutionLimLin;
100 btScalar m_dampingLimLin;
101 btScalar m_cfmLimLin;
102
103 btScalar m_softnessLimAng;
104 btScalar m_restitutionLimAng;
105 btScalar m_dampingLimAng;
106 btScalar m_cfmLimAng;
107
108 btScalar m_softnessOrthoLin;
109 btScalar m_restitutionOrthoLin;
110 btScalar m_dampingOrthoLin;
111 btScalar m_cfmOrthoLin;
112
113 btScalar m_softnessOrthoAng;
114 btScalar m_restitutionOrthoAng;
115 btScalar m_dampingOrthoAng;
116 btScalar m_cfmOrthoAng;
117
118 // for interlal use
119 bool m_solveLinLim;
120 bool m_solveAngLim;
121
122 int m_flags;
123
124 btJacobianEntry m_jacLin[3];
125 btScalar m_jacLinDiagABInv[3];
126
127 btJacobianEntry m_jacAng[3];
128
129 btScalar m_timeStep;
130 btTransform m_calculatedTransformA;
131 btTransform m_calculatedTransformB;
132
133 btVector3 m_sliderAxis;
134 btVector3 m_realPivotAInW;
135 btVector3 m_realPivotBInW;
136 btVector3 m_projPivotInW;
137 btVector3 m_delta;
138 btVector3 m_depth;
139 btVector3 m_relPosA;
140 btVector3 m_relPosB;
141
142 btScalar m_linPos;
143 btScalar m_angPos;
144
145 btScalar m_angDepth;
146 btScalar m_kAngle;
147
148 bool m_poweredLinMotor;
149 btScalar m_targetLinMotorVelocity;
150 btScalar m_maxLinMotorForce;
151 btScalar m_accumulatedLinMotorImpulse;
152
153 bool m_poweredAngMotor;
154 btScalar m_targetAngMotorVelocity;
155 btScalar m_maxAngMotorForce;
156 btScalar m_accumulatedAngMotorImpulse;
157
158 //------------------------
159 void initParams();
160
161public:
162 BT_DECLARE_ALIGNED_ALLOCATOR();
163
164 // constructors
165 btSliderConstraint(btRigidBody & rbA, btRigidBody & rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA);
166 btSliderConstraint(btRigidBody & rbB, const btTransform& frameInB, bool useLinearReferenceFrameA);
167
168 // overrides
169
170 virtual void getInfo1(btConstraintInfo1 * info);
171
172 void getInfo1NonVirtual(btConstraintInfo1 * info);
173
174 virtual void getInfo2(btConstraintInfo2 * info);
175
176 void getInfo2NonVirtual(btConstraintInfo2 * info, const btTransform& transA, const btTransform& transB, const btVector3& linVelA, const btVector3& linVelB, btScalar rbAinvMass, btScalar rbBinvMass);
177
178 // access
179 const btRigidBody& getRigidBodyA() const { return m_rbA; }
180 const btRigidBody& getRigidBodyB() const { return m_rbB; }
181 const btTransform& getCalculatedTransformA() const { return m_calculatedTransformA; }
182 const btTransform& getCalculatedTransformB() const { return m_calculatedTransformB; }
183 const btTransform& getFrameOffsetA() const { return m_frameInA; }
184 const btTransform& getFrameOffsetB() const { return m_frameInB; }
185 btTransform& getFrameOffsetA() { return m_frameInA; }
186 btTransform& getFrameOffsetB() { return m_frameInB; }
187 btScalar getLowerLinLimit() { return m_lowerLinLimit; }
188 void setLowerLinLimit(btScalar lowerLimit) { m_lowerLinLimit = lowerLimit; }
189 btScalar getUpperLinLimit() { return m_upperLinLimit; }
190 void setUpperLinLimit(btScalar upperLimit) { m_upperLinLimit = upperLimit; }
191 btScalar getLowerAngLimit() { return m_lowerAngLimit; }
192 void setLowerAngLimit(btScalar lowerLimit) { m_lowerAngLimit = btNormalizeAngle(lowerLimit); }
193 btScalar getUpperAngLimit() { return m_upperAngLimit; }
194 void setUpperAngLimit(btScalar upperLimit) { m_upperAngLimit = btNormalizeAngle(upperLimit); }
195 bool getUseLinearReferenceFrameA() { return m_useLinearReferenceFrameA; }
196 btScalar getSoftnessDirLin() { return m_softnessDirLin; }
197 btScalar getRestitutionDirLin() { return m_restitutionDirLin; }
198 btScalar getDampingDirLin() { return m_dampingDirLin; }
199 btScalar getSoftnessDirAng() { return m_softnessDirAng; }
200 btScalar getRestitutionDirAng() { return m_restitutionDirAng; }
201 btScalar getDampingDirAng() { return m_dampingDirAng; }
202 btScalar getSoftnessLimLin() { return m_softnessLimLin; }
203 btScalar getRestitutionLimLin() { return m_restitutionLimLin; }
204 btScalar getDampingLimLin() { return m_dampingLimLin; }
205 btScalar getSoftnessLimAng() { return m_softnessLimAng; }
206 btScalar getRestitutionLimAng() { return m_restitutionLimAng; }
207 btScalar getDampingLimAng() { return m_dampingLimAng; }
208 btScalar getSoftnessOrthoLin() { return m_softnessOrthoLin; }
209 btScalar getRestitutionOrthoLin() { return m_restitutionOrthoLin; }
210 btScalar getDampingOrthoLin() { return m_dampingOrthoLin; }
211 btScalar getSoftnessOrthoAng() { return m_softnessOrthoAng; }
212 btScalar getRestitutionOrthoAng() { return m_restitutionOrthoAng; }
213 btScalar getDampingOrthoAng() { return m_dampingOrthoAng; }
214 void setSoftnessDirLin(btScalar softnessDirLin) { m_softnessDirLin = softnessDirLin; }
215 void setRestitutionDirLin(btScalar restitutionDirLin) { m_restitutionDirLin = restitutionDirLin; }
216 void setDampingDirLin(btScalar dampingDirLin) { m_dampingDirLin = dampingDirLin; }
217 void setSoftnessDirAng(btScalar softnessDirAng) { m_softnessDirAng = softnessDirAng; }
218 void setRestitutionDirAng(btScalar restitutionDirAng) { m_restitutionDirAng = restitutionDirAng; }
219 void setDampingDirAng(btScalar dampingDirAng) { m_dampingDirAng = dampingDirAng; }
220 void setSoftnessLimLin(btScalar softnessLimLin) { m_softnessLimLin = softnessLimLin; }
221 void setRestitutionLimLin(btScalar restitutionLimLin) { m_restitutionLimLin = restitutionLimLin; }
222 void setDampingLimLin(btScalar dampingLimLin) { m_dampingLimLin = dampingLimLin; }
223 void setSoftnessLimAng(btScalar softnessLimAng) { m_softnessLimAng = softnessLimAng; }
224 void setRestitutionLimAng(btScalar restitutionLimAng) { m_restitutionLimAng = restitutionLimAng; }
225 void setDampingLimAng(btScalar dampingLimAng) { m_dampingLimAng = dampingLimAng; }
226 void setSoftnessOrthoLin(btScalar softnessOrthoLin) { m_softnessOrthoLin = softnessOrthoLin; }
227 void setRestitutionOrthoLin(btScalar restitutionOrthoLin) { m_restitutionOrthoLin = restitutionOrthoLin; }
228 void setDampingOrthoLin(btScalar dampingOrthoLin) { m_dampingOrthoLin = dampingOrthoLin; }
229 void setSoftnessOrthoAng(btScalar softnessOrthoAng) { m_softnessOrthoAng = softnessOrthoAng; }
230 void setRestitutionOrthoAng(btScalar restitutionOrthoAng) { m_restitutionOrthoAng = restitutionOrthoAng; }
231 void setDampingOrthoAng(btScalar dampingOrthoAng) { m_dampingOrthoAng = dampingOrthoAng; }
232 void setPoweredLinMotor(bool onOff) { m_poweredLinMotor = onOff; }
233 bool getPoweredLinMotor() { return m_poweredLinMotor; }
234 void setTargetLinMotorVelocity(btScalar targetLinMotorVelocity) { m_targetLinMotorVelocity = targetLinMotorVelocity; }
235 btScalar getTargetLinMotorVelocity() { return m_targetLinMotorVelocity; }
236 void setMaxLinMotorForce(btScalar maxLinMotorForce) { m_maxLinMotorForce = maxLinMotorForce; }
237 btScalar getMaxLinMotorForce() { return m_maxLinMotorForce; }
238 void setPoweredAngMotor(bool onOff) { m_poweredAngMotor = onOff; }
239 bool getPoweredAngMotor() { return m_poweredAngMotor; }
240 void setTargetAngMotorVelocity(btScalar targetAngMotorVelocity) { m_targetAngMotorVelocity = targetAngMotorVelocity; }
241 btScalar getTargetAngMotorVelocity() { return m_targetAngMotorVelocity; }
242 void setMaxAngMotorForce(btScalar maxAngMotorForce) { m_maxAngMotorForce = maxAngMotorForce; }
243 btScalar getMaxAngMotorForce() { return m_maxAngMotorForce; }
244
245 btScalar getLinearPos() const { return m_linPos; }
246 btScalar getAngularPos() const { return m_angPos; }
247
248 // access for ODE solver
249 bool getSolveLinLimit() { return m_solveLinLim; }
250 btScalar getLinDepth() { return m_depth[0]; }
251 bool getSolveAngLimit() { return m_solveAngLim; }
252 btScalar getAngDepth() { return m_angDepth; }
253 // shared code used by ODE solver
254 void calculateTransforms(const btTransform& transA, const btTransform& transB);
255 void testLinLimits();
256 void testAngLimits();
257 // access for PE Solver
258 btVector3 getAncorInA();
259 btVector3 getAncorInB();
260 // access for UseFrameOffset
261 bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
262 void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
263
264 void setFrames(const btTransform& frameA, const btTransform& frameB)
265 {
266 m_frameInA = frameA;
267 m_frameInB = frameB;
268 calculateTransforms(m_rbA.getCenterOfMassTransform(), m_rbB.getCenterOfMassTransform());
269 buildJacobian();
270 }
271
274 virtual void setParam(int num, btScalar value, int axis = -1);
276 virtual btScalar getParam(int num, int axis = -1) const;
277
278 virtual int getFlags() const
279 {
280 return m_flags;
281 }
282
283 virtual int calculateSerializeBufferSize() const;
284
286 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
287};
288
290
291 struct btSliderConstraintData
292{
293 btTypedConstraintData m_typeConstraintData;
294 btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
295 btTransformFloatData m_rbBFrame;
296
297 float m_linearUpperLimit;
298 float m_linearLowerLimit;
299
300 float m_angularUpperLimit;
301 float m_angularLowerLimit;
302
303 int m_useLinearReferenceFrameA;
304 int m_useOffsetForConstraintFrame;
305};
306
307 struct btSliderConstraintDoubleData
308{
309 btTypedConstraintDoubleData m_typeConstraintData;
310 btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
311 btTransformDoubleData m_rbBFrame;
312
313 double m_linearUpperLimit;
314 double m_linearLowerLimit;
315
316 double m_angularUpperLimit;
317 double m_angularLowerLimit;
318
319 int m_useLinearReferenceFrameA;
320 int m_useOffsetForConstraintFrame;
321};
322
323 SIMD_FORCE_INLINE int btSliderConstraint::calculateSerializeBufferSize() const
324{
325 return sizeof(btSliderConstraintData2);
326}
327
329 SIMD_FORCE_INLINE const char* btSliderConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
330{
331 btSliderConstraintData2* sliderData = (btSliderConstraintData2*)dataBuffer;
332 btTypedConstraint::serialize(&sliderData->m_typeConstraintData, serializer);
333
334 m_frameInA.serialize(sliderData->m_rbAFrame);
335 m_frameInB.serialize(sliderData->m_rbBFrame);
336
337 sliderData->m_linearUpperLimit = m_upperLinLimit;
338 sliderData->m_linearLowerLimit = m_lowerLinLimit;
339
340 sliderData->m_angularUpperLimit = m_upperAngLimit;
341 sliderData->m_angularLowerLimit = m_lowerAngLimit;
342
343 sliderData->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA;
344 sliderData->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame;
345
346 return btSliderConstraintDataName;
347}
348
349#endif //BT_SLIDER_CONSTRAINT_H
btJacobianEntry.h
btScalar.h
btNormalizeAngle
btScalar btNormalizeAngle(btScalar angleInRadians)
Definition btScalar.h:781
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition btScalar.h:99
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition btScalar.h:98
btSliderFlags
btSliderFlags
Definition btSliderConstraint.h:50
BT_SLIDER_FLAGS_CFM_DIRANG
@ BT_SLIDER_FLAGS_CFM_DIRANG
Definition btSliderConstraint.h:53
BT_SLIDER_FLAGS_ERP_LIMLIN
@ BT_SLIDER_FLAGS_ERP_LIMLIN
Definition btSliderConstraint.h:60
BT_SLIDER_FLAGS_CFM_DIRLIN
@ BT_SLIDER_FLAGS_CFM_DIRLIN
Definition btSliderConstraint.h:51
BT_SLIDER_FLAGS_ERP_DIRANG
@ BT_SLIDER_FLAGS_ERP_DIRANG
Definition btSliderConstraint.h:54
BT_SLIDER_FLAGS_ERP_DIRLIN
@ BT_SLIDER_FLAGS_ERP_DIRLIN
Definition btSliderConstraint.h:52
BT_SLIDER_FLAGS_CFM_ORTANG
@ BT_SLIDER_FLAGS_CFM_ORTANG
Definition btSliderConstraint.h:57
BT_SLIDER_FLAGS_CFM_ORTLIN
@ BT_SLIDER_FLAGS_CFM_ORTLIN
Definition btSliderConstraint.h:55
BT_SLIDER_FLAGS_ERP_ORTANG
@ BT_SLIDER_FLAGS_ERP_ORTANG
Definition btSliderConstraint.h:58
BT_SLIDER_FLAGS_CFM_LIMANG
@ BT_SLIDER_FLAGS_CFM_LIMANG
Definition btSliderConstraint.h:61
BT_SLIDER_FLAGS_ERP_ORTLIN
@ BT_SLIDER_FLAGS_ERP_ORTLIN
Definition btSliderConstraint.h:56
BT_SLIDER_FLAGS_CFM_LIMLIN
@ BT_SLIDER_FLAGS_CFM_LIMLIN
Definition btSliderConstraint.h:59
BT_SLIDER_FLAGS_ERP_LIMANG
@ BT_SLIDER_FLAGS_ERP_LIMANG
Definition btSliderConstraint.h:62
btSliderConstraintDataName
#define btSliderConstraintDataName
Definition btSliderConstraint.h:35
btSliderConstraintData2
#define btSliderConstraintData2
Definition btSliderConstraint.h:34
btTypedConstraint.h
btVector3.h
btJacobianEntry
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
Definition btJacobianEntry.h:31
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition btRigidBody.h:60
btRigidBody::serialize
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition btRigidBody.cpp:465
btRigidBody::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition btRigidBody.cpp:458
btSerializer
Definition btSerializer.h:66
btSliderConstraint::m_useLinearReferenceFrameA
bool m_useLinearReferenceFrameA
Definition btSliderConstraint.h:75
btSliderConstraint::setSoftnessOrthoAng
void setSoftnessOrthoAng(btScalar softnessOrthoAng)
Definition btSliderConstraint.h:229
btSliderConstraint::setPoweredLinMotor
void setPoweredLinMotor(bool onOff)
Definition btSliderConstraint.h:232
btSliderConstraint::getUseLinearReferenceFrameA
bool getUseLinearReferenceFrameA()
Definition btSliderConstraint.h:195
btSliderConstraint::getUpperLinLimit
btScalar getUpperLinLimit()
Definition btSliderConstraint.h:189
btSliderConstraint::getTargetLinMotorVelocity
btScalar getTargetLinMotorVelocity()
Definition btSliderConstraint.h:235
btSliderConstraint::m_cfmOrthoAng
btScalar m_cfmOrthoAng
Definition btSliderConstraint.h:116
btSliderConstraint::m_depth
btVector3 m_depth
Definition btSliderConstraint.h:138
btSliderConstraint::setRestitutionDirAng
void setRestitutionDirAng(btScalar restitutionDirAng)
Definition btSliderConstraint.h:218
btSliderConstraint::m_delta
btVector3 m_delta
Definition btSliderConstraint.h:137
btSliderConstraint::getPoweredLinMotor
bool getPoweredLinMotor()
Definition btSliderConstraint.h:233
btSliderConstraint::getFrameOffsetB
const btTransform & getFrameOffsetB() const
Definition btSliderConstraint.h:184
btSliderConstraint::setRestitutionOrthoLin
void setRestitutionOrthoLin(btScalar restitutionOrthoLin)
Definition btSliderConstraint.h:227
btSliderConstraint::setUseFrameOffset
void setUseFrameOffset(bool frameOffsetOnOff)
Definition btSliderConstraint.h:262
btSliderConstraint::getRestitutionDirAng
btScalar getRestitutionDirAng()
Definition btSliderConstraint.h:200
btSliderConstraint::setSoftnessLimLin
void setSoftnessLimLin(btScalar softnessLimLin)
Definition btSliderConstraint.h:220
btSliderConstraint::getRigidBodyB
const btRigidBody & getRigidBodyB() const
Definition btSliderConstraint.h:180
btSliderConstraint::m_cfmOrthoLin
btScalar m_cfmOrthoLin
Definition btSliderConstraint.h:111
btSliderConstraint::serialize
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition btSliderConstraint.h:329
btSliderConstraint::m_kAngle
btScalar m_kAngle
Definition btSliderConstraint.h:146
btSliderConstraint::m_dampingDirAng
btScalar m_dampingDirAng
Definition btSliderConstraint.h:95
btSliderConstraint::m_jacLin
btJacobianEntry m_jacLin[3]
Definition btSliderConstraint.h:124
btSliderConstraint::m_angPos
btScalar m_angPos
Definition btSliderConstraint.h:143
btSliderConstraint::setMaxAngMotorForce
void setMaxAngMotorForce(btScalar maxAngMotorForce)
Definition btSliderConstraint.h:242
btSliderConstraint::m_dampingDirLin
btScalar m_dampingDirLin
Definition btSliderConstraint.h:90
btSliderConstraint::setTargetLinMotorVelocity
void setTargetLinMotorVelocity(btScalar targetLinMotorVelocity)
Definition btSliderConstraint.h:234
btSliderConstraint::m_upperLinLimit
btScalar m_upperLinLimit
Definition btSliderConstraint.h:78
btSliderConstraint::getRestitutionLimAng
btScalar getRestitutionLimAng()
Definition btSliderConstraint.h:206
btSliderConstraint::setLowerLinLimit
void setLowerLinLimit(btScalar lowerLimit)
Definition btSliderConstraint.h:188
btSliderConstraint::getDampingOrthoAng
btScalar getDampingOrthoAng()
Definition btSliderConstraint.h:213
btSliderConstraint::m_softnessDirAng
btScalar m_softnessDirAng
Definition btSliderConstraint.h:93
btSliderConstraint::setSoftnessOrthoLin
void setSoftnessOrthoLin(btScalar softnessOrthoLin)
Definition btSliderConstraint.h:226
btSliderConstraint::m_angDepth
btScalar m_angDepth
Definition btSliderConstraint.h:145
btSliderConstraint::m_jacAng
btJacobianEntry m_jacAng[3]
Definition btSliderConstraint.h:127
btSliderConstraint::m_dampingLimAng
btScalar m_dampingLimAng
Definition btSliderConstraint.h:105
btSliderConstraint::getFlags
virtual int getFlags() const
Definition btSliderConstraint.h:278
btSliderConstraint::m_dampingOrthoAng
btScalar m_dampingOrthoAng
Definition btSliderConstraint.h:115
btSliderConstraint::m_softnessLimLin
btScalar m_softnessLimLin
Definition btSliderConstraint.h:98
btSliderConstraint::btSliderConstraint
btSliderConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
Definition btSliderConstraint.cpp:77
btSliderConstraint::m_softnessDirLin
btScalar m_softnessDirLin
Definition btSliderConstraint.h:88
btSliderConstraint::m_calculatedTransformB
btTransform m_calculatedTransformB
Definition btSliderConstraint.h:131
btSliderConstraint::m_useOffsetForConstraintFrame
bool m_useOffsetForConstraintFrame
Definition btSliderConstraint.h:71
btSliderConstraint::m_cfmDirAng
btScalar m_cfmDirAng
Definition btSliderConstraint.h:96
btSliderConstraint::getCalculatedTransformB
const btTransform & getCalculatedTransformB() const
Definition btSliderConstraint.h:182
btSliderConstraint::m_softnessLimAng
btScalar m_softnessLimAng
Definition btSliderConstraint.h:103
btSliderConstraint::m_calculatedTransformA
btTransform m_calculatedTransformA
Definition btSliderConstraint.h:130
btSliderConstraint::setDampingOrthoAng
void setDampingOrthoAng(btScalar dampingOrthoAng)
Definition btSliderConstraint.h:231
btSliderConstraint::getSoftnessOrthoAng
btScalar getSoftnessOrthoAng()
Definition btSliderConstraint.h:211
btSliderConstraint::getLinDepth
btScalar getLinDepth()
Definition btSliderConstraint.h:250
btSliderConstraint::m_realPivotBInW
btVector3 m_realPivotBInW
Definition btSliderConstraint.h:135
btSliderConstraint::m_cfmLimAng
btScalar m_cfmLimAng
Definition btSliderConstraint.h:106
btSliderConstraint::setUpperLinLimit
void setUpperLinLimit(btScalar upperLimit)
Definition btSliderConstraint.h:190
btSliderConstraint::m_restitutionDirLin
btScalar m_restitutionDirLin
Definition btSliderConstraint.h:89
btSliderConstraint::getAngDepth
btScalar getAngDepth()
Definition btSliderConstraint.h:252
btSliderConstraint::setRestitutionLimLin
void setRestitutionLimLin(btScalar restitutionLimLin)
Definition btSliderConstraint.h:221
btSliderConstraint::setPoweredAngMotor
void setPoweredAngMotor(bool onOff)
Definition btSliderConstraint.h:238
btSliderConstraint::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition btSliderConstraint.h:323
btSliderConstraint::getRigidBodyA
const btRigidBody & getRigidBodyA() const
Definition btSliderConstraint.h:179
btSliderConstraint::m_targetLinMotorVelocity
btScalar m_targetLinMotorVelocity
Definition btSliderConstraint.h:149
btSliderConstraint::m_targetAngMotorVelocity
btScalar m_targetAngMotorVelocity
Definition btSliderConstraint.h:154
btSliderConstraint::m_maxAngMotorForce
btScalar m_maxAngMotorForce
Definition btSliderConstraint.h:155
btSliderConstraint::getSoftnessDirAng
btScalar getSoftnessDirAng()
Definition btSliderConstraint.h:199
btSliderConstraint::getLinearPos
btScalar getLinearPos() const
Definition btSliderConstraint.h:245
btSliderConstraint::setDampingLimAng
void setDampingLimAng(btScalar dampingLimAng)
Definition btSliderConstraint.h:225
btSliderConstraint::m_jacLinDiagABInv
btScalar m_jacLinDiagABInv[3]
Definition btSliderConstraint.h:125
btSliderConstraint::getDampingDirLin
btScalar getDampingDirLin()
Definition btSliderConstraint.h:198
btSliderConstraint::m_restitutionLimAng
btScalar m_restitutionLimAng
Definition btSliderConstraint.h:104
btSliderConstraint::getSoftnessDirLin
btScalar getSoftnessDirLin()
Definition btSliderConstraint.h:196
btSliderConstraint::setTargetAngMotorVelocity
void setTargetAngMotorVelocity(btScalar targetAngMotorVelocity)
Definition btSliderConstraint.h:240
btSliderConstraint::m_relPosB
btVector3 m_relPosB
Definition btSliderConstraint.h:140
btSliderConstraint::m_upperAngLimit
btScalar m_upperAngLimit
Definition btSliderConstraint.h:81
btSliderConstraint::setDampingDirAng
void setDampingDirAng(btScalar dampingDirAng)
Definition btSliderConstraint.h:219
btSliderConstraint::setSoftnessDirAng
void setSoftnessDirAng(btScalar softnessDirAng)
Definition btSliderConstraint.h:217
btSliderConstraint::getFrameOffsetA
btTransform & getFrameOffsetA()
Definition btSliderConstraint.h:185
btSliderConstraint::m_frameInB
btTransform m_frameInB
Definition btSliderConstraint.h:73
btSliderConstraint::getRestitutionOrthoLin
btScalar getRestitutionOrthoLin()
Definition btSliderConstraint.h:209
btSliderConstraint::initParams
void initParams()
Definition btSliderConstraint.cpp:28
btSliderConstraint::m_solveAngLim
bool m_solveAngLim
Definition btSliderConstraint.h:120
btSliderConstraint::getLowerLinLimit
btScalar getLowerLinLimit()
Definition btSliderConstraint.h:187
btSliderConstraint::getCalculatedTransformA
const btTransform & getCalculatedTransformA() const
Definition btSliderConstraint.h:181
btSliderConstraint::m_lowerLinLimit
btScalar m_lowerLinLimit
Definition btSliderConstraint.h:77
btSliderConstraint::getDampingLimLin
btScalar getDampingLimLin()
Definition btSliderConstraint.h:204
btSliderConstraint::m_softnessOrthoAng
btScalar m_softnessOrthoAng
Definition btSliderConstraint.h:113
btSliderConstraint::m_cfmDirLin
btScalar m_cfmDirLin
Definition btSliderConstraint.h:91
btSliderConstraint::getRestitutionLimLin
btScalar getRestitutionLimLin()
Definition btSliderConstraint.h:203
btSliderConstraint::getDampingOrthoLin
btScalar getDampingOrthoLin()
Definition btSliderConstraint.h:210
btSliderConstraint::setSoftnessLimAng
void setSoftnessLimAng(btScalar softnessLimAng)
Definition btSliderConstraint.h:223
btSliderConstraint::m_projPivotInW
btVector3 m_projPivotInW
Definition btSliderConstraint.h:136
btSliderConstraint::getDampingLimAng
btScalar getDampingLimAng()
Definition btSliderConstraint.h:207
btSliderConstraint::getLowerAngLimit
btScalar getLowerAngLimit()
Definition btSliderConstraint.h:191
btSliderConstraint::setSoftnessDirLin
void setSoftnessDirLin(btScalar softnessDirLin)
Definition btSliderConstraint.h:214
btSliderConstraint::m_poweredAngMotor
bool m_poweredAngMotor
Definition btSliderConstraint.h:153
btSliderConstraint::getFrameOffsetA
const btTransform & getFrameOffsetA() const
Definition btSliderConstraint.h:183
btSliderConstraint::m_restitutionOrthoLin
btScalar m_restitutionOrthoLin
Definition btSliderConstraint.h:109
btSliderConstraint::getRestitutionOrthoAng
btScalar getRestitutionOrthoAng()
Definition btSliderConstraint.h:212
btSliderConstraint::getInfo2
virtual void getInfo2(btConstraintInfo2 *info)
internal method used by the constraint solver, don't use them directly
Definition btSliderConstraint.cpp:134
btSliderConstraint::setFrames
void setFrames(const btTransform &frameA, const btTransform &frameB)
Definition btSliderConstraint.h:264
btSliderConstraint::getSoftnessLimAng
btScalar getSoftnessLimAng()
Definition btSliderConstraint.h:205
btSliderConstraint::setRestitutionDirLin
void setRestitutionDirLin(btScalar restitutionDirLin)
Definition btSliderConstraint.h:215
btSliderConstraint::m_accumulatedLinMotorImpulse
btScalar m_accumulatedLinMotorImpulse
Definition btSliderConstraint.h:151
btSliderConstraint::getAngularPos
btScalar getAngularPos() const
Definition btSliderConstraint.h:246
btSliderConstraint::getTargetAngMotorVelocity
btScalar getTargetAngMotorVelocity()
Definition btSliderConstraint.h:241
btSliderConstraint::m_dampingLimLin
btScalar m_dampingLimLin
Definition btSliderConstraint.h:100
btSliderConstraint::getSolveLinLimit
bool getSolveLinLimit()
Definition btSliderConstraint.h:249
btSliderConstraint::calculateTransforms
void calculateTransforms(const btTransform &transA, const btTransform &transB)
Definition btSliderConstraint.cpp:139
btSliderConstraint::m_timeStep
btScalar m_timeStep
Definition btSliderConstraint.h:129
btSliderConstraint::m_accumulatedAngMotorImpulse
btScalar m_accumulatedAngMotorImpulse
Definition btSliderConstraint.h:156
btSliderConstraint::m_softnessOrthoLin
btScalar m_softnessOrthoLin
Definition btSliderConstraint.h:108
btSliderConstraint::m_dampingOrthoLin
btScalar m_dampingOrthoLin
Definition btSliderConstraint.h:110
btSliderConstraint::getInfo1
virtual void getInfo1(btConstraintInfo1 *info)
internal method used by the constraint solver, don't use them directly
Definition btSliderConstraint.cpp:100
btSliderConstraint::setDampingDirLin
void setDampingDirLin(btScalar dampingDirLin)
Definition btSliderConstraint.h:216
btSliderConstraint::m_frameInA
btTransform m_frameInA
Definition btSliderConstraint.h:72
btSliderConstraint::m_flags
int m_flags
Definition btSliderConstraint.h:122
btSliderConstraint::getMaxAngMotorForce
btScalar getMaxAngMotorForce()
Definition btSliderConstraint.h:243
btSliderConstraint::BT_DECLARE_ALIGNED_ALLOCATOR
BT_DECLARE_ALIGNED_ALLOCATOR()
btSliderConstraint::getRestitutionDirLin
btScalar getRestitutionDirLin()
Definition btSliderConstraint.h:197
btSliderConstraint::setRestitutionOrthoAng
void setRestitutionOrthoAng(btScalar restitutionOrthoAng)
Definition btSliderConstraint.h:230
btSliderConstraint::getFrameOffsetB
btTransform & getFrameOffsetB()
Definition btSliderConstraint.h:186
btSliderConstraint::setMaxLinMotorForce
void setMaxLinMotorForce(btScalar maxLinMotorForce)
Definition btSliderConstraint.h:236
btSliderConstraint::m_realPivotAInW
btVector3 m_realPivotAInW
Definition btSliderConstraint.h:134
btSliderConstraint::getUseFrameOffset
bool getUseFrameOffset()
Definition btSliderConstraint.h:261
btSliderConstraint::getSoftnessLimLin
btScalar getSoftnessLimLin()
Definition btSliderConstraint.h:202
btSliderConstraint::setUpperAngLimit
void setUpperAngLimit(btScalar upperLimit)
Definition btSliderConstraint.h:194
btSliderConstraint::getSoftnessOrthoLin
btScalar getSoftnessOrthoLin()
Definition btSliderConstraint.h:208
btSliderConstraint::m_sliderAxis
btVector3 m_sliderAxis
Definition btSliderConstraint.h:133
btSliderConstraint::setRestitutionLimAng
void setRestitutionLimAng(btScalar restitutionLimAng)
Definition btSliderConstraint.h:224
btSliderConstraint::m_maxLinMotorForce
btScalar m_maxLinMotorForce
Definition btSliderConstraint.h:150
btSliderConstraint::m_poweredLinMotor
bool m_poweredLinMotor
Definition btSliderConstraint.h:148
btSliderConstraint::m_relPosA
btVector3 m_relPosA
Definition btSliderConstraint.h:139
btSliderConstraint::getMaxLinMotorForce
btScalar getMaxLinMotorForce()
Definition btSliderConstraint.h:237
btSliderConstraint::setLowerAngLimit
void setLowerAngLimit(btScalar lowerLimit)
Definition btSliderConstraint.h:192
btSliderConstraint::m_cfmLimLin
btScalar m_cfmLimLin
Definition btSliderConstraint.h:101
btSliderConstraint::getInfo2NonVirtual
void getInfo2NonVirtual(btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, btScalar rbAinvMass, btScalar rbBinvMass)
Definition btSliderConstraint.cpp:241
btSliderConstraint::m_solveLinLim
bool m_solveLinLim
Definition btSliderConstraint.h:119
btSliderConstraint::getSolveAngLimit
bool getSolveAngLimit()
Definition btSliderConstraint.h:251
btSliderConstraint::setDampingLimLin
void setDampingLimLin(btScalar dampingLimLin)
Definition btSliderConstraint.h:222
btSliderConstraint::m_restitutionOrthoAng
btScalar m_restitutionOrthoAng
Definition btSliderConstraint.h:114
btSliderConstraint::m_restitutionDirAng
btScalar m_restitutionDirAng
Definition btSliderConstraint.h:94
btSliderConstraint::setDampingOrthoLin
void setDampingOrthoLin(btScalar dampingOrthoLin)
Definition btSliderConstraint.h:228
btSliderConstraint::m_useSolveConstraintObsolete
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to 'getInfo/getInfo2'
Definition btSliderConstraint.h:70
btSliderConstraint::getDampingDirAng
btScalar getDampingDirAng()
Definition btSliderConstraint.h:201
btSliderConstraint::getUpperAngLimit
btScalar getUpperAngLimit()
Definition btSliderConstraint.h:193
btSliderConstraint::m_lowerAngLimit
btScalar m_lowerAngLimit
Definition btSliderConstraint.h:80
btSliderConstraint::m_linPos
btScalar m_linPos
Definition btSliderConstraint.h:142
btSliderConstraint::m_restitutionLimLin
btScalar m_restitutionLimLin
Definition btSliderConstraint.h:99
btSliderConstraint::getPoweredAngMotor
bool getPoweredAngMotor()
Definition btSliderConstraint.h:239
btSliderConstraint::getInfo1NonVirtual
void getInfo1NonVirtual(btConstraintInfo1 *info)
Definition btSliderConstraint.cpp:128
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition btTransform.h:30
btTypedConstraint::serialize
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition btTypedConstraint.cpp:104
btTypedConstraint::buildJacobian
virtual void buildJacobian()
internal method used by the constraint solver, don't use them directly
Definition btTypedConstraint.h:163
btTypedConstraint::btTypedConstraint
btTypedConstraint(btTypedConstraintType type, btRigidBody &rbA)
Definition btTypedConstraint.cpp:22
btTypedConstraint::m_rbA
btRigidBody & m_rbA
Definition btTypedConstraint.h:97
btTypedConstraint::m_rbB
btRigidBody & m_rbB
Definition btTypedConstraint.h:98
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition btVector3.h:82
btSliderConstraintData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition btSliderConstraint.h:292
btSliderConstraintData::m_angularUpperLimit
float m_angularUpperLimit
Definition btSliderConstraint.h:300
btSliderConstraintData::m_linearLowerLimit
float m_linearLowerLimit
Definition btSliderConstraint.h:298
btSliderConstraintData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition btSliderConstraint.h:303
btSliderConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition btSliderConstraint.h:295
btSliderConstraintData::m_typeConstraintData
btTypedConstraintData m_typeConstraintData
Definition btSliderConstraint.h:293
btSliderConstraintData::m_angularLowerLimit
float m_angularLowerLimit
Definition btSliderConstraint.h:301
btSliderConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition btSliderConstraint.h:294
btSliderConstraintData::m_linearUpperLimit
float m_linearUpperLimit
Definition btSliderConstraint.h:297
btSliderConstraintData::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition btSliderConstraint.h:304
btSliderConstraintDoubleData
Definition btSliderConstraint.h:308
btSliderConstraintDoubleData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition btSliderConstraint.h:319
btSliderConstraintDoubleData::m_linearUpperLimit
double m_linearUpperLimit
Definition btSliderConstraint.h:313
btSliderConstraintDoubleData::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition btSliderConstraint.h:310
btSliderConstraintDoubleData::m_typeConstraintData
btTypedConstraintDoubleData m_typeConstraintData
Definition btSliderConstraint.h:309
btSliderConstraintDoubleData::m_angularUpperLimit
double m_angularUpperLimit
Definition btSliderConstraint.h:316
btSliderConstraintDoubleData::m_linearLowerLimit
double m_linearLowerLimit
Definition btSliderConstraint.h:314
btSliderConstraintDoubleData::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition btSliderConstraint.h:311
btSliderConstraintDoubleData::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition btSliderConstraint.h:320
btSliderConstraintDoubleData::m_angularLowerLimit
double m_angularLowerLimit
Definition btSliderConstraint.h:317
btTransformDoubleData
Definition btTransform.h:252
btTransformFloatData
for serialization
Definition btTransform.h:246
btTypedConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition btTypedConstraint.h:388
btTypedConstraintDoubleData
Definition btTypedConstraint.h:411
btTypedConstraint::btConstraintInfo1
Definition btTypedConstraint.h:114
btTypedConstraint::btConstraintInfo2
Definition btTypedConstraint.h:121