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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btGeneric6DofConstraint.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
18
19/*
202007-09-09
21btGeneric6DofConstraint Refactored by Francisco Le?n
22email: projectileman@yahoo.com
23http://gimpact.sf.net
24*/
25
26#ifndef BT_GENERIC_6DOF_CONSTRAINT_H
27#define BT_GENERIC_6DOF_CONSTRAINT_H
28
29#include "LinearMath/btVector3.h"
30#include "btJacobianEntry.h"
31#include "btTypedConstraint.h"
32
33class btRigidBody;
34
35#ifdef BT_USE_DOUBLE_PRECISION
36#define btGeneric6DofConstraintData2 btGeneric6DofConstraintDoubleData2
37#define btGeneric6DofConstraintDataName "btGeneric6DofConstraintDoubleData2"
38#else
39#define btGeneric6DofConstraintData2 btGeneric6DofConstraintData
40#define btGeneric6DofConstraintDataName "btGeneric6DofConstraintData"
41#endif //BT_USE_DOUBLE_PRECISION
42
44 class btRotationalLimitMotor
45{
46public:
49 btScalar m_loLimit;
50 btScalar m_hiLimit;
51 btScalar m_targetVelocity;
52 btScalar m_maxMotorForce;
53 btScalar m_maxLimitForce;
54 btScalar m_damping;
55 btScalar m_limitSoftness;
56 btScalar m_normalCFM;
57 btScalar m_stopERP;
58 btScalar m_stopCFM;
59 btScalar m_bounce;
60 bool m_enableMotor;
61
63
66 btScalar m_currentLimitError;
67 btScalar m_currentPosition;
68 int m_currentLimit;
69 btScalar m_accumulatedImpulse;
71
72 btRotationalLimitMotor()
73 {
74 m_accumulatedImpulse = 0.f;
75 m_targetVelocity = 0;
76 m_maxMotorForce = 6.0f;
77 m_maxLimitForce = 300.0f;
78 m_loLimit = 1.0f;
79 m_hiLimit = -1.0f;
80 m_normalCFM = 0.f;
81 m_stopERP = 0.2f;
82 m_stopCFM = 0.f;
83 m_bounce = 0.0f;
84 m_damping = 1.0f;
85 m_limitSoftness = 0.5f;
86 m_currentLimit = 0;
87 m_currentLimitError = 0;
88 m_enableMotor = false;
89 }
90
91 btRotationalLimitMotor(const btRotationalLimitMotor& limot)
92 {
93 m_targetVelocity = limot.m_targetVelocity;
94 m_maxMotorForce = limot.m_maxMotorForce;
95 m_limitSoftness = limot.m_limitSoftness;
96 m_loLimit = limot.m_loLimit;
97 m_hiLimit = limot.m_hiLimit;
98 m_normalCFM = limot.m_normalCFM;
99 m_stopERP = limot.m_stopERP;
100 m_stopCFM = limot.m_stopCFM;
101 m_bounce = limot.m_bounce;
102 m_currentLimit = limot.m_currentLimit;
103 m_currentLimitError = limot.m_currentLimitError;
104 m_enableMotor = limot.m_enableMotor;
105 }
106
108 bool isLimited() const
109 {
110 if (m_loLimit > m_hiLimit) return false;
111 return true;
112 }
113
115 bool needApplyTorques() const
116 {
117 if (m_currentLimit == 0 && m_enableMotor == false) return false;
118 return true;
119 }
120
122
125 int testLimitValue(btScalar test_value);
126
128 btScalar solveAngularLimits(btScalar timeStep, btVector3& axis, btScalar jacDiagABInv, btRigidBody* body0, btRigidBody* body1);
129};
130
131 class btTranslationalLimitMotor
132{
133public:
134 btVector3 m_lowerLimit;
135 btVector3 m_upperLimit;
136 btVector3 m_accumulatedImpulse;
139 btScalar m_limitSoftness;
140 btScalar m_damping;
141 btScalar m_restitution;
142 btVector3 m_normalCFM;
143 btVector3 m_stopERP;
144 btVector3 m_stopCFM;
146 bool m_enableMotor[3];
147 btVector3 m_targetVelocity;
148 btVector3 m_maxMotorForce;
149 btVector3 m_currentLimitError;
150 btVector3 m_currentLinearDiff;
151 int m_currentLimit[3];
152
153 btTranslationalLimitMotor()
154 {
155 m_lowerLimit.setValue(0.f, 0.f, 0.f);
156 m_upperLimit.setValue(0.f, 0.f, 0.f);
157 m_accumulatedImpulse.setValue(0.f, 0.f, 0.f);
158 m_normalCFM.setValue(0.f, 0.f, 0.f);
159 m_stopERP.setValue(0.2f, 0.2f, 0.2f);
160 m_stopCFM.setValue(0.f, 0.f, 0.f);
161
162 m_limitSoftness = 0.7f;
163 m_damping = btScalar(1.0f);
164 m_restitution = btScalar(0.5f);
165 for (int i = 0; i < 3; i++)
166 {
167 m_enableMotor[i] = false;
168 m_targetVelocity[i] = btScalar(0.f);
169 m_maxMotorForce[i] = btScalar(0.f);
170 }
171 }
172
173 btTranslationalLimitMotor(const btTranslationalLimitMotor& other)
174 {
175 m_lowerLimit = other.m_lowerLimit;
176 m_upperLimit = other.m_upperLimit;
177 m_accumulatedImpulse = other.m_accumulatedImpulse;
178
179 m_limitSoftness = other.m_limitSoftness;
180 m_damping = other.m_damping;
181 m_restitution = other.m_restitution;
182 m_normalCFM = other.m_normalCFM;
183 m_stopERP = other.m_stopERP;
184 m_stopCFM = other.m_stopCFM;
185
186 for (int i = 0; i < 3; i++)
187 {
188 m_enableMotor[i] = other.m_enableMotor[i];
189 m_targetVelocity[i] = other.m_targetVelocity[i];
190 m_maxMotorForce[i] = other.m_maxMotorForce[i];
191 }
192 }
193
195
201 inline bool isLimited(int limitIndex) const
202 {
203 return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
204 }
205 inline bool needApplyForce(int limitIndex) const
206 {
207 if (m_currentLimit[limitIndex] == 0 && m_enableMotor[limitIndex] == false) return false;
208 return true;
209 }
210 int testLimitValue(int limitIndex, btScalar test_value);
211
212 btScalar solveLinearAxis(
213 btScalar timeStep,
214 btScalar jacDiagABInv,
215 btRigidBody& body1, const btVector3& pointInA,
216 btRigidBody& body2, const btVector3& pointInB,
217 int limit_index,
218 const btVector3& axis_normal_on_a,
219 const btVector3& anchorPos);
220};
221
222 enum bt6DofFlags
223{
224 BT_6DOF_FLAGS_CFM_NORM = 1,
225 BT_6DOF_FLAGS_CFM_STOP = 2,
226 BT_6DOF_FLAGS_ERP_STOP = 4
227};
228#define BT_6DOF_FLAGS_AXIS_SHIFT 3 // bits per axis
229
231
266 ATTRIBUTE_ALIGNED16(class)
267 btGeneric6DofConstraint : public btTypedConstraint
268{
269protected:
272 btTransform m_frameInA;
273 btTransform m_frameInB;
275
278 btJacobianEntry m_jacLinear[3];
279 btJacobianEntry m_jacAng[3];
281
284 btTranslationalLimitMotor m_linearLimits;
286
289 btRotationalLimitMotor m_angularLimits[3];
291
292protected:
295 btScalar m_timeStep;
296 btTransform m_calculatedTransformA;
297 btTransform m_calculatedTransformB;
298 btVector3 m_calculatedAxisAngleDiff;
299 btVector3 m_calculatedAxis[3];
300 btVector3 m_calculatedLinearDiff;
301 btScalar m_factA;
302 btScalar m_factB;
303 bool m_hasStaticBody;
304
305 btVector3 m_AnchorPos; // point betwen pivots of bodies A and B to solve linear axes
306
307 bool m_useLinearReferenceFrameA;
308 bool m_useOffsetForConstraintFrame;
309
310 int m_flags;
311
313
314 btGeneric6DofConstraint& operator=(btGeneric6DofConstraint& other)
315 {
316 btAssert(0);
317 (void)other;
318 return *this;
319 }
320
321 int setAngularLimits(btConstraintInfo2 * info, int row_offset, const btTransform& transA, const btTransform& transB, const btVector3& linVelA, const btVector3& linVelB, const btVector3& angVelA, const btVector3& angVelB);
322
323 int setLinearLimits(btConstraintInfo2 * info, int row, const btTransform& transA, const btTransform& transB, const btVector3& linVelA, const btVector3& linVelB, const btVector3& angVelA, const btVector3& angVelB);
324
325 void buildLinearJacobian(
326 btJacobianEntry & jacLinear, const btVector3& normalWorld,
327 const btVector3& pivotAInW, const btVector3& pivotBInW);
328
329 void buildAngularJacobian(btJacobianEntry & jacAngular, const btVector3& jointAxisW);
330
331 // tests linear limits
332 void calculateLinearInfo();
333
335 void calculateAngleInfo();
336
337public:
338 BT_DECLARE_ALIGNED_ALLOCATOR();
339
341 bool m_useSolveConstraintObsolete;
342
343 btGeneric6DofConstraint(btRigidBody & rbA, btRigidBody & rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA);
344 btGeneric6DofConstraint(btRigidBody & rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
345
347
351 void calculateTransforms(const btTransform& transA, const btTransform& transB);
352
353 void calculateTransforms();
354
356
359 const btTransform& getCalculatedTransformA() const
360 {
361 return m_calculatedTransformA;
362 }
363
365
368 const btTransform& getCalculatedTransformB() const
369 {
370 return m_calculatedTransformB;
371 }
372
373 const btTransform& getFrameOffsetA() const
374 {
375 return m_frameInA;
376 }
377
378 const btTransform& getFrameOffsetB() const
379 {
380 return m_frameInB;
381 }
382
383 btTransform& getFrameOffsetA()
384 {
385 return m_frameInA;
386 }
387
388 btTransform& getFrameOffsetB()
389 {
390 return m_frameInB;
391 }
392
394 virtual void buildJacobian();
395
396 virtual void getInfo1(btConstraintInfo1 * info);
397
398 void getInfo1NonVirtual(btConstraintInfo1 * info);
399
400 virtual void getInfo2(btConstraintInfo2 * info);
401
402 void getInfo2NonVirtual(btConstraintInfo2 * info, const btTransform& transA, const btTransform& transB, const btVector3& linVelA, const btVector3& linVelB, const btVector3& angVelA, const btVector3& angVelB);
403
404 void updateRHS(btScalar timeStep);
405
407
410 btVector3 getAxis(int axis_index) const;
411
413
416 btScalar getAngle(int axis_index) const;
417
419
422 btScalar getRelativePivotPosition(int axis_index) const;
423
424 void setFrames(const btTransform& frameA, const btTransform& frameB);
425
427
431 bool testAngularLimitMotor(int axis_index);
432
433 void setLinearLowerLimit(const btVector3& linearLower)
434 {
435 m_linearLimits.m_lowerLimit = linearLower;
436 }
437
438 void getLinearLowerLimit(btVector3 & linearLower) const
439 {
440 linearLower = m_linearLimits.m_lowerLimit;
441 }
442
443 void setLinearUpperLimit(const btVector3& linearUpper)
444 {
445 m_linearLimits.m_upperLimit = linearUpper;
446 }
447
448 void getLinearUpperLimit(btVector3 & linearUpper) const
449 {
450 linearUpper = m_linearLimits.m_upperLimit;
451 }
452
453 void setAngularLowerLimit(const btVector3& angularLower)
454 {
455 for (int i = 0; i < 3; i++)
456 m_angularLimits[i].m_loLimit = btNormalizeAngle(angularLower[i]);
457 }
458
459 void getAngularLowerLimit(btVector3 & angularLower) const
460 {
461 for (int i = 0; i < 3; i++)
462 angularLower[i] = m_angularLimits[i].m_loLimit;
463 }
464
465 void setAngularUpperLimit(const btVector3& angularUpper)
466 {
467 for (int i = 0; i < 3; i++)
468 m_angularLimits[i].m_hiLimit = btNormalizeAngle(angularUpper[i]);
469 }
470
471 void getAngularUpperLimit(btVector3 & angularUpper) const
472 {
473 for (int i = 0; i < 3; i++)
474 angularUpper[i] = m_angularLimits[i].m_hiLimit;
475 }
476
478 btRotationalLimitMotor* getRotationalLimitMotor(int index)
479 {
480 return &m_angularLimits[index];
481 }
482
484 btTranslationalLimitMotor* getTranslationalLimitMotor()
485 {
486 return &m_linearLimits;
487 }
488
489 //first 3 are linear, next 3 are angular
490 void setLimit(int axis, btScalar lo, btScalar hi)
491 {
492 if (axis < 3)
493 {
494 m_linearLimits.m_lowerLimit[axis] = lo;
495 m_linearLimits.m_upperLimit[axis] = hi;
496 }
497 else
498 {
499 lo = btNormalizeAngle(lo);
500 hi = btNormalizeAngle(hi);
501 m_angularLimits[axis - 3].m_loLimit = lo;
502 m_angularLimits[axis - 3].m_hiLimit = hi;
503 }
504 }
505
507
513 bool isLimited(int limitIndex) const
514 {
515 if (limitIndex < 3)
516 {
517 return m_linearLimits.isLimited(limitIndex);
518 }
519 return m_angularLimits[limitIndex - 3].isLimited();
520 }
521
522 virtual void calcAnchorPos(void); // overridable
523
524 int get_limit_motor_info2(btRotationalLimitMotor * limot,
525 const btTransform& transA, const btTransform& transB, const btVector3& linVelA, const btVector3& linVelB, const btVector3& angVelA, const btVector3& angVelB,
526 btConstraintInfo2* info, int row, btVector3& ax1, int rotational, int rotAllowed = false);
527
528 // access for UseFrameOffset
529 bool getUseFrameOffset() const { return m_useOffsetForConstraintFrame; }
530 void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
531
532 bool getUseLinearReferenceFrameA() const { return m_useLinearReferenceFrameA; }
533 void setUseLinearReferenceFrameA(bool linearReferenceFrameA) { m_useLinearReferenceFrameA = linearReferenceFrameA; }
534
537 virtual void setParam(int num, btScalar value, int axis = -1);
539 virtual btScalar getParam(int num, int axis = -1) const;
540
541 void setAxis(const btVector3& axis1, const btVector3& axis2);
542
543 virtual int getFlags() const
544 {
545 return m_flags;
546 }
547
548 virtual int calculateSerializeBufferSize() const;
549
551 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
552};
553
554 struct btGeneric6DofConstraintData
555{
556 btTypedConstraintData m_typeConstraintData;
557 btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
558 btTransformFloatData m_rbBFrame;
559
560 btVector3FloatData m_linearUpperLimit;
561 btVector3FloatData m_linearLowerLimit;
562
563 btVector3FloatData m_angularUpperLimit;
564 btVector3FloatData m_angularLowerLimit;
565
566 int m_useLinearReferenceFrameA;
567 int m_useOffsetForConstraintFrame;
568};
569
570 struct btGeneric6DofConstraintDoubleData2
571{
572 btTypedConstraintDoubleData m_typeConstraintData;
573 btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
574 btTransformDoubleData m_rbBFrame;
575
576 btVector3DoubleData m_linearUpperLimit;
577 btVector3DoubleData m_linearLowerLimit;
578
579 btVector3DoubleData m_angularUpperLimit;
580 btVector3DoubleData m_angularLowerLimit;
581
582 int m_useLinearReferenceFrameA;
583 int m_useOffsetForConstraintFrame;
584};
585
586 SIMD_FORCE_INLINE int btGeneric6DofConstraint::calculateSerializeBufferSize() const
587{
588 return sizeof(btGeneric6DofConstraintData2);
589}
590
592 SIMD_FORCE_INLINE const char* btGeneric6DofConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
593{
594 btGeneric6DofConstraintData2* dof = (btGeneric6DofConstraintData2*)dataBuffer;
595 btTypedConstraint::serialize(&dof->m_typeConstraintData, serializer);
596
597 m_frameInA.serialize(dof->m_rbAFrame);
598 m_frameInB.serialize(dof->m_rbBFrame);
599
600 int i;
601 for (i = 0; i < 3; i++)
602 {
603 dof->m_angularLowerLimit.m_floats[i] = m_angularLimits[i].m_loLimit;
604 dof->m_angularUpperLimit.m_floats[i] = m_angularLimits[i].m_hiLimit;
605 dof->m_linearLowerLimit.m_floats[i] = m_linearLimits.m_lowerLimit[i];
606 dof->m_linearUpperLimit.m_floats[i] = m_linearLimits.m_upperLimit[i];
607 }
608
609 dof->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA ? 1 : 0;
610 dof->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame ? 1 : 0;
611
612 return btGeneric6DofConstraintDataName;
613}
614
615#endif //BT_GENERIC_6DOF_CONSTRAINT_H
btGeneric6DofConstraintDataName
#define btGeneric6DofConstraintDataName
Definition: btGeneric6DofConstraint.h:40
bt6DofFlags
bt6DofFlags
Definition: btGeneric6DofConstraint.h:223
BT_6DOF_FLAGS_ERP_STOP
@ BT_6DOF_FLAGS_ERP_STOP
Definition: btGeneric6DofConstraint.h:226
BT_6DOF_FLAGS_CFM_STOP
@ BT_6DOF_FLAGS_CFM_STOP
Definition: btGeneric6DofConstraint.h:225
BT_6DOF_FLAGS_CFM_NORM
@ BT_6DOF_FLAGS_CFM_NORM
Definition: btGeneric6DofConstraint.h:224
btGeneric6DofConstraintData2
#define btGeneric6DofConstraintData2
Definition: btGeneric6DofConstraint.h:39
btJacobianEntry.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
btAssert
#define btAssert(x)
Definition: btScalar.h:153
btTypedConstraint.h
btVector3.h
btGeneric6DofConstraint
btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis locatio...
Definition: btGeneric6DofConstraint.h:268
btGeneric6DofConstraint::m_hasStaticBody
bool m_hasStaticBody
Definition: btGeneric6DofConstraint.h:303
btGeneric6DofConstraint::m_frameInA
btTransform m_frameInA
relative_frames
Definition: btGeneric6DofConstraint.h:272
btGeneric6DofConstraint::getAngularUpperLimit
void getAngularUpperLimit(btVector3 &angularUpper) const
Definition: btGeneric6DofConstraint.h:471
btGeneric6DofConstraint::serialize
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition: btGeneric6DofConstraint.h:592
btGeneric6DofConstraint::operator=
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
Definition: btGeneric6DofConstraint.h:314
btGeneric6DofConstraint::getAngularLowerLimit
void getAngularLowerLimit(btVector3 &angularLower) const
Definition: btGeneric6DofConstraint.h:459
btGeneric6DofConstraint::setLinearLowerLimit
void setLinearLowerLimit(const btVector3 &linearLower)
Definition: btGeneric6DofConstraint.h:433
btGeneric6DofConstraint::getCalculatedTransformB
const btTransform & getCalculatedTransformB() const
Gets the global transform of the offset for body B.
Definition: btGeneric6DofConstraint.h:368
btGeneric6DofConstraint::setUseFrameOffset
void setUseFrameOffset(bool frameOffsetOnOff)
Definition: btGeneric6DofConstraint.h:530
btGeneric6DofConstraint::m_calculatedTransformA
btTransform m_calculatedTransformA
Definition: btGeneric6DofConstraint.h:296
btGeneric6DofConstraint::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btGeneric6DofConstraint.h:586
btGeneric6DofConstraint::m_calculatedLinearDiff
btVector3 m_calculatedLinearDiff
Definition: btGeneric6DofConstraint.h:300
btGeneric6DofConstraint::getLinearUpperLimit
void getLinearUpperLimit(btVector3 &linearUpper) const
Definition: btGeneric6DofConstraint.h:448
btGeneric6DofConstraint::getFrameOffsetB
btTransform & getFrameOffsetB()
Definition: btGeneric6DofConstraint.h:388
btGeneric6DofConstraint::m_timeStep
btScalar m_timeStep
temporal variables
Definition: btGeneric6DofConstraint.h:295
btGeneric6DofConstraint::setAngularLowerLimit
void setAngularLowerLimit(const btVector3 &angularLower)
Definition: btGeneric6DofConstraint.h:453
btGeneric6DofConstraint::getRotationalLimitMotor
btRotationalLimitMotor * getRotationalLimitMotor(int index)
Retrieves the angular limit informacion.
Definition: btGeneric6DofConstraint.h:478
btGeneric6DofConstraint::m_flags
int m_flags
Definition: btGeneric6DofConstraint.h:310
btGeneric6DofConstraint::setLimit
void setLimit(int axis, btScalar lo, btScalar hi)
Definition: btGeneric6DofConstraint.h:490
btGeneric6DofConstraint::getFlags
virtual int getFlags() const
Definition: btGeneric6DofConstraint.h:543
btGeneric6DofConstraint::m_factB
btScalar m_factB
Definition: btGeneric6DofConstraint.h:302
btGeneric6DofConstraint::getUseLinearReferenceFrameA
bool getUseLinearReferenceFrameA() const
Definition: btGeneric6DofConstraint.h:532
btGeneric6DofConstraint::m_frameInB
btTransform m_frameInB
the constraint space w.r.t body B
Definition: btGeneric6DofConstraint.h:273
btGeneric6DofConstraint::getFrameOffsetB
const btTransform & getFrameOffsetB() const
Definition: btGeneric6DofConstraint.h:378
btGeneric6DofConstraint::getFrameOffsetA
btTransform & getFrameOffsetA()
Definition: btGeneric6DofConstraint.h:383
btGeneric6DofConstraint::getLinearLowerLimit
void getLinearLowerLimit(btVector3 &linearLower) const
Definition: btGeneric6DofConstraint.h:438
btGeneric6DofConstraint::m_useOffsetForConstraintFrame
bool m_useOffsetForConstraintFrame
Definition: btGeneric6DofConstraint.h:308
btGeneric6DofConstraint::getFrameOffsetA
const btTransform & getFrameOffsetA() const
Definition: btGeneric6DofConstraint.h:373
btGeneric6DofConstraint::getCalculatedTransformA
const btTransform & getCalculatedTransformA() const
Gets the global transform of the offset for body A.
Definition: btGeneric6DofConstraint.h:359
btGeneric6DofConstraint::BT_DECLARE_ALIGNED_ALLOCATOR
BT_DECLARE_ALIGNED_ALLOCATOR()
btGeneric6DofConstraint::m_useLinearReferenceFrameA
bool m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:307
btGeneric6DofConstraint::m_AnchorPos
btVector3 m_AnchorPos
Definition: btGeneric6DofConstraint.h:305
btGeneric6DofConstraint::getUseFrameOffset
bool getUseFrameOffset() const
Definition: btGeneric6DofConstraint.h:529
btGeneric6DofConstraint::m_useSolveConstraintObsolete
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to 'getInfo/getInfo2'
Definition: btGeneric6DofConstraint.h:341
btGeneric6DofConstraint::isLimited
bool isLimited(int limitIndex) const
Test limit.
Definition: btGeneric6DofConstraint.h:513
btGeneric6DofConstraint::m_factA
btScalar m_factA
Definition: btGeneric6DofConstraint.h:301
btGeneric6DofConstraint::getTranslationalLimitMotor
btTranslationalLimitMotor * getTranslationalLimitMotor()
Retrieves the limit informacion.
Definition: btGeneric6DofConstraint.h:484
btGeneric6DofConstraint::setUseLinearReferenceFrameA
void setUseLinearReferenceFrameA(bool linearReferenceFrameA)
Definition: btGeneric6DofConstraint.h:533
btGeneric6DofConstraint::m_linearLimits
btTranslationalLimitMotor m_linearLimits
Linear_Limit_parameters.
Definition: btGeneric6DofConstraint.h:284
btGeneric6DofConstraint::setAngularUpperLimit
void setAngularUpperLimit(const btVector3 &angularUpper)
Definition: btGeneric6DofConstraint.h:465
btGeneric6DofConstraint::setLinearUpperLimit
void setLinearUpperLimit(const btVector3 &linearUpper)
Definition: btGeneric6DofConstraint.h:443
btGeneric6DofConstraint::m_angularLimits
btRotationalLimitMotor m_angularLimits[3]
hinge_parameters
Definition: btGeneric6DofConstraint.h:289
btGeneric6DofConstraint::m_calculatedAxisAngleDiff
btVector3 m_calculatedAxisAngleDiff
Definition: btGeneric6DofConstraint.h:298
btGeneric6DofConstraint::m_calculatedTransformB
btTransform m_calculatedTransformB
Definition: btGeneric6DofConstraint.h:297
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
btRotationalLimitMotor
Rotation Limit structure for generic joints.
Definition: btGeneric6DofConstraint.h:45
btRotationalLimitMotor::m_currentPosition
btScalar m_currentPosition
How much is violated this limit.
Definition: btGeneric6DofConstraint.h:67
btRotationalLimitMotor::m_targetVelocity
btScalar m_targetVelocity
target motor velocity
Definition: btGeneric6DofConstraint.h:51
btRotationalLimitMotor::btRotationalLimitMotor
btRotationalLimitMotor(const btRotationalLimitMotor &limot)
Definition: btGeneric6DofConstraint.h:91
btRotationalLimitMotor::m_hiLimit
btScalar m_hiLimit
joint limit
Definition: btGeneric6DofConstraint.h:50
btRotationalLimitMotor::m_normalCFM
btScalar m_normalCFM
Relaxation factor.
Definition: btGeneric6DofConstraint.h:56
btRotationalLimitMotor::m_maxMotorForce
btScalar m_maxMotorForce
max force on motor
Definition: btGeneric6DofConstraint.h:52
btRotationalLimitMotor::m_damping
btScalar m_damping
Damping.
Definition: btGeneric6DofConstraint.h:54
btRotationalLimitMotor::m_bounce
btScalar m_bounce
restitution factor
Definition: btGeneric6DofConstraint.h:59
btRotationalLimitMotor::m_loLimit
btScalar m_loLimit
limit_parameters
Definition: btGeneric6DofConstraint.h:49
btRotationalLimitMotor::m_currentLimitError
btScalar m_currentLimitError
temp_variables
Definition: btGeneric6DofConstraint.h:66
btRotationalLimitMotor::m_limitSoftness
btScalar m_limitSoftness
Definition: btGeneric6DofConstraint.h:55
btRotationalLimitMotor::m_stopERP
btScalar m_stopERP
Error tolerance factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:57
btRotationalLimitMotor::m_enableMotor
bool m_enableMotor
Definition: btGeneric6DofConstraint.h:60
btRotationalLimitMotor::btRotationalLimitMotor
btRotationalLimitMotor()
Definition: btGeneric6DofConstraint.h:72
btRotationalLimitMotor::needApplyTorques
bool needApplyTorques() const
Need apply correction.
Definition: btGeneric6DofConstraint.h:115
btRotationalLimitMotor::isLimited
bool isLimited() const
Is limited.
Definition: btGeneric6DofConstraint.h:108
btRotationalLimitMotor::m_accumulatedImpulse
btScalar m_accumulatedImpulse
Definition: btGeneric6DofConstraint.h:69
btRotationalLimitMotor::testLimitValue
int testLimitValue(btScalar test_value)
calculates error
Definition: btGeneric6DofConstraint.cpp:100
btRotationalLimitMotor::m_maxLimitForce
btScalar m_maxLimitForce
max force on limit
Definition: btGeneric6DofConstraint.h:53
btRotationalLimitMotor::m_currentLimit
int m_currentLimit
current value of angle
Definition: btGeneric6DofConstraint.h:68
btRotationalLimitMotor::solveAngularLimits
btScalar solveAngularLimits(btScalar timeStep, btVector3 &axis, btScalar jacDiagABInv, btRigidBody *body0, btRigidBody *body1)
apply the correction impulses for two bodies
Definition: btGeneric6DofConstraint.cpp:132
btRotationalLimitMotor::m_stopCFM
btScalar m_stopCFM
Constraint force mixing factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:58
btSerializer
Definition: btSerializer.h:66
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30
btTransform::serialize
void serialize(struct btTransformData &dataOut) const
Definition: btTransform.h:257
btTranslationalLimitMotor
Definition: btGeneric6DofConstraint.h:132
btTranslationalLimitMotor::m_stopERP
btVector3 m_stopERP
Error tolerance factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:143
btTranslationalLimitMotor::m_currentLimit
int m_currentLimit[3]
Current relative offset of constraint frames.
Definition: btGeneric6DofConstraint.h:151
btTranslationalLimitMotor::solveLinearAxis
btScalar solveLinearAxis(btScalar timeStep, btScalar jacDiagABInv, btRigidBody &body1, const btVector3 &pointInA, btRigidBody &body2, const btVector3 &pointInB, int limit_index, const btVector3 &axis_normal_on_a, const btVector3 &anchorPos)
Definition: btGeneric6DofConstraint.cpp:235
btTranslationalLimitMotor::m_stopCFM
btVector3 m_stopCFM
Constraint force mixing factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:144
btTranslationalLimitMotor::m_maxMotorForce
btVector3 m_maxMotorForce
max force on motor
Definition: btGeneric6DofConstraint.h:148
btTranslationalLimitMotor::m_accumulatedImpulse
btVector3 m_accumulatedImpulse
Definition: btGeneric6DofConstraint.h:136
btTranslationalLimitMotor::testLimitValue
int testLimitValue(int limitIndex, btScalar test_value)
Definition: btGeneric6DofConstraint.cpp:206
btTranslationalLimitMotor::m_currentLinearDiff
btVector3 m_currentLinearDiff
How much is violated this limit.
Definition: btGeneric6DofConstraint.h:150
btTranslationalLimitMotor::m_normalCFM
btVector3 m_normalCFM
Bounce parameter for linear limit.
Definition: btGeneric6DofConstraint.h:142
btTranslationalLimitMotor::needApplyForce
bool needApplyForce(int limitIndex) const
Definition: btGeneric6DofConstraint.h:205
btTranslationalLimitMotor::m_currentLimitError
btVector3 m_currentLimitError
Definition: btGeneric6DofConstraint.h:149
btTranslationalLimitMotor::btTranslationalLimitMotor
btTranslationalLimitMotor()
Definition: btGeneric6DofConstraint.h:153
btTranslationalLimitMotor::m_limitSoftness
btScalar m_limitSoftness
Linear_Limit_parameters.
Definition: btGeneric6DofConstraint.h:139
btTranslationalLimitMotor::m_targetVelocity
btVector3 m_targetVelocity
target motor velocity
Definition: btGeneric6DofConstraint.h:147
btTranslationalLimitMotor::m_lowerLimit
btVector3 m_lowerLimit
the constraint lower limits
Definition: btGeneric6DofConstraint.h:134
btTranslationalLimitMotor::btTranslationalLimitMotor
btTranslationalLimitMotor(const btTranslationalLimitMotor &other)
Definition: btGeneric6DofConstraint.h:173
btTranslationalLimitMotor::isLimited
bool isLimited(int limitIndex) const
Test limit.
Definition: btGeneric6DofConstraint.h:201
btTranslationalLimitMotor::m_restitution
btScalar m_restitution
Definition: btGeneric6DofConstraint.h:141
btTranslationalLimitMotor::m_damping
btScalar m_damping
Damping for linear limit.
Definition: btGeneric6DofConstraint.h:140
btTranslationalLimitMotor::m_upperLimit
btVector3 m_upperLimit
the constraint upper limits
Definition: btGeneric6DofConstraint.h:135
btTranslationalLimitMotor::m_enableMotor
bool m_enableMotor[3]
Definition: btGeneric6DofConstraint.h:146
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:76
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
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82
btVector3::setValue
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
Definition: btVector3.h:640
btVector3::m_floats
btScalar m_floats[4]
Definition: btVector3.h:111
btGeneric6DofConstraintData
Definition: btGeneric6DofConstraint.h:555
btGeneric6DofConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btGeneric6DofConstraint.h:558
btGeneric6DofConstraintData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:566
btGeneric6DofConstraintData::m_linearUpperLimit
btVector3FloatData m_linearUpperLimit
Definition: btGeneric6DofConstraint.h:560
btGeneric6DofConstraintData::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition: btGeneric6DofConstraint.h:567
btGeneric6DofConstraintData::m_typeConstraintData
btTypedConstraintData m_typeConstraintData
Definition: btGeneric6DofConstraint.h:556
btGeneric6DofConstraintData::m_linearLowerLimit
btVector3FloatData m_linearLowerLimit
Definition: btGeneric6DofConstraint.h:561
btGeneric6DofConstraintData::m_angularLowerLimit
btVector3FloatData m_angularLowerLimit
Definition: btGeneric6DofConstraint.h:564
btGeneric6DofConstraintData::m_angularUpperLimit
btVector3FloatData m_angularUpperLimit
Definition: btGeneric6DofConstraint.h:563
btGeneric6DofConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btGeneric6DofConstraint.h:557
btGeneric6DofConstraintDoubleData2
Definition: btGeneric6DofConstraint.h:571
btGeneric6DofConstraintDoubleData2::m_linearUpperLimit
btVector3DoubleData m_linearUpperLimit
Definition: btGeneric6DofConstraint.h:576
btGeneric6DofConstraintDoubleData2::m_angularLowerLimit
btVector3DoubleData m_angularLowerLimit
Definition: btGeneric6DofConstraint.h:580
btGeneric6DofConstraintDoubleData2::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition: btGeneric6DofConstraint.h:583
btGeneric6DofConstraintDoubleData2::m_typeConstraintData
btTypedConstraintDoubleData m_typeConstraintData
Definition: btGeneric6DofConstraint.h:572
btGeneric6DofConstraintDoubleData2::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btGeneric6DofConstraint.h:573
btGeneric6DofConstraintDoubleData2::m_linearLowerLimit
btVector3DoubleData m_linearLowerLimit
Definition: btGeneric6DofConstraint.h:577
btGeneric6DofConstraintDoubleData2::m_angularUpperLimit
btVector3DoubleData m_angularUpperLimit
Definition: btGeneric6DofConstraint.h:579
btGeneric6DofConstraintDoubleData2::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btGeneric6DofConstraint.h:574
btGeneric6DofConstraintDoubleData2::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:582
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
btVector3DoubleData
Definition: btVector3.h:1287
btVector3FloatData
Definition: btVector3.h:1282