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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btTypedConstraint.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2010 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_TYPED_CONSTRAINT_H
17 #define BT_TYPED_CONSTRAINT_H
18
19
20 #include "LinearMath/btScalar.h"
21 #include "btSolverConstraint.h"
22 #include "BulletDynamics/Dynamics/btRigidBody.h"
23
24 #ifdef BT_USE_DOUBLE_PRECISION
25 #define btTypedConstraintData2 btTypedConstraintDoubleData
26 #define btTypedConstraintDataName "btTypedConstraintDoubleData"
27 #else
28 #define btTypedConstraintData2 btTypedConstraintFloatData
29 #define btTypedConstraintDataName "btTypedConstraintFloatData"
30 #endif //BT_USE_DOUBLE_PRECISION
31
32
33 class btSerializer;
34
35 //Don't change any of the existing enum values, so add enum types at the end for serialization compatibility
36 enum btTypedConstraintType
37 {
38 POINT2POINT_CONSTRAINT_TYPE=3,
39 HINGE_CONSTRAINT_TYPE,
40 CONETWIST_CONSTRAINT_TYPE,
41 D6_CONSTRAINT_TYPE,
42 SLIDER_CONSTRAINT_TYPE,
43 CONTACT_CONSTRAINT_TYPE,
44 D6_SPRING_CONSTRAINT_TYPE,
45 GEAR_CONSTRAINT_TYPE,
46 FIXED_CONSTRAINT_TYPE,
47 D6_SPRING_2_CONSTRAINT_TYPE,
48 MAX_CONSTRAINT_TYPE
49 };
50
51
52 enum btConstraintParams
53 {
54 BT_CONSTRAINT_ERP=1,
55 BT_CONSTRAINT_STOP_ERP,
56 BT_CONSTRAINT_CFM,
57 BT_CONSTRAINT_STOP_CFM
58 };
59
60 #if 1
61 #define btAssertConstrParams(_par) btAssert(_par)
62 #else
63 #define btAssertConstrParams(_par)
64 #endif
65
66
67 ATTRIBUTE_ALIGNED16(struct) btJointFeedback
68 {
69 btVector3 m_appliedForceBodyA;
70 btVector3 m_appliedTorqueBodyA;
71 btVector3 m_appliedForceBodyB;
72 btVector3 m_appliedTorqueBodyB;
73 };
74
75
77 ATTRIBUTE_ALIGNED16(class) btTypedConstraint : public btTypedObject
78 {
79 int m_userConstraintType;
80
81 union
82 {
83 int m_userConstraintId;
84 void* m_userConstraintPtr;
85 };
86
87 btScalar m_breakingImpulseThreshold;
88 bool m_isEnabled;
89 bool m_needsFeedback;
90 int m_overrideNumSolverIterations;
91
92
93 btTypedConstraint& operator=(btTypedConstraint& other)
94 {
95 btAssert(0);
96 (void) other;
97 return *this;
98 }
99
100 protected:
101 btRigidBody& m_rbA;
102 btRigidBody& m_rbB;
103 btScalar m_appliedImpulse;
104 btScalar m_dbgDrawSize;
105 btJointFeedback* m_jointFeedback;
106
108 btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact);
109
110
111 public:
112
113 BT_DECLARE_ALIGNED_ALLOCATOR();
114
115 virtual ~btTypedConstraint() {};
116 btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA);
117 btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB);
118
119 struct btConstraintInfo1 {
120 int m_numConstraintRows,nub;
121 };
122
123 static btRigidBody& getFixedBody();
124
125 struct btConstraintInfo2 {
126 // integrator parameters: frames per second (1/stepsize), default error
127 // reduction parameter (0..1).
128 btScalar fps,erp;
129
130 // for the first and second body, pointers to two (linear and angular)
131 // n*3 jacobian sub matrices, stored by rows. these matrices will have
132 // been initialized to 0 on entry. if the second body is zero then the
133 // J2xx pointers may be 0.
134 btScalar *m_J1linearAxis,*m_J1angularAxis,*m_J2linearAxis,*m_J2angularAxis;
135
136 // elements to jump from one row to the next in J's
137 int rowskip;
138
139 // right hand sides of the equation J*v = c + cfm * lambda. cfm is the
140 // "constraint force mixing" vector. c is set to zero on entry, cfm is
141 // set to a constant value (typically very small or zero) value on entry.
142 btScalar *m_constraintError,*cfm;
143
144 // lo and hi limits for variables (set to -/+ infinity on entry).
145 btScalar *m_lowerLimit,*m_upperLimit;
146
147 // findex vector for variables. see the LCP solver interface for a
148 // description of what this does. this is set to -1 on entry.
149 // note that the returned indexes are relative to the first index of
150 // the constraint.
151 int *findex;
152 // number of solver iterations
153 int m_numIterations;
154
155 //damping of the velocity
156 btScalar m_damping;
157 };
158
159 int getOverrideNumSolverIterations() const
160 {
161 return m_overrideNumSolverIterations;
162 }
163
166 void setOverrideNumSolverIterations(int overideNumIterations)
167 {
168 m_overrideNumSolverIterations = overideNumIterations;
169 }
170
172 virtual void buildJacobian() {};
173
175 virtual void setupSolverConstraint(btConstraintArray& ca, int solverBodyA,int solverBodyB, btScalar timeStep)
176 {
177 (void)ca;
178 (void)solverBodyA;
179 (void)solverBodyB;
180 (void)timeStep;
181 }
182
184 virtual void getInfo1 (btConstraintInfo1* info)=0;
185
187 virtual void getInfo2 (btConstraintInfo2* info)=0;
188
190 void internalSetAppliedImpulse(btScalar appliedImpulse)
191 {
192 m_appliedImpulse = appliedImpulse;
193 }
195 btScalar internalGetAppliedImpulse()
196 {
197 return m_appliedImpulse;
198 }
199
200
201 btScalar getBreakingImpulseThreshold() const
202 {
203 return m_breakingImpulseThreshold;
204 }
205
206 void setBreakingImpulseThreshold(btScalar threshold)
207 {
208 m_breakingImpulseThreshold = threshold;
209 }
210
211 bool isEnabled() const
212 {
213 return m_isEnabled;
214 }
215
216 void setEnabled(bool enabled)
217 {
218 m_isEnabled=enabled;
219 }
220
221
223 virtual void solveConstraintObsolete(btSolverBody& /*bodyA*/,btSolverBody& /*bodyB*/,btScalar /*timeStep*/) {};
224
225
226 const btRigidBody& getRigidBodyA() const
227 {
228 return m_rbA;
229 }
230 const btRigidBody& getRigidBodyB() const
231 {
232 return m_rbB;
233 }
234
235 btRigidBody& getRigidBodyA()
236 {
237 return m_rbA;
238 }
239 btRigidBody& getRigidBodyB()
240 {
241 return m_rbB;
242 }
243
244 int getUserConstraintType() const
245 {
246 return m_userConstraintType ;
247 }
248
249 void setUserConstraintType(int userConstraintType)
250 {
251 m_userConstraintType = userConstraintType;
252 };
253
254 void setUserConstraintId(int uid)
255 {
256 m_userConstraintId = uid;
257 }
258
259 int getUserConstraintId() const
260 {
261 return m_userConstraintId;
262 }
263
264 void setUserConstraintPtr(void* ptr)
265 {
266 m_userConstraintPtr = ptr;
267 }
268
269 void* getUserConstraintPtr()
270 {
271 return m_userConstraintPtr;
272 }
273
274 void setJointFeedback(btJointFeedback* jointFeedback)
275 {
276 m_jointFeedback = jointFeedback;
277 }
278
279 const btJointFeedback* getJointFeedback() const
280 {
281 return m_jointFeedback;
282 }
283
284 btJointFeedback* getJointFeedback()
285 {
286 return m_jointFeedback;
287 }
288
289
290 int getUid() const
291 {
292 return m_userConstraintId;
293 }
294
295 bool needsFeedback() const
296 {
297 return m_needsFeedback;
298 }
299
302 void enableFeedback(bool needsFeedback)
303 {
304 m_needsFeedback = needsFeedback;
305 }
306
309 btScalar getAppliedImpulse() const
310 {
311 btAssert(m_needsFeedback);
312 return m_appliedImpulse;
313 }
314
315 btTypedConstraintType getConstraintType () const
316 {
317 return btTypedConstraintType(m_objectType);
318 }
319
320 void setDbgDrawSize(btScalar dbgDrawSize)
321 {
322 m_dbgDrawSize = dbgDrawSize;
323 }
324 btScalar getDbgDrawSize()
325 {
326 return m_dbgDrawSize;
327 }
328
331 virtual void setParam(int num, btScalar value, int axis = -1) = 0;
332
334 virtual btScalar getParam(int num, int axis = -1) const = 0;
335
336 virtual int calculateSerializeBufferSize() const;
337
339 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
340
341 };
342
343 // returns angle in range [-SIMD_2_PI, SIMD_2_PI], closest to one of the limits
344 // all arguments should be normalized angles (i.e. in range [-SIMD_PI, SIMD_PI])
345 SIMD_FORCE_INLINE btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
346 {
347 if(angleLowerLimitInRadians >= angleUpperLimitInRadians)
348 {
349 return angleInRadians;
350 }
351 else if(angleInRadians < angleLowerLimitInRadians)
352 {
353 btScalar diffLo = btFabs(btNormalizeAngle(angleLowerLimitInRadians - angleInRadians));
354 btScalar diffHi = btFabs(btNormalizeAngle(angleUpperLimitInRadians - angleInRadians));
355 return (diffLo < diffHi) ? angleInRadians : (angleInRadians + SIMD_2_PI);
356 }
357 else if(angleInRadians > angleUpperLimitInRadians)
358 {
359 btScalar diffHi = btFabs(btNormalizeAngle(angleInRadians - angleUpperLimitInRadians));
360 btScalar diffLo = btFabs(btNormalizeAngle(angleInRadians - angleLowerLimitInRadians));
361 return (diffLo < diffHi) ? (angleInRadians - SIMD_2_PI) : angleInRadians;
362 }
363 else
364 {
365 return angleInRadians;
366 }
367 }
368
370 struct btTypedConstraintFloatData
371 {
372 btRigidBodyFloatData *m_rbA;
373 btRigidBodyFloatData *m_rbB;
374 char *m_name;
375
376 int m_objectType;
377 int m_userConstraintType;
378 int m_userConstraintId;
379 int m_needsFeedback;
380
381 float m_appliedImpulse;
382 float m_dbgDrawSize;
383
384 int m_disableCollisionsBetweenLinkedBodies;
385 int m_overrideNumSolverIterations;
386
387 float m_breakingImpulseThreshold;
388 int m_isEnabled;
389
390 };
391
393
394 #define BT_BACKWARDS_COMPATIBLE_SERIALIZATION
395 #ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION
396 struct btTypedConstraintData
398 {
399 btRigidBodyData *m_rbA;
400 btRigidBodyData *m_rbB;
401 char *m_name;
402
403 int m_objectType;
404 int m_userConstraintType;
405 int m_userConstraintId;
406 int m_needsFeedback;
407
408 float m_appliedImpulse;
409 float m_dbgDrawSize;
410
411 int m_disableCollisionsBetweenLinkedBodies;
412 int m_overrideNumSolverIterations;
413
414 float m_breakingImpulseThreshold;
415 int m_isEnabled;
416
417 };
418 #endif //BACKWARDS_COMPATIBLE
419
420 struct btTypedConstraintDoubleData
421 {
422 btRigidBodyDoubleData *m_rbA;
423 btRigidBodyDoubleData *m_rbB;
424 char *m_name;
425
426 int m_objectType;
427 int m_userConstraintType;
428 int m_userConstraintId;
429 int m_needsFeedback;
430
431 double m_appliedImpulse;
432 double m_dbgDrawSize;
433
434 int m_disableCollisionsBetweenLinkedBodies;
435 int m_overrideNumSolverIterations;
436
437 double m_breakingImpulseThreshold;
438 int m_isEnabled;
439 char padding[4];
440
441 };
442
443
444 SIMD_FORCE_INLINE int btTypedConstraint::calculateSerializeBufferSize() const
445 {
446 return sizeof(btTypedConstraintData2);
447 }
448
449
450
451 class btAngularLimit
452 {
453 private:
454 btScalar
455 m_center,
456 m_halfRange,
457 m_softness,
458 m_biasFactor,
459 m_relaxationFactor,
460 m_correction,
461 m_sign;
462
463 bool
464 m_solveLimit;
465
466 public:
468 btAngularLimit()
469 :m_center(0.0f),
470 m_halfRange(-1.0f),
471 m_softness(0.9f),
472 m_biasFactor(0.3f),
473 m_relaxationFactor(1.0f),
474 m_correction(0.0f),
475 m_sign(0.0f),
476 m_solveLimit(false)
477 {}
478
482 void set(btScalar low, btScalar high, btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f);
483
486 void test(const btScalar angle);
487
489 inline btScalar getSoftness() const
490 {
491 return m_softness;
492 }
493
495 inline btScalar getBiasFactor() const
496 {
497 return m_biasFactor;
498 }
499
501 inline btScalar getRelaxationFactor() const
502 {
503 return m_relaxationFactor;
504 }
505
507 inline btScalar getCorrection() const
508 {
509 return m_correction;
510 }
511
513 inline btScalar getSign() const
514 {
515 return m_sign;
516 }
517
519 inline btScalar getHalfRange() const
520 {
521 return m_halfRange;
522 }
523
525 inline bool isLimit() const
526 {
527 return m_solveLimit;
528 }
529
532 void fit(btScalar& angle) const;
533
535 btScalar getError() const;
536
537 btScalar getLow() const;
538
539 btScalar getHigh() const;
540
541 };
542
543
544
545 #endif //BT_TYPED_CONSTRAINT_H
btTypedConstraint::btConstraintInfo2::m_constraintError
btScalar * m_constraintError
Definition: btTypedConstraint.h:142
btTypedConstraintDoubleData::m_isEnabled
int m_isEnabled
Definition: btTypedConstraint.h:438
btTypedConstraint::btConstraintInfo2::m_damping
btScalar m_damping
Definition: btTypedConstraint.h:156
btTypedConstraint::enableFeedback
void enableFeedback(bool needsFeedback)
enableFeedback will allow to read the applied linear and angular impulse use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information
Definition: btTypedConstraint.h:302
btTypedConstraintFloatData::m_rbB
btRigidBodyFloatData * m_rbB
Definition: btTypedConstraint.h:373
btTypedConstraintData::m_rbB
btRigidBodyData * m_rbB
Definition: btTypedConstraint.h:400
btAngularLimit
Definition: btTypedConstraint.h:451
btTypedConstraint::getUserConstraintType
int getUserConstraintType() const
Definition: btTypedConstraint.h:244
btTypedConstraintDoubleData::m_breakingImpulseThreshold
double m_breakingImpulseThreshold
Definition: btTypedConstraint.h:437
btTypedConstraint::btConstraintInfo2::m_upperLimit
btScalar * m_upperLimit
Definition: btTypedConstraint.h:145
btTypedConstraint::getConstraintType
btTypedConstraintType getConstraintType() const
Definition: btTypedConstraint.h:315
btTypedConstraintData::m_name
char * m_name
Definition: btTypedConstraint.h:401
btTypedConstraint::setUserConstraintPtr
void setUserConstraintPtr(void *ptr)
Definition: btTypedConstraint.h:264
btTypedConstraint::m_rbA
btRigidBody & m_rbA
Definition: btTypedConstraint.h:101
btTypedConstraint::btConstraintInfo2
Definition: btTypedConstraint.h:125
FIXED_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:46
btAlignedObjectArray< btSolverConstraint >
btTypedConstraintFloatData::m_breakingImpulseThreshold
float m_breakingImpulseThreshold
Definition: btTypedConstraint.h:387
btTypedConstraintFloatData::m_objectType
int m_objectType
Definition: btTypedConstraint.h:376
btTypedConstraint::m_userConstraintPtr
void * m_userConstraintPtr
Definition: btTypedConstraint.h:84
btTypedConstraintFloatData::m_userConstraintType
int m_userConstraintType
Definition: btTypedConstraint.h:377
btTypedConstraint::setJointFeedback
void setJointFeedback(btJointFeedback *jointFeedback)
Definition: btTypedConstraint.h:274
btTypedConstraintData::m_userConstraintId
int m_userConstraintId
Definition: btTypedConstraint.h:405
btAngularLimit::isLimit
bool isLimit() const
Returns true when the last test() invocation recognized limit violation.
Definition: btTypedConstraint.h:525
btTypedConstraintFloatData::m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
Definition: btTypedConstraint.h:384
btTypedConstraintData::m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
Definition: btTypedConstraint.h:411
btJointFeedback
Definition: btTypedConstraint.h:67
btAssert
#define btAssert(x)
Definition: btScalar.h:113
btAngularLimit::m_center
btScalar m_center
Definition: btTypedConstraint.h:455
btTypedConstraintData::m_rbA
btRigidBodyData * m_rbA
Definition: btTypedConstraint.h:399
CONTACT_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:43
btTypedConstraintDoubleData::m_userConstraintId
int m_userConstraintId
Definition: btTypedConstraint.h:428
btTypedConstraint::getBreakingImpulseThreshold
btScalar getBreakingImpulseThreshold() const
Definition: btTypedConstraint.h:201
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:63
btTypedConstraintDoubleData::m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
Definition: btTypedConstraint.h:434
btTypedConstraint::setUserConstraintId
void setUserConstraintId(int uid)
Definition: btTypedConstraint.h:254
BT_CONSTRAINT_CFM
Definition: btTypedConstraint.h:56
btTypedConstraint::btConstraintInfo2::findex
int * findex
Definition: btTypedConstraint.h:151
GEAR_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:45
btTypedConstraintFloatData::m_name
char * m_name
Definition: btTypedConstraint.h:374
btTypedConstraint::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:90
btRigidBodyData
#define btRigidBodyData
Definition: btRigidBody.h:36
btRigidBody.h
btTypedConstraint::m_needsFeedback
bool m_needsFeedback
Definition: btTypedConstraint.h:89
btTypedConstraint::m_jointFeedback
btJointFeedback * m_jointFeedback
Definition: btTypedConstraint.h:105
btTypedConstraintFloatData::m_appliedImpulse
float m_appliedImpulse
Definition: btTypedConstraint.h:381
btTypedConstraint::getUserConstraintId
int getUserConstraintId() const
Definition: btTypedConstraint.h:259
btSerializer
Definition: btSerializer.h:68
btJointFeedback::m_appliedForceBodyB
btVector3 m_appliedForceBodyB
Definition: btTypedConstraint.h:71
btTypedConstraint::getJointFeedback
const btJointFeedback * getJointFeedback() const
Definition: btTypedConstraint.h:279
BT_CONSTRAINT_STOP_ERP
Definition: btTypedConstraint.h:55
btTypedConstraintDoubleData::m_objectType
int m_objectType
Definition: btTypedConstraint.h:426
btTypedConstraint::setBreakingImpulseThreshold
void setBreakingImpulseThreshold(btScalar threshold)
Definition: btTypedConstraint.h:206
D6_SPRING_2_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:47
btTypedConstraintDoubleData::m_name
char * m_name
Definition: btTypedConstraint.h:424
btAngularLimit::m_halfRange
btScalar m_halfRange
Definition: btTypedConstraint.h:455
btTypedConstraint::m_breakingImpulseThreshold
btScalar m_breakingImpulseThreshold
Definition: btTypedConstraint.h:87
btTypedConstraint::setDbgDrawSize
void setDbgDrawSize(btScalar dbgDrawSize)
Definition: btTypedConstraint.h:320
btTypedConstraint::operator=
btTypedConstraint & operator=(btTypedConstraint &other)
Definition: btTypedConstraint.h:93
btAngularLimit::getHalfRange
btScalar getHalfRange() const
Gives half of the distance between min and max limit angle.
Definition: btTypedConstraint.h:519
btTypedConstraintData::m_appliedImpulse
float m_appliedImpulse
Definition: btTypedConstraint.h:408
BT_CONSTRAINT_STOP_CFM
Definition: btTypedConstraint.h:57
btTypedConstraintDoubleData::m_appliedImpulse
double m_appliedImpulse
Definition: btTypedConstraint.h:431
SIMD_2_PI
#define SIMD_2_PI
Definition: btScalar.h:477
btTypedConstraint::needsFeedback
bool needsFeedback() const
Definition: btTypedConstraint.h:295
btAngularLimit::getHigh
btScalar getHigh() const
Definition: btTypedConstraint.cpp:219
btJointFeedback::m_appliedForceBodyA
btVector3 m_appliedForceBodyA
Definition: btTypedConstraint.h:69
btAngularLimit::set
void set(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Sets all limit's parameters.
Definition: btTypedConstraint.cpp:156
btAngularLimit::m_relaxationFactor
btScalar m_relaxationFactor
Definition: btTypedConstraint.h:455
btAngularLimit::getSign
btScalar getSign() const
Returns sign value evaluated when test() was invoked.
Definition: btTypedConstraint.h:513
btRigidBodyDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:587
btTypedConstraintData::m_dbgDrawSize
float m_dbgDrawSize
Definition: btTypedConstraint.h:409
btAngularLimit::getSoftness
btScalar getSoftness() const
Returns limit's softness.
Definition: btTypedConstraint.h:489
btTypedConstraint::setOverrideNumSolverIterations
void setOverrideNumSolverIterations(int overideNumIterations)
override the number of constraint solver iterations used to solve this constraint -1 will use the def...
Definition: btTypedConstraint.h:166
btTypedConstraintFloatData::m_userConstraintId
int m_userConstraintId
Definition: btTypedConstraint.h:378
btAngularLimit::getError
btScalar getError() const
Returns correction value multiplied by sign value.
Definition: btTypedConstraint.cpp:190
btAngularLimit::getBiasFactor
btScalar getBiasFactor() const
Returns limit's bias factor.
Definition: btTypedConstraint.h:495
btTypedConstraintDoubleData
Definition: btTypedConstraint.h:420
btTypedConstraint::~btTypedConstraint
virtual ~btTypedConstraint()
Definition: btTypedConstraint.h:115
btTypedConstraintData2
#define btTypedConstraintData2
Definition: btTypedConstraint.h:28
btAngularLimit::m_correction
btScalar m_correction
Definition: btTypedConstraint.h:455
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
D6_SPRING_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:44
btTypedConstraintType
btTypedConstraintType
Definition: btTypedConstraint.h:36
btRigidBodyFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:561
btTypedConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btTypedConstraint.h:397
SLIDER_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:42
btTypedConstraint::m_isEnabled
bool m_isEnabled
Definition: btTypedConstraint.h:88
btTypedConstraintFloatData::m_isEnabled
int m_isEnabled
Definition: btTypedConstraint.h:388
btTypedConstraint::m_dbgDrawSize
btScalar m_dbgDrawSize
Definition: btTypedConstraint.h:104
btTypedConstraint::isEnabled
bool isEnabled() const
Definition: btTypedConstraint.h:211
btSolverConstraint.h
btTypedConstraintData::m_needsFeedback
int m_needsFeedback
Definition: btTypedConstraint.h:406
btAdjustAngleToLimits
btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
Definition: btTypedConstraint.h:345
btTypedConstraintDoubleData::m_rbA
btRigidBodyDoubleData * m_rbA
Definition: btTypedConstraint.h:422
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:64
btTypedConstraint::setUserConstraintType
void setUserConstraintType(int userConstraintType)
Definition: btTypedConstraint.h:249
btNormalizeAngle
btScalar btNormalizeAngle(btScalar angleInRadians)
Definition: btScalar.h:724
btTypedConstraint::btConstraintInfo2::rowskip
int rowskip
Definition: btTypedConstraint.h:137
btTypedConstraintData::m_objectType
int m_objectType
Definition: btTypedConstraint.h:403
btTypedConstraint::solveConstraintObsolete
virtual void solveConstraintObsolete(btSolverBody &, btSolverBody &, btScalar)
internal method used by the constraint solver, don't use them directly
Definition: btTypedConstraint.h:223
btTypedConstraintData::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:412
btTypedConstraint::m_rbB
btRigidBody & m_rbB
Definition: btTypedConstraint.h:102
btTypedConstraintData::m_breakingImpulseThreshold
float m_breakingImpulseThreshold
Definition: btTypedConstraint.h:414
MAX_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:48
btTypedObject
rudimentary class to provide type info
Definition: btScalar.h:744
btJointFeedback::m_appliedTorqueBodyB
btVector3 m_appliedTorqueBodyB
Definition: btTypedConstraint.h:72
btSolverBody
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
Definition: btSolverBody.h:108
btTypedConstraint::btConstraintInfo2::m_J2linearAxis
btScalar * m_J2linearAxis
Definition: btTypedConstraint.h:134
btAngularLimit::getRelaxationFactor
btScalar getRelaxationFactor() const
Returns limit's relaxation factor.
Definition: btTypedConstraint.h:501
btAngularLimit::m_biasFactor
btScalar m_biasFactor
Definition: btTypedConstraint.h:455
btTypedConstraint::setupSolverConstraint
virtual void setupSolverConstraint(btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
internal method used by the constraint solver, don't use them directly
Definition: btTypedConstraint.h:175
CONETWIST_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:40
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:77
btTypedConstraintFloatData::m_dbgDrawSize
float m_dbgDrawSize
Definition: btTypedConstraint.h:382
btTypedConstraint::internalGetAppliedImpulse
btScalar internalGetAppliedImpulse()
internal method used by the constraint solver, don't use them directly
Definition: btTypedConstraint.h:195
btTypedConstraint::getRigidBodyA
const btRigidBody & getRigidBodyA() const
Definition: btTypedConstraint.h:226
btTypedConstraint::setEnabled
void setEnabled(bool enabled)
Definition: btTypedConstraint.h:216
btTypedConstraint::btConstraintInfo1::nub
int nub
Definition: btTypedConstraint.h:120
BT_DECLARE_ALIGNED_ALLOCATOR
#define BT_DECLARE_ALIGNED_ALLOCATOR()
Definition: btScalar.h:388
btTypedConstraintDoubleData::m_needsFeedback
int m_needsFeedback
Definition: btTypedConstraint.h:429
btTypedConstraint::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btTypedConstraint.h:444
btTypedConstraint::getRigidBodyB
btRigidBody & getRigidBodyB()
Definition: btTypedConstraint.h:239
btTypedConstraint::btConstraintInfo2::fps
btScalar fps
Definition: btTypedConstraint.h:128
BT_CONSTRAINT_ERP
Definition: btTypedConstraint.h:54
btAngularLimit::fit
void fit(btScalar &angle) const
Checks given angle against limit.
Definition: btTypedConstraint.cpp:195
btJointFeedback::m_appliedTorqueBodyA
btVector3 m_appliedTorqueBodyA
Definition: btTypedConstraint.h:70
btTypedConstraint::m_appliedImpulse
btScalar m_appliedImpulse
Definition: btTypedConstraint.h:103
btAngularLimit::getCorrection
btScalar getCorrection() const
Returns correction value evaluated when test() was invoked.
Definition: btTypedConstraint.h:507
btTypedConstraintFloatData::m_rbA
btRigidBodyFloatData * m_rbA
Definition: btTypedConstraint.h:372
POINT2POINT_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:38
D6_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:41
btTypedConstraintDoubleData::m_dbgDrawSize
double m_dbgDrawSize
Definition: btTypedConstraint.h:432
btAngularLimit::btAngularLimit
btAngularLimit()
Default constructor initializes limit as inactive, allowing free constraint movement.
Definition: btTypedConstraint.h:468
btAngularLimit::test
void test(const btScalar angle)
Checks conastaint angle against limit.
Definition: btTypedConstraint.cpp:165
btAngularLimit::m_softness
btScalar m_softness
Definition: btTypedConstraint.h:455
btTypedConstraint::getAppliedImpulse
btScalar getAppliedImpulse() const
getAppliedImpulse is an estimated total applied impulse.
Definition: btTypedConstraint.h:309
btConstraintParams
btConstraintParams
Definition: btTypedConstraint.h:52
HINGE_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:39
btTypedConstraint::internalSetAppliedImpulse
void internalSetAppliedImpulse(btScalar appliedImpulse)
internal method used by the constraint solver, don't use them directly
Definition: btTypedConstraint.h:190
btAngularLimit::getLow
btScalar getLow() const
Definition: btTypedConstraint.cpp:214
btTypedConstraint::getRigidBodyA
btRigidBody & getRigidBodyA()
Definition: btTypedConstraint.h:235
btAngularLimit::m_solveLimit
bool m_solveLimit
Definition: btTypedConstraint.h:464
btTypedConstraint::getUserConstraintPtr
void * getUserConstraintPtr()
Definition: btTypedConstraint.h:269
btAngularLimit::m_sign
btScalar m_sign
Definition: btTypedConstraint.h:455
btTypedConstraintDoubleData::padding
char padding[4]
Definition: btTypedConstraint.h:439
btTypedConstraintData::m_userConstraintType
int m_userConstraintType
Definition: btTypedConstraint.h:404
btTypedConstraint::btConstraintInfo1
Definition: btTypedConstraint.h:119
btTypedConstraintFloatData::m_needsFeedback
int m_needsFeedback
Definition: btTypedConstraint.h:379
btTypedConstraint::btConstraintInfo2::m_numIterations
int m_numIterations
Definition: btTypedConstraint.h:153
btTypedConstraint::getDbgDrawSize
btScalar getDbgDrawSize()
Definition: btTypedConstraint.h:324
btTypedConstraintDoubleData::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:435
btTypedConstraintDoubleData::m_userConstraintType
int m_userConstraintType
Definition: btTypedConstraint.h:427
btTypedConstraintData::m_isEnabled
int m_isEnabled
Definition: btTypedConstraint.h:415
btTypedConstraint::getUid
int getUid() const
Definition: btTypedConstraint.h:290
btTypedConstraint::getRigidBodyB
const btRigidBody & getRigidBodyB() const
Definition: btTypedConstraint.h:230
btTypedConstraint::getOverrideNumSolverIterations
int getOverrideNumSolverIterations() const
Definition: btTypedConstraint.h:159
btTypedConstraint::m_userConstraintType
int m_userConstraintType
Definition: btTypedConstraint.h:79
btTypedConstraintFloatData::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:385
btTypedConstraint::buildJacobian
virtual void buildJacobian()
internal method used by the constraint solver, don't use them directly
Definition: btTypedConstraint.h:172
btTypedConstraintFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btTypedConstraint.h:370
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:278
btTypedConstraintDoubleData::m_rbB
btRigidBodyDoubleData * m_rbB
Definition: btTypedConstraint.h:423
btTypedConstraint::getJointFeedback
btJointFeedback * getJointFeedback()
Definition: btTypedConstraint.h:284
btScalar.h
btFabs
btScalar btFabs(btScalar x)
Definition: btScalar.h:449
btTypedConstraint::m_userConstraintId
int m_userConstraintId
Definition: btTypedConstraint.h:83