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

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btHingeConstraint.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
16 /* Hinge Constraint by Dirk Gregorius. Limits added by Marcus Hennix at Starbreeze Studios */
17
18 #ifndef BT_HINGECONSTRAINT_H
19 #define BT_HINGECONSTRAINT_H
20
21 #define _BT_USE_CENTER_LIMIT_ 1
22
23
24 #include "LinearMath/btVector3.h"
25 #include "btJacobianEntry.h"
26 #include "btTypedConstraint.h"
27
28 class btRigidBody;
29
30 #ifdef BT_USE_DOUBLE_PRECISION
31 #define btHingeConstraintData btHingeConstraintDoubleData2 //rename to 2 for backwards compatibility, so we can still load the 'btHingeConstraintDoubleData' version
32 #define btHingeConstraintDataName "btHingeConstraintDoubleData2"
33 #else
34 #define btHingeConstraintData btHingeConstraintFloatData
35 #define btHingeConstraintDataName "btHingeConstraintFloatData"
36 #endif //BT_USE_DOUBLE_PRECISION
37
38
39
40 enum btHingeFlags
41 {
42 BT_HINGE_FLAGS_CFM_STOP = 1,
43 BT_HINGE_FLAGS_ERP_STOP = 2,
44 BT_HINGE_FLAGS_CFM_NORM = 4,
45 BT_HINGE_FLAGS_ERP_NORM = 8
46 };
47
48
51 ATTRIBUTE_ALIGNED16(class) btHingeConstraint : public btTypedConstraint
52 {
53 #ifdef IN_PARALLELL_SOLVER
54 public:
55 #endif
56 btJacobianEntry m_jac[3]; //3 orthogonal linear constraints
57 btJacobianEntry m_jacAng[3]; //2 orthogonal angular constraints+ 1 for limit/motor
58
59 btTransform m_rbAFrame; // constraint axii. Assumes z is hinge axis.
60 btTransform m_rbBFrame;
61
62 btScalar m_motorTargetVelocity;
63 btScalar m_maxMotorImpulse;
64
65
66 #ifdef _BT_USE_CENTER_LIMIT_
67 btAngularLimit m_limit;
68 #else
69 btScalar m_lowerLimit;
70 btScalar m_upperLimit;
71 btScalar m_limitSign;
72 btScalar m_correction;
73
74 btScalar m_limitSoftness;
75 btScalar m_biasFactor;
76 btScalar m_relaxationFactor;
77
78 bool m_solveLimit;
79 #endif
80
81 btScalar m_kHinge;
82
83
84 btScalar m_accLimitImpulse;
85 btScalar m_hingeAngle;
86 btScalar m_referenceSign;
87
88 bool m_angularOnly;
89 bool m_enableAngularMotor;
90 bool m_useSolveConstraintObsolete;
91 bool m_useOffsetForConstraintFrame;
92 bool m_useReferenceFrameA;
93
94 btScalar m_accMotorImpulse;
95
96 int m_flags;
97 btScalar m_normalCFM;
98 btScalar m_normalERP;
99 btScalar m_stopCFM;
100 btScalar m_stopERP;
101
102
103 public:
104
105 BT_DECLARE_ALIGNED_ALLOCATOR();
106
107 btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA = false);
108
109 btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA = false);
110
111 btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA = false);
112
113 btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false);
114
115
116 virtual void buildJacobian();
117
118 virtual void getInfo1 (btConstraintInfo1* info);
119
120 void getInfo1NonVirtual(btConstraintInfo1* info);
121
122 virtual void getInfo2 (btConstraintInfo2* info);
123
124 void getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
125
126 void getInfo2Internal(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
127 void getInfo2InternalUsingFrameOffset(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
128
129
130 void updateRHS(btScalar timeStep);
131
132 const btRigidBody& getRigidBodyA() const
133 {
134 return m_rbA;
135 }
136 const btRigidBody& getRigidBodyB() const
137 {
138 return m_rbB;
139 }
140
141 btRigidBody& getRigidBodyA()
142 {
143 return m_rbA;
144 }
145
146 btRigidBody& getRigidBodyB()
147 {
148 return m_rbB;
149 }
150
151 btTransform& getFrameOffsetA()
152 {
153 return m_rbAFrame;
154 }
155
156 btTransform& getFrameOffsetB()
157 {
158 return m_rbBFrame;
159 }
160
161 void setFrames(const btTransform& frameA, const btTransform& frameB);
162
163 void setAngularOnly(bool angularOnly)
164 {
165 m_angularOnly = angularOnly;
166 }
167
168 void enableAngularMotor(bool enableMotor,btScalar targetVelocity,btScalar maxMotorImpulse)
169 {
170 m_enableAngularMotor = enableMotor;
171 m_motorTargetVelocity = targetVelocity;
172 m_maxMotorImpulse = maxMotorImpulse;
173 }
174
175 // extra motor API, including ability to set a target rotation (as opposed to angular velocity)
176 // note: setMotorTarget sets angular velocity under the hood, so you must call it every tick to
177 // maintain a given angular target.
178 void enableMotor(bool enableMotor) { m_enableAngularMotor = enableMotor; }
179 void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; }
180 void setMotorTarget(const btQuaternion& qAinB, btScalar dt); // qAinB is rotation of body A wrt body B.
181 void setMotorTarget(btScalar targetAngle, btScalar dt);
182
183
184 void setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
185 {
186 #ifdef _BT_USE_CENTER_LIMIT_
187 m_limit.set(low, high, _softness, _biasFactor, _relaxationFactor);
188 #else
189 m_lowerLimit = btNormalizeAngle(low);
190 m_upperLimit = btNormalizeAngle(high);
191 m_limitSoftness = _softness;
192 m_biasFactor = _biasFactor;
193 m_relaxationFactor = _relaxationFactor;
194 #endif
195 }
196
197 void setAxis(btVector3& axisInA)
198 {
199 btVector3 rbAxisA1, rbAxisA2;
200 btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
201 btVector3 pivotInA = m_rbAFrame.getOrigin();
202 // m_rbAFrame.getOrigin() = pivotInA;
203 m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
204 rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
205 rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
206
207 btVector3 axisInB = m_rbA.getCenterOfMassTransform().getBasis() * axisInA;
208
209 btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
210 btVector3 rbAxisB1 = quatRotate(rotationArc,rbAxisA1);
211 btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
212
213 m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
214
215 m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
216 rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
217 rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
218 m_rbBFrame.getBasis() = m_rbB.getCenterOfMassTransform().getBasis().inverse() * m_rbBFrame.getBasis();
219
220 }
221
222 bool hasLimit() const {
223 #ifdef _BT_USE_CENTER_LIMIT_
224 return m_limit.getHalfRange() > 0;
225 #else
226 return m_lowerLimit <= m_upperLimit;
227 #endif
228 }
229
230 btScalar getLowerLimit() const
231 {
232 #ifdef _BT_USE_CENTER_LIMIT_
233 return m_limit.getLow();
234 #else
235 return m_lowerLimit;
236 #endif
237 }
238
239 btScalar getUpperLimit() const
240 {
241 #ifdef _BT_USE_CENTER_LIMIT_
242 return m_limit.getHigh();
243 #else
244 return m_upperLimit;
245 #endif
246 }
247
248
250 btScalar getHingeAngle();
251
252 btScalar getHingeAngle(const btTransform& transA,const btTransform& transB);
253
254 void testLimit(const btTransform& transA,const btTransform& transB);
255
256
257 const btTransform& getAFrame() const { return m_rbAFrame; };
258 const btTransform& getBFrame() const { return m_rbBFrame; };
259
260 btTransform& getAFrame() { return m_rbAFrame; };
261 btTransform& getBFrame() { return m_rbBFrame; };
262
263 inline int getSolveLimit()
264 {
265 #ifdef _BT_USE_CENTER_LIMIT_
266 return m_limit.isLimit();
267 #else
268 return m_solveLimit;
269 #endif
270 }
271
272 inline btScalar getLimitSign()
273 {
274 #ifdef _BT_USE_CENTER_LIMIT_
275 return m_limit.getSign();
276 #else
277 return m_limitSign;
278 #endif
279 }
280
281 inline bool getAngularOnly()
282 {
283 return m_angularOnly;
284 }
285 inline bool getEnableAngularMotor()
286 {
287 return m_enableAngularMotor;
288 }
289 inline btScalar getMotorTargetVelosity()
290 {
291 return m_motorTargetVelocity;
292 }
293 inline btScalar getMaxMotorImpulse()
294 {
295 return m_maxMotorImpulse;
296 }
297 // access for UseFrameOffset
298 bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
299 void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
300
301
304 virtual void setParam(int num, btScalar value, int axis = -1);
306 virtual btScalar getParam(int num, int axis = -1) const;
307
308 virtual int calculateSerializeBufferSize() const;
309
311 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
312
313
314 };
315
316
317 //only for backward compatibility
318 #ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION
319 struct btHingeConstraintDoubleData
321 {
322 btTypedConstraintData m_typeConstraintData;
323 btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
324 btTransformDoubleData m_rbBFrame;
325 int m_useReferenceFrameA;
326 int m_angularOnly;
327 int m_enableAngularMotor;
328 float m_motorTargetVelocity;
329 float m_maxMotorImpulse;
330
331 float m_lowerLimit;
332 float m_upperLimit;
333 float m_limitSoftness;
334 float m_biasFactor;
335 float m_relaxationFactor;
336
337 };
338 #endif //BT_BACKWARDS_COMPATIBLE_SERIALIZATION
339
341 ATTRIBUTE_ALIGNED16(class) btHingeAccumulatedAngleConstraint : public btHingeConstraint
342 {
343 protected:
344 btScalar m_accumulatedAngle;
345 public:
346
347 BT_DECLARE_ALIGNED_ALLOCATOR();
348
349 btHingeAccumulatedAngleConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA = false)
350 :btHingeConstraint(rbA,rbB,pivotInA,pivotInB, axisInA,axisInB, useReferenceFrameA )
351 {
352 m_accumulatedAngle=getHingeAngle();
353 }
354
355 btHingeAccumulatedAngleConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA = false)
356 :btHingeConstraint(rbA,pivotInA,axisInA, useReferenceFrameA)
357 {
358 m_accumulatedAngle=getHingeAngle();
359 }
360
361 btHingeAccumulatedAngleConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA = false)
362 :btHingeConstraint(rbA,rbB, rbAFrame, rbBFrame, useReferenceFrameA )
363 {
364 m_accumulatedAngle=getHingeAngle();
365 }
366
367 btHingeAccumulatedAngleConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false)
368 :btHingeConstraint(rbA,rbAFrame, useReferenceFrameA )
369 {
370 m_accumulatedAngle=getHingeAngle();
371 }
372 btScalar getAccumulatedHingeAngle();
373 void setAccumulatedHingeAngle(btScalar accAngle);
374 virtual void getInfo1 (btConstraintInfo1* info);
375
376 };
377
378 struct btHingeConstraintFloatData
379 {
380 btTypedConstraintData m_typeConstraintData;
381 btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
382 btTransformFloatData m_rbBFrame;
383 int m_useReferenceFrameA;
384 int m_angularOnly;
385
386 int m_enableAngularMotor;
387 float m_motorTargetVelocity;
388 float m_maxMotorImpulse;
389
390 float m_lowerLimit;
391 float m_upperLimit;
392 float m_limitSoftness;
393 float m_biasFactor;
394 float m_relaxationFactor;
395
396 };
397
398
399
401 struct btHingeConstraintDoubleData2
402 {
403 btTypedConstraintDoubleData m_typeConstraintData;
404 btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
405 btTransformDoubleData m_rbBFrame;
406 int m_useReferenceFrameA;
407 int m_angularOnly;
408 int m_enableAngularMotor;
409 double m_motorTargetVelocity;
410 double m_maxMotorImpulse;
411
412 double m_lowerLimit;
413 double m_upperLimit;
414 double m_limitSoftness;
415 double m_biasFactor;
416 double m_relaxationFactor;
417 char m_padding1[4];
418
419 };
420
421
422
423
424 SIMD_FORCE_INLINE int btHingeConstraint::calculateSerializeBufferSize() const
425 {
426 return sizeof(btHingeConstraintData);
427 }
428
430 SIMD_FORCE_INLINE const char* btHingeConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
431 {
432 btHingeConstraintData* hingeData = (btHingeConstraintData*)dataBuffer;
433 btTypedConstraint::serialize(&hingeData->m_typeConstraintData,serializer);
434
435 m_rbAFrame.serialize(hingeData->m_rbAFrame);
436 m_rbBFrame.serialize(hingeData->m_rbBFrame);
437
438 hingeData->m_angularOnly = m_angularOnly;
439 hingeData->m_enableAngularMotor = m_enableAngularMotor;
440 hingeData->m_maxMotorImpulse = float(m_maxMotorImpulse);
441 hingeData->m_motorTargetVelocity = float(m_motorTargetVelocity);
442 hingeData->m_useReferenceFrameA = m_useReferenceFrameA;
443 #ifdef _BT_USE_CENTER_LIMIT_
444 hingeData->m_lowerLimit = float(m_limit.getLow());
445 hingeData->m_upperLimit = float(m_limit.getHigh());
446 hingeData->m_limitSoftness = float(m_limit.getSoftness());
447 hingeData->m_biasFactor = float(m_limit.getBiasFactor());
448 hingeData->m_relaxationFactor = float(m_limit.getRelaxationFactor());
449 #else
450 hingeData->m_lowerLimit = float(m_lowerLimit);
451 hingeData->m_upperLimit = float(m_upperLimit);
452 hingeData->m_limitSoftness = float(m_limitSoftness);
453 hingeData->m_biasFactor = float(m_biasFactor);
454 hingeData->m_relaxationFactor = float(m_relaxationFactor);
455 #endif
456
457 return btHingeConstraintDataName;
458 }
459
460 #endif //BT_HINGECONSTRAINT_H
btMatrix3x3::inverse
btMatrix3x3 inverse() const
Return the inverse of the matrix.
Definition: btMatrix3x3.h:1046
btHingeConstraint::setUseFrameOffset
void setUseFrameOffset(bool frameOffsetOnOff)
Definition: btHingeConstraint.h:299
btHingeConstraintDoubleData::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btHingeConstraint.h:324
btHingeConstraintDoubleData2::m_biasFactor
double m_biasFactor
Definition: btHingeConstraint.h:415
btHingeConstraintFloatData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btHingeConstraint.h:381
btHingeConstraint::getAFrame
const btTransform & getAFrame() const
Definition: btHingeConstraint.h:257
btAngularLimit
Definition: btTypedConstraint.h:451
btHingeConstraint::getBFrame
btTransform & getBFrame()
Definition: btHingeConstraint.h:261
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:125
btVector3.h
btHingeConstraintDoubleData2::m_motorTargetVelocity
double m_motorTargetVelocity
Definition: btHingeConstraint.h:409
btHingeConstraintFloatData::m_motorTargetVelocity
float m_motorTargetVelocity
Definition: btHingeConstraint.h:387
btHingeConstraint::m_rbAFrame
btTransform m_rbAFrame
Definition: btHingeConstraint.h:59
btAngularLimit::isLimit
bool isLimit() const
Returns true when the last test() invocation recognized limit violation.
Definition: btTypedConstraint.h:525
btHingeConstraintDoubleData::m_lowerLimit
float m_lowerLimit
Definition: btHingeConstraint.h:331
btHingeConstraint::m_useSolveConstraintObsolete
bool m_useSolveConstraintObsolete
Definition: btHingeConstraint.h:90
btHingeConstraint::m_accMotorImpulse
btScalar m_accMotorImpulse
Definition: btHingeConstraint.h:94
btPlaneSpace1
void btPlaneSpace1(const T &n, T &p, T &q)
Definition: btVector3.h:1272
btHingeConstraintDoubleData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btHingeConstraint.h:320
btHingeConstraint::getBFrame
const btTransform & getBFrame() const
Definition: btHingeConstraint.h:258
btHingeConstraintData
#define btHingeConstraintData
Definition: btHingeConstraint.h:34
btHingeConstraint::m_enableAngularMotor
bool m_enableAngularMotor
Definition: btHingeConstraint.h:89
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:63
btHingeConstraint::getLimitSign
btScalar getLimitSign()
Definition: btHingeConstraint.h:272
btHingeConstraintDoubleData2::m_typeConstraintData
btTypedConstraintDoubleData m_typeConstraintData
Definition: btHingeConstraint.h:403
btHingeConstraintFloatData::m_upperLimit
float m_upperLimit
Definition: btHingeConstraint.h:391
btHingeConstraint::getRigidBodyA
const btRigidBody & getRigidBodyA() const
Definition: btHingeConstraint.h:132
btHingeConstraint::m_motorTargetVelocity
btScalar m_motorTargetVelocity
Definition: btHingeConstraint.h:62
BT_HINGE_FLAGS_CFM_STOP
Definition: btHingeConstraint.h:42
BT_HINGE_FLAGS_ERP_NORM
Definition: btHingeConstraint.h:45
BT_HINGE_FLAGS_CFM_NORM
Definition: btHingeConstraint.h:44
btHingeConstraint::m_stopCFM
btScalar m_stopCFM
Definition: btHingeConstraint.h:99
btHingeConstraint
hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in lo...
Definition: btHingeConstraint.h:51
btHingeConstraint::getAngularOnly
bool getAngularOnly()
Definition: btHingeConstraint.h:281
btHingeConstraintDoubleData2::m_maxMotorImpulse
double m_maxMotorImpulse
Definition: btHingeConstraint.h:410
btSerializer
Definition: btSerializer.h:68
quatRotate
btVector3 quatRotate(const btQuaternion &rotation, const btVector3 &v)
Definition: btQuaternion.h:884
btHingeConstraintFloatData::m_limitSoftness
float m_limitSoftness
Definition: btHingeConstraint.h:392
btVector3::getZ
const btScalar & getZ() const
Return the z value.
Definition: btVector3.h:565
btHingeAccumulatedAngleConstraint::btHingeAccumulatedAngleConstraint
btHingeAccumulatedAngleConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
Definition: btHingeConstraint.h:361
btHingeAccumulatedAngleConstraint::m_accumulatedAngle
btScalar m_accumulatedAngle
Definition: btHingeConstraint.h:344
btTypedConstraint.h
btRigidBody::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btRigidBody.cpp:481
btHingeConstraint::getUseFrameOffset
bool getUseFrameOffset()
Definition: btHingeConstraint.h:298
btHingeConstraintDoubleData2::m_angularOnly
int m_angularOnly
Definition: btHingeConstraint.h:407
btAngularLimit::getHalfRange
btScalar getHalfRange() const
Gives half of the distance between min and max limit angle.
Definition: btTypedConstraint.h:519
btHingeConstraintFloatData::m_biasFactor
float m_biasFactor
Definition: btHingeConstraint.h:393
btAngularLimit::getHigh
btScalar getHigh() const
Definition: btTypedConstraint.cpp:219
btTransform::getOrigin
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:117
btHingeConstraint::hasLimit
bool hasLimit() const
Definition: btHingeConstraint.h:222
btHingeConstraint::m_accLimitImpulse
btScalar m_accLimitImpulse
Definition: btHingeConstraint.h:84
btHingeConstraint::getUpperLimit
btScalar getUpperLimit() const
Definition: btHingeConstraint.h:239
shortestArcQuat
btQuaternion shortestArcQuat(const btVector3 &v0, const btVector3 &v1)
Definition: btQuaternion.h:898
btHingeConstraintDoubleData::m_motorTargetVelocity
float m_motorTargetVelocity
Definition: btHingeConstraint.h:328
btAngularLimit::set
void set(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Sets all limit's parameters.
Definition: btTypedConstraint.cpp:156
btAngularLimit::getSign
btScalar getSign() const
Returns sign value evaluated when test() was invoked.
Definition: btTypedConstraint.h:513
btHingeConstraint::m_referenceSign
btScalar m_referenceSign
Definition: btHingeConstraint.h:86
btHingeConstraintDoubleData2::m_relaxationFactor
double m_relaxationFactor
Definition: btHingeConstraint.h:416
btHingeConstraintDoubleData::m_relaxationFactor
float m_relaxationFactor
Definition: btHingeConstraint.h:335
btHingeConstraint::getMaxMotorImpulse
btScalar getMaxMotorImpulse()
Definition: btHingeConstraint.h:293
btHingeConstraint::m_rbBFrame
btTransform m_rbBFrame
Definition: btHingeConstraint.h:60
btHingeConstraint::m_stopERP
btScalar m_stopERP
Definition: btHingeConstraint.h:100
btAngularLimit::getSoftness
btScalar getSoftness() const
Returns limit's softness.
Definition: btTypedConstraint.h:489
btHingeConstraint::setAxis
void setAxis(btVector3 &axisInA)
Definition: btHingeConstraint.h:197
btAngularLimit::getBiasFactor
btScalar getBiasFactor() const
Returns limit's bias factor.
Definition: btTypedConstraint.h:495
btVector3::cross
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
Definition: btVector3.h:377
btHingeConstraint::getMotorTargetVelosity
btScalar getMotorTargetVelosity()
Definition: btHingeConstraint.h:289
btVector3::getY
const btScalar & getY() const
Return the y value.
Definition: btVector3.h:563
btTypedConstraintDoubleData
Definition: btTypedConstraint.h:420
btHingeConstraintFloatData::m_relaxationFactor
float m_relaxationFactor
Definition: btHingeConstraint.h:394
btTransform::getBasis
btMatrix3x3 & getBasis()
Return the basis matrix for the rotation.
Definition: btTransform.h:112
btVector3::getX
const btScalar & getX() const
Return the x value.
Definition: btVector3.h:561
btHingeConstraint::m_hingeAngle
btScalar m_hingeAngle
Definition: btHingeConstraint.h:85
btHingeConstraintDoubleData2::m_limitSoftness
double m_limitSoftness
Definition: btHingeConstraint.h:414
btMatrix3x3::setValue
void setValue(const btScalar &xx, const btScalar &xy, const btScalar &xz, const btScalar &yx, const btScalar &yy, const btScalar &yz, const btScalar &zx, const btScalar &zy, const btScalar &zz)
Set the values of the matrix explicitly (row major)
Definition: btMatrix3x3.h:198
btHingeConstraint::m_maxMotorImpulse
btScalar m_maxMotorImpulse
Definition: btHingeConstraint.h:63
btHingeConstraint::getLowerLimit
btScalar getLowerLimit() const
Definition: btHingeConstraint.h:230
btHingeConstraint::getSolveLimit
int getSolveLimit()
Definition: btHingeConstraint.h:263
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
btHingeConstraintFloatData::m_typeConstraintData
btTypedConstraintData m_typeConstraintData
Definition: btHingeConstraint.h:380
btHingeConstraint::m_kHinge
btScalar m_kHinge
Definition: btHingeConstraint.h:81
btTypedConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btTypedConstraint.h:397
btHingeConstraintDoubleData::m_upperLimit
float m_upperLimit
Definition: btHingeConstraint.h:332
btHingeConstraint::m_flags
int m_flags
Definition: btHingeConstraint.h:96
btJacobianEntry.h
btHingeConstraint::getRigidBodyA
btRigidBody & getRigidBodyA()
Definition: btHingeConstraint.h:141
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:64
btHingeConstraint::getAFrame
btTransform & getAFrame()
Definition: btHingeConstraint.h:260
btNormalizeAngle
btScalar btNormalizeAngle(btScalar angleInRadians)
Definition: btScalar.h:724
btHingeConstraintFloatData::m_useReferenceFrameA
int m_useReferenceFrameA
Definition: btHingeConstraint.h:383
btHingeConstraint::m_useOffsetForConstraintFrame
bool m_useOffsetForConstraintFrame
Definition: btHingeConstraint.h:91
btHingeConstraintDoubleData2::m_padding1
char m_padding1[4]
Definition: btHingeConstraint.h:417
btHingeConstraint::setAngularOnly
void setAngularOnly(bool angularOnly)
Definition: btHingeConstraint.h:163
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
btHingeConstraint::m_normalCFM
btScalar m_normalCFM
Definition: btHingeConstraint.h:97
btHingeConstraint::m_useReferenceFrameA
bool m_useReferenceFrameA
Definition: btHingeConstraint.h:92
btHingeConstraintDoubleData::m_angularOnly
int m_angularOnly
Definition: btHingeConstraint.h:326
btHingeConstraint::getEnableAngularMotor
bool getEnableAngularMotor()
Definition: btHingeConstraint.h:285
btHingeConstraintDoubleData::m_biasFactor
float m_biasFactor
Definition: btHingeConstraint.h:334
btAngularLimit::getRelaxationFactor
btScalar getRelaxationFactor() const
Returns limit's relaxation factor.
Definition: btTypedConstraint.h:501
btHingeConstraintDoubleData::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btHingeConstraint.h:323
btHingeConstraint::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btHingeConstraint.h:424
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:77
btHingeConstraint::setLimit
void setLimit(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Definition: btHingeConstraint.h:184
btHingeConstraintFloatData::m_angularOnly
int m_angularOnly
Definition: btHingeConstraint.h:384
btTransformFloatData
for serialization
Definition: btTransform.h:253
btHingeConstraint::enableMotor
void enableMotor(bool enableMotor)
Definition: btHingeConstraint.h:178
btHingeConstraintFloatData::m_enableAngularMotor
int m_enableAngularMotor
Definition: btHingeConstraint.h:386
btHingeConstraintDoubleData2::m_upperLimit
double m_upperLimit
Definition: btHingeConstraint.h:413
btHingeConstraintFloatData
Definition: btHingeConstraint.h:378
BT_HINGE_FLAGS_ERP_STOP
Definition: btHingeConstraint.h:43
BT_DECLARE_ALIGNED_ALLOCATOR
#define BT_DECLARE_ALIGNED_ALLOCATOR()
Definition: btScalar.h:388
btRigidBody::serialize
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition: btRigidBody.cpp:488
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
btHingeConstraint::m_angularOnly
bool m_angularOnly
Definition: btHingeConstraint.h:88
btHingeAccumulatedAngleConstraint::btHingeAccumulatedAngleConstraint
btHingeAccumulatedAngleConstraint(btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
Definition: btHingeConstraint.h:367
btHingeConstraint::getFrameOffsetB
btTransform & getFrameOffsetB()
Definition: btHingeConstraint.h:156
btHingeConstraintFloatData::m_maxMotorImpulse
float m_maxMotorImpulse
Definition: btHingeConstraint.h:388
btHingeConstraintDoubleData2::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btHingeConstraint.h:405
btHingeConstraint::getRigidBodyB
btRigidBody & getRigidBodyB()
Definition: btHingeConstraint.h:146
btHingeConstraintDoubleData::m_enableAngularMotor
int m_enableAngularMotor
Definition: btHingeConstraint.h:327
btHingeAccumulatedAngleConstraint::btHingeAccumulatedAngleConstraint
btHingeAccumulatedAngleConstraint(btRigidBody &rbA, const btVector3 &pivotInA, const btVector3 &axisInA, bool useReferenceFrameA=false)
Definition: btHingeConstraint.h:355
btHingeConstraintDoubleData2::m_lowerLimit
double m_lowerLimit
Definition: btHingeConstraint.h:412
btHingeConstraintDataName
#define btHingeConstraintDataName
Definition: btHingeConstraint.h:35
btHingeAccumulatedAngleConstraint
The getAccumulatedHingeAngle returns the accumulated hinge angle, taking rotation across the -PI/PI b...
Definition: btHingeConstraint.h:341
btHingeConstraintDoubleData2::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btHingeConstraint.h:404
btQuaternion
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
Definition: btQuaternion.h:55
btHingeConstraintFloatData::m_lowerLimit
float m_lowerLimit
Definition: btHingeConstraint.h:390
btTransform::serialize
void serialize(struct btTransformData &dataOut) const
Definition: btTransform.h:267
btAngularLimit::getLow
btScalar getLow() const
Definition: btTypedConstraint.cpp:214
btHingeConstraint::setMaxMotorImpulse
void setMaxMotorImpulse(btScalar maxMotorImpulse)
Definition: btHingeConstraint.h:179
btHingeConstraint::getRigidBodyB
const btRigidBody & getRigidBodyB() const
Definition: btHingeConstraint.h:136
btHingeConstraintDoubleData::m_limitSoftness
float m_limitSoftness
Definition: btHingeConstraint.h:333
btHingeConstraint::m_limit
btAngularLimit m_limit
Definition: btHingeConstraint.h:67
btHingeConstraintDoubleData2::m_enableAngularMotor
int m_enableAngularMotor
Definition: btHingeConstraint.h:408
btTypedConstraint::btConstraintInfo1
Definition: btTypedConstraint.h:119
btHingeConstraintDoubleData::m_maxMotorImpulse
float m_maxMotorImpulse
Definition: btHingeConstraint.h:329
btTransformDoubleData
Definition: btTransform.h:259
btHingeConstraint::m_normalERP
btScalar m_normalERP
Definition: btHingeConstraint.h:98
btHingeConstraint::getFrameOffsetA
btTransform & getFrameOffsetA()
Definition: btHingeConstraint.h:151
btHingeFlags
btHingeFlags
Definition: btHingeConstraint.h:40
btHingeConstraint::serialize
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition: btHingeConstraint.h:430
btHingeConstraintDoubleData::m_useReferenceFrameA
int m_useReferenceFrameA
Definition: btHingeConstraint.h:325
btHingeConstraintDoubleData::m_typeConstraintData
btTypedConstraintData m_typeConstraintData
Definition: btHingeConstraint.h:322
btHingeConstraintDoubleData2
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btHingeConstraint.h:401
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:278
btHingeConstraintDoubleData2::m_useReferenceFrameA
int m_useReferenceFrameA
Definition: btHingeConstraint.h:406
btHingeConstraint::enableAngularMotor
void enableAngularMotor(bool enableMotor, btScalar targetVelocity, btScalar maxMotorImpulse)
Definition: btHingeConstraint.h:168
btHingeAccumulatedAngleConstraint::btHingeAccumulatedAngleConstraint
btHingeAccumulatedAngleConstraint(btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB, const btVector3 &axisInA, const btVector3 &axisInB, bool useReferenceFrameA=false)
Definition: btHingeConstraint.h:349
btHingeConstraintFloatData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btHingeConstraint.h:382