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

Bullet Collision Detection & Physics Library

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