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

Bullet Collision Detection & Physics Library

btGeneric6DofConstraint.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
18
19 /*
20 2007-09-09
21 btGeneric6DofConstraint Refactored by Francisco Le?n
22 email: projectileman@yahoo.com
23 http://gimpact.sf.net
24 */
25
26
27 #ifndef BT_GENERIC_6DOF_CONSTRAINT_H
28 #define BT_GENERIC_6DOF_CONSTRAINT_H
29
30 #include "LinearMath/btVector3.h"
31 #include "btJacobianEntry.h"
32 #include "btTypedConstraint.h"
33
34 class btRigidBody;
35
36
37
38 #ifdef BT_USE_DOUBLE_PRECISION
39 #define btGeneric6DofConstraintData2 btGeneric6DofConstraintDoubleData2
40 #define btGeneric6DofConstraintDataName "btGeneric6DofConstraintDoubleData2"
41 #else
42 #define btGeneric6DofConstraintData2 btGeneric6DofConstraintData
43 #define btGeneric6DofConstraintDataName "btGeneric6DofConstraintData"
44 #endif //BT_USE_DOUBLE_PRECISION
45
46
48 class btRotationalLimitMotor
49 {
50 public:
53 btScalar m_loLimit;
54 btScalar m_hiLimit;
55 btScalar m_targetVelocity;
56 btScalar m_maxMotorForce;
57 btScalar m_maxLimitForce;
58 btScalar m_damping;
59 btScalar m_limitSoftness;
60 btScalar m_normalCFM;
61 btScalar m_stopERP;
62 btScalar m_stopCFM;
63 btScalar m_bounce;
64 bool m_enableMotor;
65
67
70 btScalar m_currentLimitError;
71 btScalar m_currentPosition;
72 int m_currentLimit;
73 btScalar m_accumulatedImpulse;
75
76 btRotationalLimitMotor()
77 {
78 m_accumulatedImpulse = 0.f;
79 m_targetVelocity = 0;
80 m_maxMotorForce = 0.1f;
81 m_maxLimitForce = 300.0f;
82 m_loLimit = 1.0f;
83 m_hiLimit = -1.0f;
84 m_normalCFM = 0.f;
85 m_stopERP = 0.2f;
86 m_stopCFM = 0.f;
87 m_bounce = 0.0f;
88 m_damping = 1.0f;
89 m_limitSoftness = 0.5f;
90 m_currentLimit = 0;
91 m_currentLimitError = 0;
92 m_enableMotor = false;
93 }
94
95 btRotationalLimitMotor(const btRotationalLimitMotor & limot)
96 {
97 m_targetVelocity = limot.m_targetVelocity;
98 m_maxMotorForce = limot.m_maxMotorForce;
99 m_limitSoftness = limot.m_limitSoftness;
100 m_loLimit = limot.m_loLimit;
101 m_hiLimit = limot.m_hiLimit;
102 m_normalCFM = limot.m_normalCFM;
103 m_stopERP = limot.m_stopERP;
104 m_stopCFM = limot.m_stopCFM;
105 m_bounce = limot.m_bounce;
106 m_currentLimit = limot.m_currentLimit;
107 m_currentLimitError = limot.m_currentLimitError;
108 m_enableMotor = limot.m_enableMotor;
109 }
110
111
112
114 bool isLimited() const
115 {
116 if(m_loLimit > m_hiLimit) return false;
117 return true;
118 }
119
121 bool needApplyTorques() const
122 {
123 if(m_currentLimit == 0 && m_enableMotor == false) return false;
124 return true;
125 }
126
128
131 int testLimitValue(btScalar test_value);
132
134 btScalar solveAngularLimits(btScalar timeStep,btVector3& axis, btScalar jacDiagABInv,btRigidBody * body0, btRigidBody * body1);
135
136 };
137
138
139
140 class btTranslationalLimitMotor
141 {
142 public:
143 btVector3 m_lowerLimit;
144 btVector3 m_upperLimit;
145 btVector3 m_accumulatedImpulse;
148 btScalar m_limitSoftness;
149 btScalar m_damping;
150 btScalar m_restitution;
151 btVector3 m_normalCFM;
152 btVector3 m_stopERP;
153 btVector3 m_stopCFM;
154 bool m_enableMotor[3];
156 btVector3 m_targetVelocity;
157 btVector3 m_maxMotorForce;
158 btVector3 m_currentLimitError;
159 btVector3 m_currentLinearDiff;
160 int m_currentLimit[3];
161
162 btTranslationalLimitMotor()
163 {
164 m_lowerLimit.setValue(0.f,0.f,0.f);
165 m_upperLimit.setValue(0.f,0.f,0.f);
166 m_accumulatedImpulse.setValue(0.f,0.f,0.f);
167 m_normalCFM.setValue(0.f, 0.f, 0.f);
168 m_stopERP.setValue(0.2f, 0.2f, 0.2f);
169 m_stopCFM.setValue(0.f, 0.f, 0.f);
170
171 m_limitSoftness = 0.7f;
172 m_damping = btScalar(1.0f);
173 m_restitution = btScalar(0.5f);
174 for(int i=0; i < 3; i++)
175 {
176 m_enableMotor[i] = false;
177 m_targetVelocity[i] = btScalar(0.f);
178 m_maxMotorForce[i] = btScalar(0.f);
179 }
180 }
181
182 btTranslationalLimitMotor(const btTranslationalLimitMotor & other )
183 {
184 m_lowerLimit = other.m_lowerLimit;
185 m_upperLimit = other.m_upperLimit;
186 m_accumulatedImpulse = other.m_accumulatedImpulse;
187
188 m_limitSoftness = other.m_limitSoftness ;
189 m_damping = other.m_damping;
190 m_restitution = other.m_restitution;
191 m_normalCFM = other.m_normalCFM;
192 m_stopERP = other.m_stopERP;
193 m_stopCFM = other.m_stopCFM;
194
195 for(int i=0; i < 3; i++)
196 {
197 m_enableMotor[i] = other.m_enableMotor[i];
198 m_targetVelocity[i] = other.m_targetVelocity[i];
199 m_maxMotorForce[i] = other.m_maxMotorForce[i];
200 }
201 }
202
204
210 inline bool isLimited(int limitIndex) const
211 {
212 return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
213 }
214 inline bool needApplyForce(int limitIndex) const
215 {
216 if(m_currentLimit[limitIndex] == 0 && m_enableMotor[limitIndex] == false) return false;
217 return true;
218 }
219 int testLimitValue(int limitIndex, btScalar test_value);
220
221
222 btScalar solveLinearAxis(
223 btScalar timeStep,
224 btScalar jacDiagABInv,
225 btRigidBody& body1,const btVector3 &pointInA,
226 btRigidBody& body2,const btVector3 &pointInB,
227 int limit_index,
228 const btVector3 & axis_normal_on_a,
229 const btVector3 & anchorPos);
230
231
232 };
233
234 enum bt6DofFlags
235 {
236 BT_6DOF_FLAGS_CFM_NORM = 1,
237 BT_6DOF_FLAGS_CFM_STOP = 2,
238 BT_6DOF_FLAGS_ERP_STOP = 4
239 };
240 #define BT_6DOF_FLAGS_AXIS_SHIFT 3 // bits per axis
241
242
244
279 ATTRIBUTE_ALIGNED16(class) btGeneric6DofConstraint : public btTypedConstraint
280 {
281 protected:
282
285 btTransform m_frameInA;
286 btTransform m_frameInB;
287
291 btJacobianEntry m_jacLinear[3];
292 btJacobianEntry m_jacAng[3];
293
297 btTranslationalLimitMotor m_linearLimits;
299
300
303 btRotationalLimitMotor m_angularLimits[3];
305
306
307 protected:
310 btScalar m_timeStep;
311 btTransform m_calculatedTransformA;
312 btTransform m_calculatedTransformB;
313 btVector3 m_calculatedAxisAngleDiff;
314 btVector3 m_calculatedAxis[3];
315 btVector3 m_calculatedLinearDiff;
316 btScalar m_factA;
317 btScalar m_factB;
318 bool m_hasStaticBody;
319
320 btVector3 m_AnchorPos; // point betwen pivots of bodies A and B to solve linear axes
321
322 bool m_useLinearReferenceFrameA;
323 bool m_useOffsetForConstraintFrame;
324
325 int m_flags;
326
328
329 btGeneric6DofConstraint& operator=(btGeneric6DofConstraint& other)
330 {
331 btAssert(0);
332 (void) other;
333 return *this;
334 }
335
336
337 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);
338
339 int setLinearLimits(btConstraintInfo2 *info, int row, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
340
341 void buildLinearJacobian(
342 btJacobianEntry & jacLinear,const btVector3 & normalWorld,
343 const btVector3 & pivotAInW,const btVector3 & pivotBInW);
344
345 void buildAngularJacobian(btJacobianEntry & jacAngular,const btVector3 & jointAxisW);
346
347 // tests linear limits
348 void calculateLinearInfo();
349
351 void calculateAngleInfo();
352
353
354
355 public:
356
357 BT_DECLARE_ALIGNED_ALLOCATOR();
358
360 bool m_useSolveConstraintObsolete;
361
362 btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
363 btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
364
366
370 void calculateTransforms(const btTransform& transA,const btTransform& transB);
371
372 void calculateTransforms();
373
375
378 const btTransform & getCalculatedTransformA() const
379 {
380 return m_calculatedTransformA;
381 }
382
384
387 const btTransform & getCalculatedTransformB() const
388 {
389 return m_calculatedTransformB;
390 }
391
392 const btTransform & getFrameOffsetA() const
393 {
394 return m_frameInA;
395 }
396
397 const btTransform & getFrameOffsetB() const
398 {
399 return m_frameInB;
400 }
401
402
403 btTransform & getFrameOffsetA()
404 {
405 return m_frameInA;
406 }
407
408 btTransform & getFrameOffsetB()
409 {
410 return m_frameInB;
411 }
412
413
415 virtual void buildJacobian();
416
417 virtual void getInfo1 (btConstraintInfo1* info);
418
419 void getInfo1NonVirtual (btConstraintInfo1* info);
420
421 virtual void getInfo2 (btConstraintInfo2* info);
422
423 void getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
424
425
426 void updateRHS(btScalar timeStep);
427
429
432 btVector3 getAxis(int axis_index) const;
433
435
438 btScalar getAngle(int axis_index) const;
439
441
444 btScalar getRelativePivotPosition(int axis_index) const;
445
446 void setFrames(const btTransform & frameA, const btTransform & frameB);
447
449
453 bool testAngularLimitMotor(int axis_index);
454
455 void setLinearLowerLimit(const btVector3& linearLower)
456 {
457 m_linearLimits.m_lowerLimit = linearLower;
458 }
459
460 void getLinearLowerLimit(btVector3& linearLower) const
461 {
462 linearLower = m_linearLimits.m_lowerLimit;
463 }
464
465 void setLinearUpperLimit(const btVector3& linearUpper)
466 {
467 m_linearLimits.m_upperLimit = linearUpper;
468 }
469
470 void getLinearUpperLimit(btVector3& linearUpper) const
471 {
472 linearUpper = m_linearLimits.m_upperLimit;
473 }
474
475 void setAngularLowerLimit(const btVector3& angularLower)
476 {
477 for(int i = 0; i < 3; i++)
478 m_angularLimits[i].m_loLimit = btNormalizeAngle(angularLower[i]);
479 }
480
481 void getAngularLowerLimit(btVector3& angularLower) const
482 {
483 for(int i = 0; i < 3; i++)
484 angularLower[i] = m_angularLimits[i].m_loLimit;
485 }
486
487 void setAngularUpperLimit(const btVector3& angularUpper)
488 {
489 for(int i = 0; i < 3; i++)
490 m_angularLimits[i].m_hiLimit = btNormalizeAngle(angularUpper[i]);
491 }
492
493 void getAngularUpperLimit(btVector3& angularUpper) const
494 {
495 for(int i = 0; i < 3; i++)
496 angularUpper[i] = m_angularLimits[i].m_hiLimit;
497 }
498
500 btRotationalLimitMotor * getRotationalLimitMotor(int index)
501 {
502 return &m_angularLimits[index];
503 }
504
506 btTranslationalLimitMotor * getTranslationalLimitMotor()
507 {
508 return &m_linearLimits;
509 }
510
511 //first 3 are linear, next 3 are angular
512 void setLimit(int axis, btScalar lo, btScalar hi)
513 {
514 if(axis<3)
515 {
516 m_linearLimits.m_lowerLimit[axis] = lo;
517 m_linearLimits.m_upperLimit[axis] = hi;
518 }
519 else
520 {
521 lo = btNormalizeAngle(lo);
522 hi = btNormalizeAngle(hi);
523 m_angularLimits[axis-3].m_loLimit = lo;
524 m_angularLimits[axis-3].m_hiLimit = hi;
525 }
526 }
527
529
535 bool isLimited(int limitIndex) const
536 {
537 if(limitIndex<3)
538 {
539 return m_linearLimits.isLimited(limitIndex);
540
541 }
542 return m_angularLimits[limitIndex-3].isLimited();
543 }
544
545 virtual void calcAnchorPos(void); // overridable
546
547 int get_limit_motor_info2( btRotationalLimitMotor * limot,
548 const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB,
549 btConstraintInfo2 *info, int row, btVector3& ax1, int rotational, int rotAllowed = false);
550
551 // access for UseFrameOffset
552 bool getUseFrameOffset() const { return m_useOffsetForConstraintFrame; }
553 void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
554
555 bool getUseLinearReferenceFrameA() const { return m_useLinearReferenceFrameA; }
556 void setUseLinearReferenceFrameA(bool linearReferenceFrameA) { m_useLinearReferenceFrameA = linearReferenceFrameA; }
557
560 virtual void setParam(int num, btScalar value, int axis = -1);
562 virtual btScalar getParam(int num, int axis = -1) const;
563
564 void setAxis( const btVector3& axis1, const btVector3& axis2);
565
566 virtual int getFlags() const
567 {
568 return m_flags;
569 }
570
571 virtual int calculateSerializeBufferSize() const;
572
574 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
575
576
577 };
578
579
580 struct btGeneric6DofConstraintData
581 {
582 btTypedConstraintData m_typeConstraintData;
583 btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
584 btTransformFloatData m_rbBFrame;
585
586 btVector3FloatData m_linearUpperLimit;
587 btVector3FloatData m_linearLowerLimit;
588
589 btVector3FloatData m_angularUpperLimit;
590 btVector3FloatData m_angularLowerLimit;
591
592 int m_useLinearReferenceFrameA;
593 int m_useOffsetForConstraintFrame;
594 };
595
596 struct btGeneric6DofConstraintDoubleData2
597 {
598 btTypedConstraintDoubleData m_typeConstraintData;
599 btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
600 btTransformDoubleData m_rbBFrame;
601
602 btVector3DoubleData m_linearUpperLimit;
603 btVector3DoubleData m_linearLowerLimit;
604
605 btVector3DoubleData m_angularUpperLimit;
606 btVector3DoubleData m_angularLowerLimit;
607
608 int m_useLinearReferenceFrameA;
609 int m_useOffsetForConstraintFrame;
610 };
611
612 SIMD_FORCE_INLINE int btGeneric6DofConstraint::calculateSerializeBufferSize() const
613 {
614 return sizeof(btGeneric6DofConstraintData2);
615 }
616
618 SIMD_FORCE_INLINE const char* btGeneric6DofConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
619 {
620
621 btGeneric6DofConstraintData2* dof = (btGeneric6DofConstraintData2*)dataBuffer;
622 btTypedConstraint::serialize(&dof->m_typeConstraintData,serializer);
623
624 m_frameInA.serialize(dof->m_rbAFrame);
625 m_frameInB.serialize(dof->m_rbBFrame);
626
627
628 int i;
629 for (i=0;i<3;i++)
630 {
631 dof->m_angularLowerLimit.m_floats[i] = m_angularLimits[i].m_loLimit;
632 dof->m_angularUpperLimit.m_floats[i] = m_angularLimits[i].m_hiLimit;
633 dof->m_linearLowerLimit.m_floats[i] = m_linearLimits.m_lowerLimit[i];
634 dof->m_linearUpperLimit.m_floats[i] = m_linearLimits.m_upperLimit[i];
635 }
636
637 dof->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA? 1 : 0;
638 dof->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame ? 1 : 0;
639
640 return btGeneric6DofConstraintDataName;
641 }
642
643
644
645
646
647 #endif //BT_GENERIC_6DOF_CONSTRAINT_H
btTranslationalLimitMotor::m_damping
btScalar m_damping
Damping for linear limit.
Definition: btGeneric6DofConstraint.h:149
btGeneric6DofConstraint::getFrameOffsetB
btTransform & getFrameOffsetB()
Definition: btGeneric6DofConstraint.h:408
btRotationalLimitMotor::m_enableMotor
bool m_enableMotor
Definition: btGeneric6DofConstraint.h:64
btGeneric6DofConstraint::getAngularUpperLimit
void getAngularUpperLimit(btVector3 &angularUpper) const
Definition: btGeneric6DofConstraint.h:493
BT_6DOF_FLAGS_ERP_STOP
Definition: btGeneric6DofConstraint.h:238
btGeneric6DofConstraint::m_flags
int m_flags
Definition: btGeneric6DofConstraint.h:325
btGeneric6DofConstraint::m_timeStep
btScalar m_timeStep
temporal variables
Definition: btGeneric6DofConstraint.h:310
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:618
btVector3::setValue
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
Definition: btVector3.h:650
btGeneric6DofConstraint::m_useLinearReferenceFrameA
bool m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:322
btJacobianEntry
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
Definition: btJacobianEntry.h:30
btTypedConstraint::btConstraintInfo2
Definition: btTypedConstraint.h:126
btRotationalLimitMotor::m_currentPosition
btScalar m_currentPosition
How much is violated this limit.
Definition: btGeneric6DofConstraint.h:71
btGeneric6DofConstraint::m_AnchorPos
btVector3 m_AnchorPos
Definition: btGeneric6DofConstraint.h:320
btVector3.h
btGeneric6DofConstraint::isLimited
bool isLimited(int limitIndex) const
Test limit.
Definition: btGeneric6DofConstraint.h:535
btGeneric6DofConstraintDoubleData2
Definition: btGeneric6DofConstraint.h:596
btRotationalLimitMotor::m_loLimit
btScalar m_loLimit
limit_parameters
Definition: btGeneric6DofConstraint.h:53
btRotationalLimitMotor::btRotationalLimitMotor
btRotationalLimitMotor(const btRotationalLimitMotor &limot)
Definition: btGeneric6DofConstraint.h:95
btGeneric6DofConstraintData2
#define btGeneric6DofConstraintData2
Definition: btGeneric6DofConstraint.h:42
btGeneric6DofConstraintData::m_typeConstraintData
btTypedConstraintData m_typeConstraintData
Definition: btGeneric6DofConstraint.h:582
btGeneric6DofConstraintData
Definition: btGeneric6DofConstraint.h:580
btGeneric6DofConstraint::getTranslationalLimitMotor
btTranslationalLimitMotor * getTranslationalLimitMotor()
Retrieves the limit informacion.
Definition: btGeneric6DofConstraint.h:506
btGeneric6DofConstraint
btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis locatio...
Definition: btGeneric6DofConstraint.h:279
btRotationalLimitMotor::m_stopERP
btScalar m_stopERP
Error tolerance factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:61
btRotationalLimitMotor::isLimited
bool isLimited() const
Is limited.
Definition: btGeneric6DofConstraint.h:114
btGeneric6DofConstraint::setUseLinearReferenceFrameA
void setUseLinearReferenceFrameA(bool linearReferenceFrameA)
Definition: btGeneric6DofConstraint.h:556
btRotationalLimitMotor::m_currentLimitError
btScalar m_currentLimitError
temp_variables
Definition: btGeneric6DofConstraint.h:70
btTranslationalLimitMotor::m_targetVelocity
btVector3 m_targetVelocity
target motor velocity
Definition: btGeneric6DofConstraint.h:156
btGeneric6DofConstraint::m_calculatedTransformA
btTransform m_calculatedTransformA
Definition: btGeneric6DofConstraint.h:311
BT_6DOF_FLAGS_CFM_NORM
Definition: btGeneric6DofConstraint.h:236
btRotationalLimitMotor::m_normalCFM
btScalar m_normalCFM
Relaxation factor.
Definition: btGeneric6DofConstraint.h:60
btAssert
#define btAssert(x)
Definition: btScalar.h:114
btRotationalLimitMotor::m_stopCFM
btScalar m_stopCFM
Constraint force mixing factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:62
btGeneric6DofConstraintData::m_linearLowerLimit
btVector3FloatData m_linearLowerLimit
Definition: btGeneric6DofConstraint.h:587
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:64
btGeneric6DofConstraint::getUseLinearReferenceFrameA
bool getUseLinearReferenceFrameA() const
Definition: btGeneric6DofConstraint.h:555
btGeneric6DofConstraint::setAngularUpperLimit
void setAngularUpperLimit(const btVector3 &angularUpper)
Definition: btGeneric6DofConstraint.h:487
btTranslationalLimitMotor::m_upperLimit
btVector3 m_upperLimit
the constraint upper limits
Definition: btGeneric6DofConstraint.h:144
btGeneric6DofConstraintDoubleData2::m_linearLowerLimit
btVector3DoubleData m_linearLowerLimit
Definition: btGeneric6DofConstraint.h:603
btGeneric6DofConstraint::getAngularLowerLimit
void getAngularLowerLimit(btVector3 &angularLower) const
Definition: btGeneric6DofConstraint.h:481
btTranslationalLimitMotor::m_enableMotor
bool m_enableMotor[3]
Definition: btGeneric6DofConstraint.h:155
btTranslationalLimitMotor::m_limitSoftness
btScalar m_limitSoftness
Linear_Limit_parameters.
Definition: btGeneric6DofConstraint.h:148
btGeneric6DofConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btGeneric6DofConstraint.h:584
btSerializer
Definition: btSerializer.h:68
btGeneric6DofConstraint::getFrameOffsetA
const btTransform & getFrameOffsetA() const
Definition: btGeneric6DofConstraint.h:392
btGeneric6DofConstraintData::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition: btGeneric6DofConstraint.h:593
btGeneric6DofConstraint::m_hasStaticBody
bool m_hasStaticBody
Definition: btGeneric6DofConstraint.h:318
btGeneric6DofConstraint::getCalculatedTransformA
const btTransform & getCalculatedTransformA() const
Gets the global transform of the offset for body A.
Definition: btGeneric6DofConstraint.h:378
btGeneric6DofConstraint::m_useSolveConstraintObsolete
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to &#39;getInfo/getInfo2&#39;
Definition: btGeneric6DofConstraint.h:360
btTypedConstraint.h
btGeneric6DofConstraint::m_calculatedAxisAngleDiff
btVector3 m_calculatedAxisAngleDiff
Definition: btGeneric6DofConstraint.h:313
btGeneric6DofConstraint::m_useOffsetForConstraintFrame
bool m_useOffsetForConstraintFrame
Definition: btGeneric6DofConstraint.h:323
btGeneric6DofConstraintData::m_angularLowerLimit
btVector3FloatData m_angularLowerLimit
Definition: btGeneric6DofConstraint.h:590
btRotationalLimitMotor::m_accumulatedImpulse
btScalar m_accumulatedImpulse
Definition: btGeneric6DofConstraint.h:73
btGeneric6DofConstraint::getCalculatedTransformB
const btTransform & getCalculatedTransformB() const
Gets the global transform of the offset for body B.
Definition: btGeneric6DofConstraint.h:387
btRotationalLimitMotor::m_limitSoftness
btScalar m_limitSoftness
Definition: btGeneric6DofConstraint.h:59
btGeneric6DofConstraintData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:592
btGeneric6DofConstraintDoubleData2::m_angularLowerLimit
btVector3DoubleData m_angularLowerLimit
Definition: btGeneric6DofConstraint.h:606
btGeneric6DofConstraintData::m_linearUpperLimit
btVector3FloatData m_linearUpperLimit
Definition: btGeneric6DofConstraint.h:586
btGeneric6DofConstraint::operator=
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
Definition: btGeneric6DofConstraint.h:329
btTranslationalLimitMotor::m_normalCFM
btVector3 m_normalCFM
Bounce parameter for linear limit.
Definition: btGeneric6DofConstraint.h:151
btGeneric6DofConstraintDataName
#define btGeneric6DofConstraintDataName
Definition: btGeneric6DofConstraint.h:43
BT_6DOF_FLAGS_CFM_STOP
Definition: btGeneric6DofConstraint.h:237
btGeneric6DofConstraint::m_linearLimits
btTranslationalLimitMotor m_linearLimits
Linear_Limit_parameters.
Definition: btGeneric6DofConstraint.h:297
btTranslationalLimitMotor::m_stopCFM
btVector3 m_stopCFM
Constraint force mixing factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:153
btRotationalLimitMotor::m_targetVelocity
btScalar m_targetVelocity
target motor velocity
Definition: btGeneric6DofConstraint.h:55
btGeneric6DofConstraint::m_factA
btScalar m_factA
Definition: btGeneric6DofConstraint.h:316
bt6DofFlags
bt6DofFlags
Definition: btGeneric6DofConstraint.h:234
btTypedConstraintDoubleData
Definition: btTypedConstraint.h:416
btGeneric6DofConstraintDoubleData2::m_typeConstraintData
btTypedConstraintDoubleData m_typeConstraintData
Definition: btGeneric6DofConstraint.h:598
btGeneric6DofConstraintDoubleData2::m_angularUpperLimit
btVector3DoubleData m_angularUpperLimit
Definition: btGeneric6DofConstraint.h:605
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
btTranslationalLimitMotor::m_lowerLimit
btVector3 m_lowerLimit
the constraint lower limits
Definition: btGeneric6DofConstraint.h:143
btGeneric6DofConstraintDoubleData2::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:608
btGeneric6DofConstraint::getLinearUpperLimit
void getLinearUpperLimit(btVector3 &linearUpper) const
Definition: btGeneric6DofConstraint.h:470
btTranslationalLimitMotor::needApplyForce
bool needApplyForce(int limitIndex) const
Definition: btGeneric6DofConstraint.h:214
btGeneric6DofConstraint::m_calculatedTransformB
btTransform m_calculatedTransformB
Definition: btGeneric6DofConstraint.h:312
btGeneric6DofConstraint::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btGeneric6DofConstraint.h:612
btTypedConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btTypedConstraint.h:393
btGeneric6DofConstraintDoubleData2::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btGeneric6DofConstraint.h:599
btGeneric6DofConstraint::getFrameOffsetA
btTransform & getFrameOffsetA()
Definition: btGeneric6DofConstraint.h:403
btJacobianEntry.h
btGeneric6DofConstraint::m_calculatedLinearDiff
btVector3 m_calculatedLinearDiff
Definition: btGeneric6DofConstraint.h:315
btTranslationalLimitMotor::m_currentLimitError
btVector3 m_currentLimitError
Definition: btGeneric6DofConstraint.h:158
btRotationalLimitMotor::m_currentLimit
int m_currentLimit
current value of angle
Definition: btGeneric6DofConstraint.h:72
btTranslationalLimitMotor::btTranslationalLimitMotor
btTranslationalLimitMotor(const btTranslationalLimitMotor &other)
Definition: btGeneric6DofConstraint.h:182
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:65
btGeneric6DofConstraint::m_frameInA
btTransform m_frameInA
relative_frames
Definition: btGeneric6DofConstraint.h:285
btNormalizeAngle
btScalar btNormalizeAngle(btScalar angleInRadians)
Definition: btScalar.h:725
btRotationalLimitMotor::m_damping
btScalar m_damping
Damping.
Definition: btGeneric6DofConstraint.h:58
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
btRotationalLimitMotor::needApplyTorques
bool needApplyTorques() const
Need apply correction.
Definition: btGeneric6DofConstraint.h:121
btRotationalLimitMotor::m_hiLimit
btScalar m_hiLimit
joint limit
Definition: btGeneric6DofConstraint.h:54
btGeneric6DofConstraint::getFrameOffsetB
const btTransform & getFrameOffsetB() const
Definition: btGeneric6DofConstraint.h:397
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:110
btRotationalLimitMotor::testLimitValue
int testLimitValue(btScalar test_value)
calculates error
Definition: btGeneric6DofConstraint.cpp:122
btGeneric6DofConstraint::m_frameInB
btTransform m_frameInB
the constraint space w.r.t body B
Definition: btGeneric6DofConstraint.h:286
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:78
btGeneric6DofConstraintDoubleData2::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition: btGeneric6DofConstraint.h:609
btTransformFloatData
for serialization
Definition: btTransform.h:253
btGeneric6DofConstraint::getUseFrameOffset
bool getUseFrameOffset() const
Definition: btGeneric6DofConstraint.h:552
btGeneric6DofConstraint::getRotationalLimitMotor
btRotationalLimitMotor * getRotationalLimitMotor(int index)
Retrieves the angular limit informacion.
Definition: btGeneric6DofConstraint.h:500
btRotationalLimitMotor::solveAngularLimits
btScalar solveAngularLimits(btScalar timeStep, btVector3 &axis, btScalar jacDiagABInv, btRigidBody *body0, btRigidBody *body1)
apply the correction impulses for two bodies
Definition: btGeneric6DofConstraint.cpp:157
BT_DECLARE_ALIGNED_ALLOCATOR
#define BT_DECLARE_ALIGNED_ALLOCATOR()
Definition: btScalar.h:389
btGeneric6DofConstraint::getFlags
virtual int getFlags() const
Definition: btGeneric6DofConstraint.h:566
btGeneric6DofConstraint::setLinearLowerLimit
void setLinearLowerLimit(const btVector3 &linearLower)
Definition: btGeneric6DofConstraint.h:455
btGeneric6DofConstraintDoubleData2::m_linearUpperLimit
btVector3DoubleData m_linearUpperLimit
Definition: btGeneric6DofConstraint.h:602
btTranslationalLimitMotor::m_maxMotorForce
btVector3 m_maxMotorForce
max force on motor
Definition: btGeneric6DofConstraint.h:157
btRotationalLimitMotor::m_maxMotorForce
btScalar m_maxMotorForce
max force on motor
Definition: btGeneric6DofConstraint.h:56
btRotationalLimitMotor::m_maxLimitForce
btScalar m_maxLimitForce
max force on limit
Definition: btGeneric6DofConstraint.h:57
btGeneric6DofConstraint::setLimit
void setLimit(int axis, btScalar lo, btScalar hi)
Definition: btGeneric6DofConstraint.h:512
btTranslationalLimitMotor::m_currentLinearDiff
btVector3 m_currentLinearDiff
How much is violated this limit.
Definition: btGeneric6DofConstraint.h:159
btVector3FloatData
Definition: btVector3.h:1311
btRotationalLimitMotor::m_bounce
btScalar m_bounce
restitution factor
Definition: btGeneric6DofConstraint.h:63
btTranslationalLimitMotor::m_stopERP
btVector3 m_stopERP
Error tolerance factor when joint is at limit.
Definition: btGeneric6DofConstraint.h:152
btRotationalLimitMotor
Rotation Limit structure for generic joints.
Definition: btGeneric6DofConstraint.h:48
btRotationalLimitMotor::btRotationalLimitMotor
btRotationalLimitMotor()
Definition: btGeneric6DofConstraint.h:76
btGeneric6DofConstraint::getLinearLowerLimit
void getLinearLowerLimit(btVector3 &linearLower) const
Definition: btGeneric6DofConstraint.h:460
btGeneric6DofConstraint::setLinearUpperLimit
void setLinearUpperLimit(const btVector3 &linearUpper)
Definition: btGeneric6DofConstraint.h:465
btTranslationalLimitMotor::isLimited
bool isLimited(int limitIndex) const
Test limit.
Definition: btGeneric6DofConstraint.h:210
btGeneric6DofConstraintData::m_angularUpperLimit
btVector3FloatData m_angularUpperLimit
Definition: btGeneric6DofConstraint.h:589
btTypedConstraint::btConstraintInfo1
Definition: btTypedConstraint.h:120
btGeneric6DofConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btGeneric6DofConstraint.h:583
btTranslationalLimitMotor
Definition: btGeneric6DofConstraint.h:140
btTransformDoubleData
Definition: btTransform.h:259
btGeneric6DofConstraint::m_factB
btScalar m_factB
Definition: btGeneric6DofConstraint.h:317
btGeneric6DofConstraint::setAngularLowerLimit
void setAngularLowerLimit(const btVector3 &angularLower)
Definition: btGeneric6DofConstraint.h:475
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:279
btVector3DoubleData
Definition: btVector3.h:1316
btTranslationalLimitMotor::btTranslationalLimitMotor
btTranslationalLimitMotor()
Definition: btGeneric6DofConstraint.h:162
btGeneric6DofConstraint::setUseFrameOffset
void setUseFrameOffset(bool frameOffsetOnOff)
Definition: btGeneric6DofConstraint.h:553
btTranslationalLimitMotor::m_restitution
btScalar m_restitution
Definition: btGeneric6DofConstraint.h:150
btTranslationalLimitMotor::m_accumulatedImpulse
btVector3 m_accumulatedImpulse
Definition: btGeneric6DofConstraint.h:145
btGeneric6DofConstraintDoubleData2::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btGeneric6DofConstraint.h:600