Bullet Collision Detection & Physics Library
btWorldImporter.cpp
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2012 Erwin Coumans http://bulletphysics.org
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 #include "btWorldImporter.h"
17 #include "btBulletDynamicsCommon.h"
18 #ifdef USE_GIMPACT
20 #endif
22  : m_dynamicsWorld(world),
23  m_verboseMode(0),
24  m_importerFlags(0)
25 {
26 }
27 
29 {
30 }
31 
33 {
34  int i;
35  for (i = 0; i < m_allocatedConstraints.size(); i++)
36  {
37  if (m_dynamicsWorld)
39  delete m_allocatedConstraints[i];
40  }
42 
43  for (i = 0; i < m_allocatedRigidBodies.size(); i++)
44  {
45  if (m_dynamicsWorld)
47  delete m_allocatedRigidBodies[i];
48  }
49 
51 
52  for (i = 0; i < m_allocatedCollisionShapes.size(); i++)
53  {
55  }
57 
58  for (i = 0; i < m_allocatedBvhs.size(); i++)
59  {
60  delete m_allocatedBvhs[i];
61  }
63 
64  for (i = 0; i < m_allocatedTriangleInfoMaps.size(); i++)
65  {
67  }
69  for (i = 0; i < m_allocatedTriangleIndexArrays.size(); i++)
70  {
72  }
74  for (i = 0; i < m_allocatedNames.size(); i++)
75  {
76  delete[] m_allocatedNames[i];
77  }
79 
80  for (i = 0; i < m_allocatedbtStridingMeshInterfaceDatas.size(); i++)
81  {
83 
84  for (int a = 0; a < curData->m_numMeshParts; a++)
85  {
86  btMeshPartData* curPart = &curData->m_meshPartsPtr[a];
87  if (curPart->m_vertices3f)
88  delete[] curPart->m_vertices3f;
89 
90  if (curPart->m_vertices3d)
91  delete[] curPart->m_vertices3d;
92 
93  if (curPart->m_indices32)
94  delete[] curPart->m_indices32;
95 
96  if (curPart->m_3indices16)
97  delete[] curPart->m_3indices16;
98 
99  if (curPart->m_indices16)
100  delete[] curPart->m_indices16;
101 
102  if (curPart->m_3indices8)
103  delete[] curPart->m_3indices8;
104  }
105  delete[] curData->m_meshPartsPtr;
106  delete curData;
107  }
109 
110  for (i = 0; i < m_indexArrays.size(); i++)
111  {
113  }
115 
116  for (i = 0; i < m_shortIndexArrays.size(); i++)
117  {
119  }
121 
122  for (i = 0; i < m_charIndexArrays.size(); i++)
123  {
125  }
127 
128  for (i = 0; i < m_floatVertexArrays.size(); i++)
129  {
131  }
133 
134  for (i = 0; i < m_doubleVertexArrays.size(); i++)
135  {
137  }
139 }
140 
142 {
143  btCollisionShape* shape = 0;
144 
145  switch (shapeData->m_shapeType)
146  {
148  {
149  btStaticPlaneShapeData* planeData = (btStaticPlaneShapeData*)shapeData;
150  btVector3 planeNormal, localScaling;
151  planeNormal.deSerializeFloat(planeData->m_planeNormal);
152  localScaling.deSerializeFloat(planeData->m_localScaling);
153  shape = createPlaneShape(planeNormal, planeData->m_planeConstant);
154  shape->setLocalScaling(localScaling);
155 
156  break;
157  }
159  {
161  btCollisionShapeData* colShapeData = (btCollisionShapeData*)&scaledMesh->m_trimeshShapeData;
163  btCollisionShape* childShape = convertCollisionShape(colShapeData);
164  btBvhTriangleMeshShape* meshShape = (btBvhTriangleMeshShape*)childShape;
165  btVector3 localScaling;
166  localScaling.deSerializeFloat(scaledMesh->m_localScaling);
167 
168  shape = createScaledTrangleMeshShape(meshShape, localScaling);
169  break;
170  }
172  {
173 #ifdef USE_GIMPACT
174  btGImpactMeshShapeData* gimpactData = (btGImpactMeshShapeData*)shapeData;
175  if (gimpactData->m_gimpactSubType == CONST_GIMPACT_TRIMESH_SHAPE)
176  {
178  btTriangleIndexVertexArray* meshInterface = createMeshInterface(*interfaceData);
179 
180  btGImpactMeshShape* gimpactShape = createGimpactShape(meshInterface);
181  btVector3 localScaling;
182  localScaling.deSerializeFloat(gimpactData->m_localScaling);
183  gimpactShape->setLocalScaling(localScaling);
184  gimpactShape->setMargin(btScalar(gimpactData->m_collisionMargin));
185  gimpactShape->updateBound();
186  shape = gimpactShape;
187  }
188  else
189  {
190  printf("unsupported gimpact sub type\n");
191  }
192 #endif //USE_GIMPACT
193  break;
194  }
195  //The btCapsuleShape* API has issue passing the margin/scaling/halfextents unmodified through the API
196  //so deal with this
198  {
199  btCapsuleShapeData* capData = (btCapsuleShapeData*)shapeData;
200 
201  switch (capData->m_upAxis)
202  {
203  case 0:
204  {
205  shape = createCapsuleShapeX(1, 1);
206  break;
207  }
208  case 1:
209  {
210  shape = createCapsuleShapeY(1, 1);
211  break;
212  }
213  case 2:
214  {
215  shape = createCapsuleShapeZ(1, 1);
216  break;
217  }
218  default:
219  {
220  printf("error: wrong up axis for btCapsuleShape\n");
221  }
222  };
223  if (shape)
224  {
225  btCapsuleShape* cap = (btCapsuleShape*)shape;
226  cap->deSerializeFloat(capData);
227  }
228  break;
229  }
232  case BOX_SHAPE_PROXYTYPE:
236  {
238  btVector3 implicitShapeDimensions;
239  implicitShapeDimensions.deSerializeFloat(bsd->m_implicitShapeDimensions);
240  btVector3 localScaling;
241  localScaling.deSerializeFloat(bsd->m_localScaling);
243  switch (shapeData->m_shapeType)
244  {
245  case BOX_SHAPE_PROXYTYPE:
246  {
247  btBoxShape* box = (btBoxShape*)createBoxShape(implicitShapeDimensions / localScaling + margin);
248  //box->initializePolyhedralFeatures();
249  shape = box;
250 
251  break;
252  }
254  {
255  shape = createSphereShape(implicitShapeDimensions.getX());
256  break;
257  }
258 
260  {
261  btCylinderShapeData* cylData = (btCylinderShapeData*)shapeData;
262  btVector3 halfExtents = implicitShapeDimensions + margin;
263  switch (cylData->m_upAxis)
264  {
265  case 0:
266  {
267  shape = createCylinderShapeX(halfExtents.getY(), halfExtents.getX());
268  break;
269  }
270  case 1:
271  {
272  shape = createCylinderShapeY(halfExtents.getX(), halfExtents.getY());
273  break;
274  }
275  case 2:
276  {
277  shape = createCylinderShapeZ(halfExtents.getX(), halfExtents.getZ());
278  break;
279  }
280  default:
281  {
282  printf("unknown Cylinder up axis\n");
283  }
284  };
285 
286  break;
287  }
289  {
290  btConeShapeData* conData = (btConeShapeData*)shapeData;
291  btVector3 halfExtents = implicitShapeDimensions; //+margin;
292  switch (conData->m_upIndex)
293  {
294  case 0:
295  {
296  shape = createConeShapeX(halfExtents.getY(), halfExtents.getX());
297  break;
298  }
299  case 1:
300  {
301  shape = createConeShapeY(halfExtents.getX(), halfExtents.getY());
302  break;
303  }
304  case 2:
305  {
306  shape = createConeShapeZ(halfExtents.getX(), halfExtents.getZ());
307  break;
308  }
309  default:
310  {
311  printf("unknown Cone up axis\n");
312  }
313  };
314 
315  break;
316  }
318  {
320  int numSpheres = mss->m_localPositionArraySize;
321 
324  radii.resize(numSpheres);
325  tmpPos.resize(numSpheres);
326  int i;
327  for (i = 0; i < numSpheres; i++)
328  {
329  tmpPos[i].deSerializeFloat(mss->m_localPositionArrayPtr[i].m_pos);
330  radii[i] = mss->m_localPositionArrayPtr[i].m_radius;
331  }
332  shape = createMultiSphereShape(&tmpPos[0], &radii[0], numSpheres);
333  break;
334  }
336  {
337  // int sz = sizeof(btConvexHullShapeData);
338  // int sz2 = sizeof(btConvexInternalShapeData);
339  // int sz3 = sizeof(btCollisionShapeData);
340  btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd;
341  int numPoints = convexData->m_numUnscaledPoints;
342 
344  tmpPoints.resize(numPoints);
345  int i;
346  for (i = 0; i < numPoints; i++)
347  {
348 #ifdef BT_USE_DOUBLE_PRECISION
349  if (convexData->m_unscaledPointsDoublePtr)
350  tmpPoints[i].deSerialize(convexData->m_unscaledPointsDoublePtr[i]);
351  if (convexData->m_unscaledPointsFloatPtr)
352  tmpPoints[i].deSerializeFloat(convexData->m_unscaledPointsFloatPtr[i]);
353 #else
354  if (convexData->m_unscaledPointsFloatPtr)
355  tmpPoints[i].deSerialize(convexData->m_unscaledPointsFloatPtr[i]);
356  if (convexData->m_unscaledPointsDoublePtr)
357  tmpPoints[i].deSerializeDouble(convexData->m_unscaledPointsDoublePtr[i]);
358 #endif //BT_USE_DOUBLE_PRECISION
359  }
361  for (i = 0; i < numPoints; i++)
362  {
363  hullShape->addPoint(tmpPoints[i]);
364  }
365  hullShape->setMargin(bsd->m_collisionMargin);
366  //hullShape->initializePolyhedralFeatures();
367  shape = hullShape;
368  break;
369  }
370  default:
371  {
372  printf("error: cannot create shape type (%d)\n", shapeData->m_shapeType);
373  }
374  }
375 
376  if (shape)
377  {
378  shape->setMargin(bsd->m_collisionMargin);
379 
380  btVector3 localScaling;
381  localScaling.deSerializeFloat(bsd->m_localScaling);
382  shape->setLocalScaling(localScaling);
383  }
384  break;
385  }
387  {
388  btTriangleMeshShapeData* trimesh = (btTriangleMeshShapeData*)shapeData;
390  btTriangleIndexVertexArray* meshInterface = createMeshInterface(*interfaceData);
391  if (!meshInterface->getNumSubParts())
392  {
393  return 0;
394  }
395 
396  btVector3 scaling;
397  scaling.deSerializeFloat(trimesh->m_meshInterface.m_scaling);
398  meshInterface->setScaling(scaling);
399 
400  btOptimizedBvh* bvh = 0;
401 #if 1
402  if (trimesh->m_quantizedFloatBvh)
403  {
404  btOptimizedBvh** bvhPtr = m_bvhMap.find(trimesh->m_quantizedFloatBvh);
405  if (bvhPtr && *bvhPtr)
406  {
407  bvh = *bvhPtr;
408  }
409  else
410  {
411  bvh = createOptimizedBvh();
412  bvh->deSerializeFloat(*trimesh->m_quantizedFloatBvh);
413  }
414  }
415  if (trimesh->m_quantizedDoubleBvh)
416  {
417  btOptimizedBvh** bvhPtr = m_bvhMap.find(trimesh->m_quantizedDoubleBvh);
418  if (bvhPtr && *bvhPtr)
419  {
420  bvh = *bvhPtr;
421  }
422  else
423  {
424  bvh = createOptimizedBvh();
425  bvh->deSerializeDouble(*trimesh->m_quantizedDoubleBvh);
426  }
427  }
428 #endif
429 
430  btBvhTriangleMeshShape* trimeshShape = createBvhTriangleMeshShape(meshInterface, bvh);
431  trimeshShape->setMargin(trimesh->m_collisionMargin);
432  shape = trimeshShape;
433 
434  if (trimesh->m_triangleInfoMap)
435  {
437  map->deSerialize(*trimesh->m_triangleInfoMap);
438  trimeshShape->setTriangleInfoMap(map);
439 
440 #ifdef USE_INTERNAL_EDGE_UTILITY
441  gContactAddedCallback = btAdjustInternalEdgeContactsCallback;
442 #endif //USE_INTERNAL_EDGE_UTILITY
443  }
444 
445  //printf("trimesh->m_collisionMargin=%f\n",trimesh->m_collisionMargin);
446  break;
447  }
449  {
450  btCompoundShapeData* compoundData = (btCompoundShapeData*)shapeData;
451  btCompoundShape* compoundShape = createCompoundShape();
452 
454  for (int i = 0; i < compoundData->m_numChildShapes; i++)
455  {
456  btCollisionShapeData* cd = compoundData->m_childShapePtr[i].m_childShape;
457 
458  btCollisionShape* childShape = convertCollisionShape(cd);
459  if (childShape)
460  {
461  btTransform localTransform;
462  localTransform.deSerializeFloat(compoundData->m_childShapePtr[i].m_transform);
463  compoundShape->addChildShape(localTransform, childShape);
464  }
465  else
466  {
467 #ifdef _DEBUG
468  printf("error: couldn't create childShape for compoundShape\n");
469 #endif
470  }
471  }
472  shape = compoundShape;
473 
474  break;
475  }
477  {
478  return 0;
479  }
480  default:
481  {
482 #ifdef _DEBUG
483  printf("unsupported shape type (%d)\n", shapeData->m_shapeType);
484 #endif
485  }
486  }
487 
488  return shape;
489 }
490 
491 char* btWorldImporter::duplicateName(const char* name)
492 {
493  if (name)
494  {
495  int l = (int)strlen(name);
496  char* newName = new char[l + 1];
497  memcpy(newName, name, l);
498  newName[l] = 0;
499  m_allocatedNames.push_back(newName);
500  return newName;
501  }
502  return 0;
503 }
504 
506 {
507  btTypedConstraint* constraint = 0;
508 
509  switch (constraintData->m_objectType)
510  {
512  {
514  if (rbA && rbB)
515  {
516  btVector3 pivotInA, pivotInB;
517  pivotInA.deSerializeDouble(p2pData->m_pivotInA);
518  pivotInB.deSerializeDouble(p2pData->m_pivotInB);
519  constraint = createPoint2PointConstraint(*rbA, *rbB, pivotInA, pivotInB);
520  }
521  else
522  {
523  btVector3 pivotInA;
524  pivotInA.deSerializeDouble(p2pData->m_pivotInA);
525  constraint = createPoint2PointConstraint(*rbA, pivotInA);
526  }
527  break;
528  }
530  {
531  btHingeConstraint* hinge = 0;
532 
533  btHingeConstraintDoubleData* hingeData = (btHingeConstraintDoubleData*)constraintData;
534  if (rbA && rbB)
535  {
536  btTransform rbAFrame, rbBFrame;
537  rbAFrame.deSerializeDouble(hingeData->m_rbAFrame);
538  rbBFrame.deSerializeDouble(hingeData->m_rbBFrame);
539  hinge = createHingeConstraint(*rbA, *rbB, rbAFrame, rbBFrame, hingeData->m_useReferenceFrameA != 0);
540  }
541  else
542  {
543  btTransform rbAFrame;
544  rbAFrame.deSerializeDouble(hingeData->m_rbAFrame);
545  hinge = createHingeConstraint(*rbA, rbAFrame, hingeData->m_useReferenceFrameA != 0);
546  }
547  if (hingeData->m_enableAngularMotor)
548  {
549  hinge->enableAngularMotor(true, (btScalar)hingeData->m_motorTargetVelocity, (btScalar)hingeData->m_maxMotorImpulse);
550  }
551  hinge->setAngularOnly(hingeData->m_angularOnly != 0);
552  hinge->setLimit(btScalar(hingeData->m_lowerLimit), btScalar(hingeData->m_upperLimit), btScalar(hingeData->m_limitSoftness), btScalar(hingeData->m_biasFactor), btScalar(hingeData->m_relaxationFactor));
553 
554  constraint = hinge;
555  break;
556  }
558  {
559  btConeTwistConstraintData* coneData = (btConeTwistConstraintData*)constraintData;
560  btConeTwistConstraint* coneTwist = 0;
561 
562  if (rbA && rbB)
563  {
564  btTransform rbAFrame, rbBFrame;
565  rbAFrame.deSerializeFloat(coneData->m_rbAFrame);
566  rbBFrame.deSerializeFloat(coneData->m_rbBFrame);
567  coneTwist = createConeTwistConstraint(*rbA, *rbB, rbAFrame, rbBFrame);
568  }
569  else
570  {
571  btTransform rbAFrame;
572  rbAFrame.deSerializeFloat(coneData->m_rbAFrame);
573  coneTwist = createConeTwistConstraint(*rbA, rbAFrame);
574  }
575  coneTwist->setLimit((btScalar)coneData->m_swingSpan1, (btScalar)coneData->m_swingSpan2, (btScalar)coneData->m_twistSpan, (btScalar)coneData->m_limitSoftness,
576  (btScalar)coneData->m_biasFactor, (btScalar)coneData->m_relaxationFactor);
577  coneTwist->setDamping((btScalar)coneData->m_damping);
578 
579  constraint = coneTwist;
580  break;
581  }
582 
584  {
586  // int sz = sizeof(btGeneric6DofSpringConstraintData);
588 
589  if (rbA && rbB)
590  {
591  btTransform rbAFrame, rbBFrame;
592  rbAFrame.deSerializeFloat(dofData->m_6dofData.m_rbAFrame);
593  rbBFrame.deSerializeFloat(dofData->m_6dofData.m_rbBFrame);
594  dof = createGeneric6DofSpringConstraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_6dofData.m_useLinearReferenceFrameA != 0);
595  }
596  else
597  {
598  printf("Error in btWorldImporter::createGeneric6DofSpringConstraint: requires rbA && rbB\n");
599  }
600 
601  if (dof)
602  {
603  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
604  angLowerLimit.deSerializeFloat(dofData->m_6dofData.m_angularLowerLimit);
605  angUpperLimit.deSerializeFloat(dofData->m_6dofData.m_angularUpperLimit);
606  linLowerLimit.deSerializeFloat(dofData->m_6dofData.m_linearLowerLimit);
607  linUpperlimit.deSerializeFloat(dofData->m_6dofData.m_linearUpperLimit);
608 
609  angLowerLimit.setW(0.f);
610  dof->setAngularLowerLimit(angLowerLimit);
611  dof->setAngularUpperLimit(angUpperLimit);
612  dof->setLinearLowerLimit(linLowerLimit);
613  dof->setLinearUpperLimit(linUpperlimit);
614 
615  int i;
616  if (fileVersion > 280)
617  {
618  for (i = 0; i < 6; i++)
619  {
620  dof->setStiffness(i, (btScalar)dofData->m_springStiffness[i]);
621  dof->setEquilibriumPoint(i, (btScalar)dofData->m_equilibriumPoint[i]);
622  dof->enableSpring(i, dofData->m_springEnabled[i] != 0);
623  dof->setDamping(i, (btScalar)dofData->m_springDamping[i]);
624  }
625  }
626  }
627 
628  constraint = dof;
629  break;
630  }
631  case D6_CONSTRAINT_TYPE:
632  {
633  btGeneric6DofConstraintData* dofData = (btGeneric6DofConstraintData*)constraintData;
634  btGeneric6DofConstraint* dof = 0;
635 
636  if (rbA && rbB)
637  {
638  btTransform rbAFrame, rbBFrame;
639  rbAFrame.deSerializeFloat(dofData->m_rbAFrame);
640  rbBFrame.deSerializeFloat(dofData->m_rbBFrame);
641  dof = createGeneric6DofConstraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_useLinearReferenceFrameA != 0);
642  }
643  else
644  {
645  if (rbB)
646  {
647  btTransform rbBFrame;
648  rbBFrame.deSerializeFloat(dofData->m_rbBFrame);
649  dof = createGeneric6DofConstraint(*rbB, rbBFrame, dofData->m_useLinearReferenceFrameA != 0);
650  }
651  else
652  {
653  printf("Error in btWorldImporter::createGeneric6DofConstraint: missing rbB\n");
654  }
655  }
656 
657  if (dof)
658  {
659  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
660  angLowerLimit.deSerializeFloat(dofData->m_angularLowerLimit);
661  angUpperLimit.deSerializeFloat(dofData->m_angularUpperLimit);
662  linLowerLimit.deSerializeFloat(dofData->m_linearLowerLimit);
663  linUpperlimit.deSerializeFloat(dofData->m_linearUpperLimit);
664 
665  dof->setAngularLowerLimit(angLowerLimit);
666  dof->setAngularUpperLimit(angUpperLimit);
667  dof->setLinearLowerLimit(linLowerLimit);
668  dof->setLinearUpperLimit(linUpperlimit);
669  }
670 
671  constraint = dof;
672  break;
673  }
675  {
676  btSliderConstraintData* sliderData = (btSliderConstraintData*)constraintData;
677  btSliderConstraint* slider = 0;
678  if (rbA && rbB)
679  {
680  btTransform rbAFrame, rbBFrame;
681  rbAFrame.deSerializeFloat(sliderData->m_rbAFrame);
682  rbBFrame.deSerializeFloat(sliderData->m_rbBFrame);
683  slider = createSliderConstraint(*rbA, *rbB, rbAFrame, rbBFrame, sliderData->m_useLinearReferenceFrameA != 0);
684  }
685  else
686  {
687  btTransform rbBFrame;
688  rbBFrame.deSerializeFloat(sliderData->m_rbBFrame);
689  slider = createSliderConstraint(*rbB, rbBFrame, sliderData->m_useLinearReferenceFrameA != 0);
690  }
691  slider->setLowerLinLimit((btScalar)sliderData->m_linearLowerLimit);
692  slider->setUpperLinLimit((btScalar)sliderData->m_linearUpperLimit);
693  slider->setLowerAngLimit((btScalar)sliderData->m_angularLowerLimit);
694  slider->setUpperAngLimit((btScalar)sliderData->m_angularUpperLimit);
695  slider->setUseFrameOffset(sliderData->m_useOffsetForConstraintFrame != 0);
696  constraint = slider;
697  break;
698  }
699 
700  default:
701  {
702  printf("unknown constraint type\n");
703  }
704  };
705 
706  if (constraint)
707  {
708  constraint->setDbgDrawSize((btScalar)constraintData->m_dbgDrawSize);
710  if (fileVersion >= 280)
711  {
713  constraint->setEnabled(constraintData->m_isEnabled != 0);
715  }
716 
717  if (constraintData->m_name)
718  {
719  char* newname = duplicateName(constraintData->m_name);
720  m_nameConstraintMap.insert(newname, constraint);
721  m_objectNameMap.insert(constraint, newname);
722  }
723  if (m_dynamicsWorld)
724  m_dynamicsWorld->addConstraint(constraint, constraintData->m_disableCollisionsBetweenLinkedBodies != 0);
725  }
726 }
727 
729 {
730  btTypedConstraint* constraint = 0;
731 
732  switch (constraintData->m_objectType)
733  {
735  {
737  if (rbA && rbB)
738  {
739  btVector3 pivotInA, pivotInB;
740  pivotInA.deSerializeFloat(p2pData->m_pivotInA);
741  pivotInB.deSerializeFloat(p2pData->m_pivotInB);
742  constraint = createPoint2PointConstraint(*rbA, *rbB, pivotInA, pivotInB);
743  }
744  else
745  {
746  btVector3 pivotInA;
747  pivotInA.deSerializeFloat(p2pData->m_pivotInA);
748  constraint = createPoint2PointConstraint(*rbA, pivotInA);
749  }
750  break;
751  }
753  {
754  btHingeConstraint* hinge = 0;
755  btHingeConstraintFloatData* hingeData = (btHingeConstraintFloatData*)constraintData;
756  if (rbA && rbB)
757  {
758  btTransform rbAFrame, rbBFrame;
759  rbAFrame.deSerializeFloat(hingeData->m_rbAFrame);
760  rbBFrame.deSerializeFloat(hingeData->m_rbBFrame);
761  hinge = createHingeConstraint(*rbA, *rbB, rbAFrame, rbBFrame, hingeData->m_useReferenceFrameA != 0);
762  }
763  else
764  {
765  btTransform rbAFrame;
766  rbAFrame.deSerializeFloat(hingeData->m_rbAFrame);
767  hinge = createHingeConstraint(*rbA, rbAFrame, hingeData->m_useReferenceFrameA != 0);
768  }
769  if (hingeData->m_enableAngularMotor)
770  {
771  hinge->enableAngularMotor(true, hingeData->m_motorTargetVelocity, hingeData->m_maxMotorImpulse);
772  }
773  hinge->setAngularOnly(hingeData->m_angularOnly != 0);
774  hinge->setLimit(btScalar(hingeData->m_lowerLimit), btScalar(hingeData->m_upperLimit), btScalar(hingeData->m_limitSoftness), btScalar(hingeData->m_biasFactor), btScalar(hingeData->m_relaxationFactor));
775 
776  constraint = hinge;
777  break;
778  }
780  {
781  btConeTwistConstraintData* coneData = (btConeTwistConstraintData*)constraintData;
782  btConeTwistConstraint* coneTwist = 0;
783 
784  if (rbA && rbB)
785  {
786  btTransform rbAFrame, rbBFrame;
787  rbAFrame.deSerializeFloat(coneData->m_rbAFrame);
788  rbBFrame.deSerializeFloat(coneData->m_rbBFrame);
789  coneTwist = createConeTwistConstraint(*rbA, *rbB, rbAFrame, rbBFrame);
790  }
791  else
792  {
793  btTransform rbAFrame;
794  rbAFrame.deSerializeFloat(coneData->m_rbAFrame);
795  coneTwist = createConeTwistConstraint(*rbA, rbAFrame);
796  }
797  coneTwist->setLimit(coneData->m_swingSpan1, coneData->m_swingSpan2, coneData->m_twistSpan, coneData->m_limitSoftness, coneData->m_biasFactor, coneData->m_relaxationFactor);
798  coneTwist->setDamping(coneData->m_damping);
799 
800  constraint = coneTwist;
801  break;
802  }
803 
805  {
807  // int sz = sizeof(btGeneric6DofSpringConstraintData);
809 
810  if (rbA && rbB)
811  {
812  btTransform rbAFrame, rbBFrame;
813  rbAFrame.deSerializeFloat(dofData->m_6dofData.m_rbAFrame);
814  rbBFrame.deSerializeFloat(dofData->m_6dofData.m_rbBFrame);
815  dof = createGeneric6DofSpringConstraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_6dofData.m_useLinearReferenceFrameA != 0);
816  }
817  else
818  {
819  printf("Error in btWorldImporter::createGeneric6DofSpringConstraint: requires rbA && rbB\n");
820  }
821 
822  if (dof)
823  {
824  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
825  angLowerLimit.deSerializeFloat(dofData->m_6dofData.m_angularLowerLimit);
826  angUpperLimit.deSerializeFloat(dofData->m_6dofData.m_angularUpperLimit);
827  linLowerLimit.deSerializeFloat(dofData->m_6dofData.m_linearLowerLimit);
828  linUpperlimit.deSerializeFloat(dofData->m_6dofData.m_linearUpperLimit);
829 
830  angLowerLimit.setW(0.f);
831  dof->setAngularLowerLimit(angLowerLimit);
832  dof->setAngularUpperLimit(angUpperLimit);
833  dof->setLinearLowerLimit(linLowerLimit);
834  dof->setLinearUpperLimit(linUpperlimit);
835 
836  int i;
837  if (fileVersion > 280)
838  {
839  for (i = 0; i < 6; i++)
840  {
841  dof->setStiffness(i, dofData->m_springStiffness[i]);
842  dof->setEquilibriumPoint(i, dofData->m_equilibriumPoint[i]);
843  dof->enableSpring(i, dofData->m_springEnabled[i] != 0);
844  dof->setDamping(i, dofData->m_springDamping[i]);
845  }
846  }
847  }
848 
849  constraint = dof;
850  break;
851  }
852  case D6_CONSTRAINT_TYPE:
853  {
854  btGeneric6DofConstraintData* dofData = (btGeneric6DofConstraintData*)constraintData;
855  btGeneric6DofConstraint* dof = 0;
856 
857  if (rbA && rbB)
858  {
859  btTransform rbAFrame, rbBFrame;
860  rbAFrame.deSerializeFloat(dofData->m_rbAFrame);
861  rbBFrame.deSerializeFloat(dofData->m_rbBFrame);
862  dof = createGeneric6DofConstraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_useLinearReferenceFrameA != 0);
863  }
864  else
865  {
866  if (rbB)
867  {
868  btTransform rbBFrame;
869  rbBFrame.deSerializeFloat(dofData->m_rbBFrame);
870  dof = createGeneric6DofConstraint(*rbB, rbBFrame, dofData->m_useLinearReferenceFrameA != 0);
871  }
872  else
873  {
874  printf("Error in btWorldImporter::createGeneric6DofConstraint: missing rbB\n");
875  }
876  }
877 
878  if (dof)
879  {
880  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
881  angLowerLimit.deSerializeFloat(dofData->m_angularLowerLimit);
882  angUpperLimit.deSerializeFloat(dofData->m_angularUpperLimit);
883  linLowerLimit.deSerializeFloat(dofData->m_linearLowerLimit);
884  linUpperlimit.deSerializeFloat(dofData->m_linearUpperLimit);
885 
886  dof->setAngularLowerLimit(angLowerLimit);
887  dof->setAngularUpperLimit(angUpperLimit);
888  dof->setLinearLowerLimit(linLowerLimit);
889  dof->setLinearUpperLimit(linUpperlimit);
890  }
891 
892  constraint = dof;
893  break;
894  }
896  {
897  btSliderConstraintData* sliderData = (btSliderConstraintData*)constraintData;
898  btSliderConstraint* slider = 0;
899  if (rbA && rbB)
900  {
901  btTransform rbAFrame, rbBFrame;
902  rbAFrame.deSerializeFloat(sliderData->m_rbAFrame);
903  rbBFrame.deSerializeFloat(sliderData->m_rbBFrame);
904  slider = createSliderConstraint(*rbA, *rbB, rbAFrame, rbBFrame, sliderData->m_useLinearReferenceFrameA != 0);
905  }
906  else
907  {
908  btTransform rbBFrame;
909  rbBFrame.deSerializeFloat(sliderData->m_rbBFrame);
910  slider = createSliderConstraint(*rbB, rbBFrame, sliderData->m_useLinearReferenceFrameA != 0);
911  }
912  slider->setLowerLinLimit(sliderData->m_linearLowerLimit);
913  slider->setUpperLinLimit(sliderData->m_linearUpperLimit);
914  slider->setLowerAngLimit(sliderData->m_angularLowerLimit);
915  slider->setUpperAngLimit(sliderData->m_angularUpperLimit);
916  slider->setUseFrameOffset(sliderData->m_useOffsetForConstraintFrame != 0);
917  constraint = slider;
918  break;
919  }
921  {
922  btGearConstraintFloatData* gearData = (btGearConstraintFloatData*)constraintData;
923  btGearConstraint* gear = 0;
924  if (rbA && rbB)
925  {
926  btVector3 axisInA, axisInB;
927  axisInA.deSerializeFloat(gearData->m_axisInA);
928  axisInB.deSerializeFloat(gearData->m_axisInB);
929  gear = createGearConstraint(*rbA, *rbB, axisInA, axisInB, gearData->m_ratio);
930  }
931  else
932  {
933  btAssert(0);
934  //perhaps a gear against a 'fixed' body, while the 'fixed' body is not serialized?
935  //btGearConstraint(btRigidBody& rbA, btRigidBody& rbB, const btVector3& axisInA,const btVector3& axisInB, btScalar ratio=1.f);
936  }
937  constraint = gear;
938  break;
939  }
941  {
943 
945 
946  if (rbA && rbB)
947  {
948  btTransform rbAFrame, rbBFrame;
949  rbAFrame.deSerializeFloat(dofData->m_rbAFrame);
950  rbBFrame.deSerializeFloat(dofData->m_rbBFrame);
951  dof = createGeneric6DofSpring2Constraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_rotateOrder);
952  }
953  else
954  {
955  printf("Error in btWorldImporter::createGeneric6DofSpring2Constraint: requires rbA && rbB\n");
956  }
957 
958  if (dof)
959  {
960  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
961  angLowerLimit.deSerializeFloat(dofData->m_angularLowerLimit);
962  angUpperLimit.deSerializeFloat(dofData->m_angularUpperLimit);
963  linLowerLimit.deSerializeFloat(dofData->m_linearLowerLimit);
964  linUpperlimit.deSerializeFloat(dofData->m_linearUpperLimit);
965 
966  angLowerLimit.setW(0.f);
967  dof->setAngularLowerLimit(angLowerLimit);
968  dof->setAngularUpperLimit(angUpperLimit);
969  dof->setLinearLowerLimit(linLowerLimit);
970  dof->setLinearUpperLimit(linUpperlimit);
971 
972  int i;
973  if (fileVersion > 280)
974  {
975  //6-dof: 3 linear followed by 3 angular
976  for (i = 0; i < 3; i++)
977  {
978  dof->setStiffness(i, dofData->m_linearSpringStiffness.m_floats[i], dofData->m_linearSpringStiffnessLimited[i] != 0);
980  dof->enableSpring(i, dofData->m_linearEnableSpring[i] != 0);
981  dof->setDamping(i, dofData->m_linearSpringDamping.m_floats[i], (dofData->m_linearSpringDampingLimited[i] != 0));
982  }
983  for (i = 0; i < 3; i++)
984  {
985  dof->setStiffness(i + 3, dofData->m_angularSpringStiffness.m_floats[i], (dofData->m_angularSpringStiffnessLimited[i] != 0));
986  dof->setEquilibriumPoint(i + 3, dofData->m_angularEquilibriumPoint.m_floats[i]);
987  dof->enableSpring(i + 3, dofData->m_angularEnableSpring[i] != 0);
988  dof->setDamping(i + 3, dofData->m_angularSpringDamping.m_floats[i], dofData->m_angularSpringDampingLimited[i]);
989  }
990  }
991  }
992 
993  constraint = dof;
994  break;
995  }
997  {
999  if (rbA && rbB)
1000  {
1001  btTransform rbAFrame, rbBFrame;
1002  //compute a shared world frame, and compute frameInA, frameInB relative to this
1003  btTransform sharedFrame;
1004  sharedFrame.setIdentity();
1005  btVector3 centerPos = btScalar(0.5) * (rbA->getWorldTransform().getOrigin() +
1006  rbB->getWorldTransform().getOrigin());
1007  sharedFrame.setOrigin(centerPos);
1008  rbAFrame = rbA->getWorldTransform().inverse() * sharedFrame;
1009  rbBFrame = rbB->getWorldTransform().inverse() * sharedFrame;
1010 
1011  dof = createGeneric6DofSpring2Constraint(*rbA, *rbB, rbAFrame, rbBFrame, RO_XYZ);
1012  dof->setLinearUpperLimit(btVector3(0, 0, 0));
1013  dof->setLinearLowerLimit(btVector3(0, 0, 0));
1014  dof->setAngularUpperLimit(btVector3(0, 0, 0));
1015  dof->setAngularLowerLimit(btVector3(0, 0, 0));
1016  }
1017  else
1018  {
1019  printf("Error in btWorldImporter::createGeneric6DofSpring2Constraint: requires rbA && rbB\n");
1020  }
1021 
1022  constraint = dof;
1023  break;
1024  }
1025  default:
1026  {
1027  printf("unknown constraint type\n");
1028  }
1029  };
1030 
1031  if (constraint)
1032  {
1033  constraint->setDbgDrawSize(constraintData->m_dbgDrawSize);
1035  if (fileVersion >= 280)
1036  {
1037  constraint->setBreakingImpulseThreshold(constraintData->m_breakingImpulseThreshold);
1038  constraint->setEnabled(constraintData->m_isEnabled != 0);
1040  }
1041 
1042  if (constraintData->m_name)
1043  {
1044  char* newname = duplicateName(constraintData->m_name);
1045  m_nameConstraintMap.insert(newname, constraint);
1046  m_objectNameMap.insert(constraint, newname);
1047  }
1048  if (m_dynamicsWorld)
1049  m_dynamicsWorld->addConstraint(constraint, constraintData->m_disableCollisionsBetweenLinkedBodies != 0);
1050  }
1051 }
1052 
1054 {
1055  btTypedConstraint* constraint = 0;
1056 
1057  switch (constraintData->m_objectType)
1058  {
1060  {
1062  if (rbA && rbB)
1063  {
1064  btVector3 pivotInA, pivotInB;
1065  pivotInA.deSerializeDouble(p2pData->m_pivotInA);
1066  pivotInB.deSerializeDouble(p2pData->m_pivotInB);
1067  constraint = createPoint2PointConstraint(*rbA, *rbB, pivotInA, pivotInB);
1068  }
1069  else
1070  {
1071  btVector3 pivotInA;
1072  pivotInA.deSerializeDouble(p2pData->m_pivotInA);
1073  constraint = createPoint2PointConstraint(*rbA, pivotInA);
1074  }
1075  break;
1076  }
1077  case HINGE_CONSTRAINT_TYPE:
1078  {
1079  btHingeConstraint* hinge = 0;
1080 
1081  btHingeConstraintDoubleData2* hingeData = (btHingeConstraintDoubleData2*)constraintData;
1082  if (rbA && rbB)
1083  {
1084  btTransform rbAFrame, rbBFrame;
1085  rbAFrame.deSerializeDouble(hingeData->m_rbAFrame);
1086  rbBFrame.deSerializeDouble(hingeData->m_rbBFrame);
1087  hinge = createHingeConstraint(*rbA, *rbB, rbAFrame, rbBFrame, hingeData->m_useReferenceFrameA != 0);
1088  }
1089  else
1090  {
1091  btTransform rbAFrame;
1092  rbAFrame.deSerializeDouble(hingeData->m_rbAFrame);
1093  hinge = createHingeConstraint(*rbA, rbAFrame, hingeData->m_useReferenceFrameA != 0);
1094  }
1095  if (hingeData->m_enableAngularMotor)
1096  {
1097  hinge->enableAngularMotor(true, (btScalar)hingeData->m_motorTargetVelocity, (btScalar)hingeData->m_maxMotorImpulse);
1098  }
1099  hinge->setAngularOnly(hingeData->m_angularOnly != 0);
1100  hinge->setLimit(btScalar(hingeData->m_lowerLimit), btScalar(hingeData->m_upperLimit), btScalar(hingeData->m_limitSoftness), btScalar(hingeData->m_biasFactor), btScalar(hingeData->m_relaxationFactor));
1101 
1102  constraint = hinge;
1103  break;
1104  }
1106  {
1108  btConeTwistConstraint* coneTwist = 0;
1109 
1110  if (rbA && rbB)
1111  {
1112  btTransform rbAFrame, rbBFrame;
1113  rbAFrame.deSerializeDouble(coneData->m_rbAFrame);
1114  rbBFrame.deSerializeDouble(coneData->m_rbBFrame);
1115  coneTwist = createConeTwistConstraint(*rbA, *rbB, rbAFrame, rbBFrame);
1116  }
1117  else
1118  {
1119  btTransform rbAFrame;
1120  rbAFrame.deSerializeDouble(coneData->m_rbAFrame);
1121  coneTwist = createConeTwistConstraint(*rbA, rbAFrame);
1122  }
1123  coneTwist->setLimit((btScalar)coneData->m_swingSpan1, (btScalar)coneData->m_swingSpan2, (btScalar)coneData->m_twistSpan, (btScalar)coneData->m_limitSoftness,
1124  (btScalar)coneData->m_biasFactor, (btScalar)coneData->m_relaxationFactor);
1125  coneTwist->setDamping((btScalar)coneData->m_damping);
1126 
1127  constraint = coneTwist;
1128  break;
1129  }
1130 
1132  {
1134  // int sz = sizeof(btGeneric6DofSpringConstraintData);
1136 
1137  if (rbA && rbB)
1138  {
1139  btTransform rbAFrame, rbBFrame;
1140  rbAFrame.deSerializeDouble(dofData->m_6dofData.m_rbAFrame);
1141  rbBFrame.deSerializeDouble(dofData->m_6dofData.m_rbBFrame);
1142  dof = createGeneric6DofSpringConstraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_6dofData.m_useLinearReferenceFrameA != 0);
1143  }
1144  else
1145  {
1146  printf("Error in btWorldImporter::createGeneric6DofSpringConstraint: requires rbA && rbB\n");
1147  }
1148 
1149  if (dof)
1150  {
1151  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
1152  angLowerLimit.deSerializeDouble(dofData->m_6dofData.m_angularLowerLimit);
1153  angUpperLimit.deSerializeDouble(dofData->m_6dofData.m_angularUpperLimit);
1154  linLowerLimit.deSerializeDouble(dofData->m_6dofData.m_linearLowerLimit);
1155  linUpperlimit.deSerializeDouble(dofData->m_6dofData.m_linearUpperLimit);
1156 
1157  angLowerLimit.setW(0.f);
1158  dof->setAngularLowerLimit(angLowerLimit);
1159  dof->setAngularUpperLimit(angUpperLimit);
1160  dof->setLinearLowerLimit(linLowerLimit);
1161  dof->setLinearUpperLimit(linUpperlimit);
1162 
1163  int i;
1164  if (fileVersion > 280)
1165  {
1166  for (i = 0; i < 6; i++)
1167  {
1168  dof->setStiffness(i, (btScalar)dofData->m_springStiffness[i]);
1169  dof->setEquilibriumPoint(i, (btScalar)dofData->m_equilibriumPoint[i]);
1170  dof->enableSpring(i, dofData->m_springEnabled[i] != 0);
1171  dof->setDamping(i, (btScalar)dofData->m_springDamping[i]);
1172  }
1173  }
1174  }
1175 
1176  constraint = dof;
1177  break;
1178  }
1179  case D6_CONSTRAINT_TYPE:
1180  {
1182  btGeneric6DofConstraint* dof = 0;
1183 
1184  if (rbA && rbB)
1185  {
1186  btTransform rbAFrame, rbBFrame;
1187  rbAFrame.deSerializeDouble(dofData->m_rbAFrame);
1188  rbBFrame.deSerializeDouble(dofData->m_rbBFrame);
1189  dof = createGeneric6DofConstraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_useLinearReferenceFrameA != 0);
1190  }
1191  else
1192  {
1193  if (rbB)
1194  {
1195  btTransform rbBFrame;
1196  rbBFrame.deSerializeDouble(dofData->m_rbBFrame);
1197  dof = createGeneric6DofConstraint(*rbB, rbBFrame, dofData->m_useLinearReferenceFrameA != 0);
1198  }
1199  else
1200  {
1201  printf("Error in btWorldImporter::createGeneric6DofConstraint: missing rbB\n");
1202  }
1203  }
1204 
1205  if (dof)
1206  {
1207  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
1208  angLowerLimit.deSerializeDouble(dofData->m_angularLowerLimit);
1209  angUpperLimit.deSerializeDouble(dofData->m_angularUpperLimit);
1210  linLowerLimit.deSerializeDouble(dofData->m_linearLowerLimit);
1211  linUpperlimit.deSerializeDouble(dofData->m_linearUpperLimit);
1212 
1213  dof->setAngularLowerLimit(angLowerLimit);
1214  dof->setAngularUpperLimit(angUpperLimit);
1215  dof->setLinearLowerLimit(linLowerLimit);
1216  dof->setLinearUpperLimit(linUpperlimit);
1217  }
1218 
1219  constraint = dof;
1220  break;
1221  }
1223  {
1224  btSliderConstraintDoubleData* sliderData = (btSliderConstraintDoubleData*)constraintData;
1225  btSliderConstraint* slider = 0;
1226  if (rbA && rbB)
1227  {
1228  btTransform rbAFrame, rbBFrame;
1229  rbAFrame.deSerializeDouble(sliderData->m_rbAFrame);
1230  rbBFrame.deSerializeDouble(sliderData->m_rbBFrame);
1231  slider = createSliderConstraint(*rbA, *rbB, rbAFrame, rbBFrame, sliderData->m_useLinearReferenceFrameA != 0);
1232  }
1233  else
1234  {
1235  btTransform rbBFrame;
1236  rbBFrame.deSerializeDouble(sliderData->m_rbBFrame);
1237  slider = createSliderConstraint(*rbB, rbBFrame, sliderData->m_useLinearReferenceFrameA != 0);
1238  }
1239  slider->setLowerLinLimit((btScalar)sliderData->m_linearLowerLimit);
1240  slider->setUpperLinLimit((btScalar)sliderData->m_linearUpperLimit);
1241  slider->setLowerAngLimit((btScalar)sliderData->m_angularLowerLimit);
1242  slider->setUpperAngLimit((btScalar)sliderData->m_angularUpperLimit);
1243  slider->setUseFrameOffset(sliderData->m_useOffsetForConstraintFrame != 0);
1244  constraint = slider;
1245  break;
1246  }
1247  case GEAR_CONSTRAINT_TYPE:
1248  {
1249  btGearConstraintDoubleData* gearData = (btGearConstraintDoubleData*)constraintData;
1250  btGearConstraint* gear = 0;
1251  if (rbA && rbB)
1252  {
1253  btVector3 axisInA, axisInB;
1254  axisInA.deSerializeDouble(gearData->m_axisInA);
1255  axisInB.deSerializeDouble(gearData->m_axisInB);
1256  gear = createGearConstraint(*rbA, *rbB, axisInA, axisInB, gearData->m_ratio);
1257  }
1258  else
1259  {
1260  btAssert(0);
1261  //perhaps a gear against a 'fixed' body, while the 'fixed' body is not serialized?
1262  //btGearConstraint(btRigidBody& rbA, btRigidBody& rbB, const btVector3& axisInA,const btVector3& axisInB, btScalar ratio=1.f);
1263  }
1264  constraint = gear;
1265  break;
1266  }
1267 
1269  {
1271 
1273 
1274  if (rbA && rbB)
1275  {
1276  btTransform rbAFrame, rbBFrame;
1277  rbAFrame.deSerializeDouble(dofData->m_rbAFrame);
1278  rbBFrame.deSerializeDouble(dofData->m_rbBFrame);
1279  dof = createGeneric6DofSpring2Constraint(*rbA, *rbB, rbAFrame, rbBFrame, dofData->m_rotateOrder);
1280  }
1281  else
1282  {
1283  printf("Error in btWorldImporter::createGeneric6DofSpring2Constraint: requires rbA && rbB\n");
1284  }
1285 
1286  if (dof)
1287  {
1288  btVector3 angLowerLimit, angUpperLimit, linLowerLimit, linUpperlimit;
1289  angLowerLimit.deSerializeDouble(dofData->m_angularLowerLimit);
1290  angUpperLimit.deSerializeDouble(dofData->m_angularUpperLimit);
1291  linLowerLimit.deSerializeDouble(dofData->m_linearLowerLimit);
1292  linUpperlimit.deSerializeDouble(dofData->m_linearUpperLimit);
1293 
1294  angLowerLimit.setW(0.f);
1295  dof->setAngularLowerLimit(angLowerLimit);
1296  dof->setAngularUpperLimit(angUpperLimit);
1297  dof->setLinearLowerLimit(linLowerLimit);
1298  dof->setLinearUpperLimit(linUpperlimit);
1299 
1300  int i;
1301  if (fileVersion > 280)
1302  {
1303  //6-dof: 3 linear followed by 3 angular
1304  for (i = 0; i < 3; i++)
1305  {
1308  dof->enableSpring(i, dofData->m_linearEnableSpring[i] != 0);
1309  dof->setDamping(i, dofData->m_linearSpringDamping.m_floats[i], (dofData->m_linearSpringDampingLimited[i] != 0));
1310  }
1311  for (i = 0; i < 3; i++)
1312  {
1313  dof->setStiffness(i + 3, dofData->m_angularSpringStiffness.m_floats[i], (dofData->m_angularSpringStiffnessLimited[i] != 0));
1314  dof->setEquilibriumPoint(i + 3, dofData->m_angularEquilibriumPoint.m_floats[i]);
1315  dof->enableSpring(i + 3, dofData->m_angularEnableSpring[i] != 0);
1316  dof->setDamping(i + 3, dofData->m_angularSpringDamping.m_floats[i], (dofData->m_angularSpringDampingLimited[i] != 0));
1317  }
1318  }
1319  }
1320 
1321  constraint = dof;
1322  break;
1323  }
1324  case FIXED_CONSTRAINT_TYPE:
1325  {
1327  if (rbA && rbB)
1328  {
1329  btTransform rbAFrame, rbBFrame;
1330  //compute a shared world frame, and compute frameInA, frameInB relative to this
1331  btTransform sharedFrame;
1332  sharedFrame.setIdentity();
1333  btVector3 centerPos = btScalar(0.5) * (rbA->getWorldTransform().getOrigin() +
1334  rbB->getWorldTransform().getOrigin());
1335  sharedFrame.setOrigin(centerPos);
1336  rbAFrame = rbA->getWorldTransform().inverse() * sharedFrame;
1337  rbBFrame = rbB->getWorldTransform().inverse() * sharedFrame;
1338 
1339  dof = createGeneric6DofSpring2Constraint(*rbA, *rbB, rbAFrame, rbBFrame, RO_XYZ);
1340  dof->setLinearUpperLimit(btVector3(0, 0, 0));
1341  dof->setLinearLowerLimit(btVector3(0, 0, 0));
1342  dof->setAngularUpperLimit(btVector3(0, 0, 0));
1343  dof->setAngularLowerLimit(btVector3(0, 0, 0));
1344  }
1345  else
1346  {
1347  printf("Error in btWorldImporter::createGeneric6DofSpring2Constraint: requires rbA && rbB\n");
1348  }
1349 
1350  constraint = dof;
1351  break;
1352  }
1353 
1354  default:
1355  {
1356  printf("unknown constraint type\n");
1357  }
1358  };
1359 
1360  if (constraint)
1361  {
1362  constraint->setDbgDrawSize((btScalar)constraintData->m_dbgDrawSize);
1364  if (fileVersion >= 280)
1365  {
1366  constraint->setBreakingImpulseThreshold((btScalar)constraintData->m_breakingImpulseThreshold);
1367  constraint->setEnabled(constraintData->m_isEnabled != 0);
1369  }
1370 
1371  if (constraintData->m_name)
1372  {
1373  char* newname = duplicateName(constraintData->m_name);
1374  m_nameConstraintMap.insert(newname, constraint);
1375  m_objectNameMap.insert(constraint, newname);
1376  }
1377  if (m_dynamicsWorld)
1378  m_dynamicsWorld->addConstraint(constraint, constraintData->m_disableCollisionsBetweenLinkedBodies != 0);
1379  }
1380 }
1381 
1383 {
1385 
1386  for (int i = 0; i < meshData.m_numMeshParts; i++)
1387  {
1388  btIndexedMesh meshPart;
1389  meshPart.m_numTriangles = meshData.m_meshPartsPtr[i].m_numTriangles;
1390  meshPart.m_numVertices = meshData.m_meshPartsPtr[i].m_numVertices;
1391 
1392  if (meshData.m_meshPartsPtr[i].m_indices32)
1393  {
1394  meshPart.m_indexType = PHY_INTEGER;
1395  meshPart.m_triangleIndexStride = 3 * sizeof(int);
1396  int* indexArray = (int*)btAlignedAlloc(sizeof(int) * 3 * meshPart.m_numTriangles, 16);
1397  m_indexArrays.push_back(indexArray);
1398  for (int j = 0; j < 3 * meshPart.m_numTriangles; j++)
1399  {
1400  indexArray[j] = meshData.m_meshPartsPtr[i].m_indices32[j].m_value;
1401  }
1402  meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
1403  }
1404  else
1405  {
1406  if (meshData.m_meshPartsPtr[i].m_3indices16)
1407  {
1408  meshPart.m_indexType = PHY_SHORT;
1409  meshPart.m_triangleIndexStride = sizeof(short int) * 3; //sizeof(btShortIntIndexTripletData);
1410 
1411  short int* indexArray = (short int*)btAlignedAlloc(sizeof(short int) * 3 * meshPart.m_numTriangles, 16);
1412  m_shortIndexArrays.push_back(indexArray);
1413 
1414  for (int j = 0; j < meshPart.m_numTriangles; j++)
1415  {
1416  indexArray[3 * j] = meshData.m_meshPartsPtr[i].m_3indices16[j].m_values[0];
1417  indexArray[3 * j + 1] = meshData.m_meshPartsPtr[i].m_3indices16[j].m_values[1];
1418  indexArray[3 * j + 2] = meshData.m_meshPartsPtr[i].m_3indices16[j].m_values[2];
1419  }
1420 
1421  meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
1422  }
1423  if (meshData.m_meshPartsPtr[i].m_indices16)
1424  {
1425  meshPart.m_indexType = PHY_SHORT;
1426  meshPart.m_triangleIndexStride = 3 * sizeof(short int);
1427  short int* indexArray = (short int*)btAlignedAlloc(sizeof(short int) * 3 * meshPart.m_numTriangles, 16);
1428  m_shortIndexArrays.push_back(indexArray);
1429  for (int j = 0; j < 3 * meshPart.m_numTriangles; j++)
1430  {
1431  indexArray[j] = meshData.m_meshPartsPtr[i].m_indices16[j].m_value;
1432  }
1433 
1434  meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
1435  }
1436 
1437  if (meshData.m_meshPartsPtr[i].m_3indices8)
1438  {
1439  meshPart.m_indexType = PHY_UCHAR;
1440  meshPart.m_triangleIndexStride = sizeof(unsigned char) * 3;
1441 
1442  unsigned char* indexArray = (unsigned char*)btAlignedAlloc(sizeof(unsigned char) * 3 * meshPart.m_numTriangles, 16);
1443  m_charIndexArrays.push_back(indexArray);
1444 
1445  for (int j = 0; j < meshPart.m_numTriangles; j++)
1446  {
1447  indexArray[3 * j] = meshData.m_meshPartsPtr[i].m_3indices8[j].m_values[0];
1448  indexArray[3 * j + 1] = meshData.m_meshPartsPtr[i].m_3indices8[j].m_values[1];
1449  indexArray[3 * j + 2] = meshData.m_meshPartsPtr[i].m_3indices8[j].m_values[2];
1450  }
1451 
1452  meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
1453  }
1454  }
1455 
1456  if (meshData.m_meshPartsPtr[i].m_vertices3f)
1457  {
1458  meshPart.m_vertexType = PHY_FLOAT;
1459  meshPart.m_vertexStride = sizeof(btVector3FloatData);
1461  m_floatVertexArrays.push_back(vertices);
1462 
1463  for (int j = 0; j < meshPart.m_numVertices; j++)
1464  {
1465  vertices[j].m_floats[0] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[0];
1466  vertices[j].m_floats[1] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[1];
1467  vertices[j].m_floats[2] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[2];
1468  vertices[j].m_floats[3] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[3];
1469  }
1470  meshPart.m_vertexBase = (const unsigned char*)vertices;
1471  }
1472  else
1473  {
1474  meshPart.m_vertexType = PHY_DOUBLE;
1475  meshPart.m_vertexStride = sizeof(btVector3DoubleData);
1476 
1478  m_doubleVertexArrays.push_back(vertices);
1479 
1480  for (int j = 0; j < meshPart.m_numVertices; j++)
1481  {
1482  vertices[j].m_floats[0] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[0];
1483  vertices[j].m_floats[1] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[1];
1484  vertices[j].m_floats[2] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[2];
1485  vertices[j].m_floats[3] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[3];
1486  }
1487  meshPart.m_vertexBase = (const unsigned char*)vertices;
1488  }
1489 
1490  if (meshPart.m_triangleIndexBase && meshPart.m_vertexBase)
1491  {
1492  meshInterface->addIndexedMesh(meshPart, meshPart.m_indexType);
1493  }
1494  }
1495 
1496  return meshInterface;
1497 }
1498 
1500 {
1501  //create a new btStridingMeshInterfaceData that is an exact copy of shapedata and store it in the WorldImporter
1503 
1504  newData->m_scaling = interfaceData->m_scaling;
1505  newData->m_numMeshParts = interfaceData->m_numMeshParts;
1506  newData->m_meshPartsPtr = new btMeshPartData[newData->m_numMeshParts];
1507 
1508  for (int i = 0; i < newData->m_numMeshParts; i++)
1509  {
1510  btMeshPartData* curPart = &interfaceData->m_meshPartsPtr[i];
1511  btMeshPartData* curNewPart = &newData->m_meshPartsPtr[i];
1512 
1513  curNewPart->m_numTriangles = curPart->m_numTriangles;
1514  curNewPart->m_numVertices = curPart->m_numVertices;
1515 
1516  if (curPart->m_vertices3f)
1517  {
1518  curNewPart->m_vertices3f = new btVector3FloatData[curNewPart->m_numVertices];
1519  memcpy(curNewPart->m_vertices3f, curPart->m_vertices3f, sizeof(btVector3FloatData) * curNewPart->m_numVertices);
1520  }
1521  else
1522  curNewPart->m_vertices3f = NULL;
1523 
1524  if (curPart->m_vertices3d)
1525  {
1526  curNewPart->m_vertices3d = new btVector3DoubleData[curNewPart->m_numVertices];
1527  memcpy(curNewPart->m_vertices3d, curPart->m_vertices3d, sizeof(btVector3DoubleData) * curNewPart->m_numVertices);
1528  }
1529  else
1530  curNewPart->m_vertices3d = NULL;
1531 
1532  int numIndices = curNewPart->m_numTriangles * 3;
1535  bool uninitialized3indices8Workaround = false;
1536 
1537  if (curPart->m_indices32)
1538  {
1539  uninitialized3indices8Workaround = true;
1540  curNewPart->m_indices32 = new btIntIndexData[numIndices];
1541  memcpy(curNewPart->m_indices32, curPart->m_indices32, sizeof(btIntIndexData) * numIndices);
1542  }
1543  else
1544  curNewPart->m_indices32 = NULL;
1545 
1546  if (curPart->m_3indices16)
1547  {
1548  uninitialized3indices8Workaround = true;
1549  curNewPart->m_3indices16 = new btShortIntIndexTripletData[curNewPart->m_numTriangles];
1550  memcpy(curNewPart->m_3indices16, curPart->m_3indices16, sizeof(btShortIntIndexTripletData) * curNewPart->m_numTriangles);
1551  }
1552  else
1553  curNewPart->m_3indices16 = NULL;
1554 
1555  if (curPart->m_indices16)
1556  {
1557  uninitialized3indices8Workaround = true;
1558  curNewPart->m_indices16 = new btShortIntIndexData[numIndices];
1559  memcpy(curNewPart->m_indices16, curPart->m_indices16, sizeof(btShortIntIndexData) * numIndices);
1560  }
1561  else
1562  curNewPart->m_indices16 = NULL;
1563 
1564  if (!uninitialized3indices8Workaround && curPart->m_3indices8)
1565  {
1566  curNewPart->m_3indices8 = new btCharIndexTripletData[curNewPart->m_numTriangles];
1567  memcpy(curNewPart->m_3indices8, curPart->m_3indices8, sizeof(btCharIndexTripletData) * curNewPart->m_numTriangles);
1568  }
1569  else
1570  curNewPart->m_3indices8 = NULL;
1571  }
1572 
1574 
1575  return (newData);
1576 }
1577 
1578 #ifdef USE_INTERNAL_EDGE_UTILITY
1580 
1581 static bool btAdjustInternalEdgeContactsCallback(btManifoldPoint& cp, const btCollisionObject* colObj0, int partId0, int index0, const btCollisionObject* colObj1, int partId1, int index1)
1582 {
1583  btAdjustInternalEdgeContacts(cp, colObj1, colObj0, partId1, index1);
1584  //btAdjustInternalEdgeContacts(cp,colObj1,colObj0, partId1,index1, BT_TRIANGLE_CONVEX_BACKFACE_MODE);
1585  //btAdjustInternalEdgeContacts(cp,colObj1,colObj0, partId1,index1, BT_TRIANGLE_CONVEX_DOUBLE_SIDED+BT_TRIANGLE_CONCAVE_DOUBLE_SIDED);
1586  return true;
1587 }
1588 #endif //USE_INTERNAL_EDGE_UTILITY
1589 
1590 btCollisionObject* btWorldImporter::createCollisionObject(const btTransform& startTransform, btCollisionShape* shape, const char* bodyName)
1591 {
1592  return createRigidBody(false, 0, startTransform, shape, bodyName);
1593 }
1594 
1596 {
1597  if (m_dynamicsWorld)
1598  {
1599  m_dynamicsWorld->setGravity(gravity);
1600  m_dynamicsWorld->getSolverInfo() = solverInfo;
1601  }
1602 }
1603 
1604 btRigidBody* btWorldImporter::createRigidBody(bool isDynamic, btScalar mass, const btTransform& startTransform, btCollisionShape* shape, const char* bodyName)
1605 {
1606  btVector3 localInertia;
1607  localInertia.setZero();
1608 
1609  if (mass)
1610  shape->calculateLocalInertia(mass, localInertia);
1611 
1612  btRigidBody* body = new btRigidBody(mass, 0, shape, localInertia);
1613  body->setWorldTransform(startTransform);
1614 
1615  if (m_dynamicsWorld)
1617 
1618  if (bodyName)
1619  {
1620  char* newname = duplicateName(bodyName);
1621  m_objectNameMap.insert(body, newname);
1622  m_nameBodyMap.insert(newname, body);
1623  }
1625  return body;
1626 }
1627 
1629 {
1630  btStaticPlaneShape* shape = new btStaticPlaneShape(planeNormal, planeConstant);
1632  return shape;
1633 }
1635 {
1636  btBoxShape* shape = new btBoxShape(halfExtents);
1638  return shape;
1639 }
1641 {
1642  btSphereShape* shape = new btSphereShape(radius);
1644  return shape;
1645 }
1646 
1648 {
1649  btCapsuleShapeX* shape = new btCapsuleShapeX(radius, height);
1651  return shape;
1652 }
1653 
1655 {
1656  btCapsuleShape* shape = new btCapsuleShape(radius, height);
1658  return shape;
1659 }
1660 
1662 {
1663  btCapsuleShapeZ* shape = new btCapsuleShapeZ(radius, height);
1665  return shape;
1666 }
1667 
1669 {
1670  btCylinderShapeX* shape = new btCylinderShapeX(btVector3(height, radius, radius));
1672  return shape;
1673 }
1674 
1676 {
1677  btCylinderShape* shape = new btCylinderShape(btVector3(radius, height, radius));
1679  return shape;
1680 }
1681 
1683 {
1684  btCylinderShapeZ* shape = new btCylinderShapeZ(btVector3(radius, radius, height));
1686  return shape;
1687 }
1688 
1690 {
1691  btConeShapeX* shape = new btConeShapeX(radius, height);
1693  return shape;
1694 }
1695 
1697 {
1698  btConeShape* shape = new btConeShape(radius, height);
1700  return shape;
1701 }
1702 
1704 {
1705  btConeShapeZ* shape = new btConeShapeZ(radius, height);
1707  return shape;
1708 }
1709 
1711 {
1714  return in;
1715 }
1716 
1718 {
1719  btOptimizedBvh* bvh = new btOptimizedBvh();
1721  return bvh;
1722 }
1723 
1725 {
1726  btTriangleInfoMap* tim = new btTriangleInfoMap();
1728  return tim;
1729 }
1730 
1732 {
1733  if (bvh)
1734  {
1735  btBvhTriangleMeshShape* bvhTriMesh = new btBvhTriangleMeshShape(trimesh, bvh->isQuantized(), false);
1736  bvhTriMesh->setOptimizedBvh(bvh);
1738  return bvhTriMesh;
1739  }
1740 
1741  btBvhTriangleMeshShape* ts = new btBvhTriangleMeshShape(trimesh, true);
1743  return ts;
1744 }
1746 {
1747  return 0;
1748 }
1750 {
1751 #ifdef USE_GIMPACT
1752  btGImpactMeshShape* shape = new btGImpactMeshShape(trimesh);
1754  return shape;
1755 #else
1756  return 0;
1757 #endif
1758 }
1760 {
1761  btConvexHullShape* shape = new btConvexHullShape();
1763  return shape;
1764 }
1765 
1767 {
1768  btCompoundShape* shape = new btCompoundShape();
1770  return shape;
1771 }
1772 
1774 {
1775  btScaledBvhTriangleMeshShape* shape = new btScaledBvhTriangleMeshShape(meshShape, localScaling);
1777  return shape;
1778 }
1779 
1780 btMultiSphereShape* btWorldImporter::createMultiSphereShape(const btVector3* positions, const btScalar* radi, int numSpheres)
1781 {
1782  btMultiSphereShape* shape = new btMultiSphereShape(positions, radi, numSpheres);
1784  return shape;
1785 }
1786 
1788 {
1789  static btRigidBody s_fixed(0, 0, 0);
1790  s_fixed.setMassProps(btScalar(0.), btVector3(btScalar(0.), btScalar(0.), btScalar(0.)));
1791  return s_fixed;
1792 }
1793 
1795 {
1796  btPoint2PointConstraint* p2p = new btPoint2PointConstraint(rbA, rbB, pivotInA, pivotInB);
1798  return p2p;
1799 }
1800 
1802 {
1803  btPoint2PointConstraint* p2p = new btPoint2PointConstraint(rbA, pivotInA);
1805  return p2p;
1806 }
1807 
1808 btHingeConstraint* btWorldImporter::createHingeConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA)
1809 {
1810  btHingeConstraint* hinge = new btHingeConstraint(rbA, rbB, rbAFrame, rbBFrame, useReferenceFrameA);
1812  return hinge;
1813 }
1814 
1816 {
1817  btHingeConstraint* hinge = new btHingeConstraint(rbA, rbAFrame, useReferenceFrameA);
1819  return hinge;
1820 }
1821 
1823 {
1824  btConeTwistConstraint* cone = new btConeTwistConstraint(rbA, rbB, rbAFrame, rbBFrame);
1826  return cone;
1827 }
1828 
1830 {
1831  btConeTwistConstraint* cone = new btConeTwistConstraint(rbA, rbAFrame);
1833  return cone;
1834 }
1835 
1836 btGeneric6DofConstraint* btWorldImporter::createGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
1837 {
1838  btGeneric6DofConstraint* dof = new btGeneric6DofConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA);
1840  return dof;
1841 }
1842 
1844 {
1845  btGeneric6DofConstraint* dof = new btGeneric6DofConstraint(rbB, frameInB, useLinearReferenceFrameB);
1847  return dof;
1848 }
1849 
1851 {
1852  btGeneric6DofSpring2Constraint* dof = new btGeneric6DofSpring2Constraint(rbA, rbB, frameInA, frameInB, (RotateOrder)rotateOrder);
1854  return dof;
1855 }
1856 
1858 {
1859  btGeneric6DofSpringConstraint* dof = new btGeneric6DofSpringConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA);
1861  return dof;
1862 }
1863 
1864 btSliderConstraint* btWorldImporter::createSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
1865 {
1866  btSliderConstraint* slider = new btSliderConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA);
1868  return slider;
1869 }
1870 
1871 btSliderConstraint* btWorldImporter::createSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameA)
1872 {
1873  btSliderConstraint* slider = new btSliderConstraint(rbB, frameInB, useLinearReferenceFrameA);
1875  return slider;
1876 }
1877 
1879 {
1880  btGearConstraint* gear = new btGearConstraint(rbA, rbB, axisInA, axisInB, ratio);
1882  return gear;
1883 }
1884 
1885 // query for data
1887 {
1889 }
1890 
1892 {
1893  return m_allocatedCollisionShapes[index];
1894 }
1895 
1897 {
1898  btCollisionShape** shapePtr = m_nameShapeMap.find(name);
1899  if (shapePtr && *shapePtr)
1900  {
1901  return *shapePtr;
1902  }
1903  return 0;
1904 }
1905 
1907 {
1908  btRigidBody** bodyPtr = m_nameBodyMap.find(name);
1909  if (bodyPtr && *bodyPtr)
1910  {
1911  return *bodyPtr;
1912  }
1913  return 0;
1914 }
1915 
1917 {
1918  btTypedConstraint** constraintPtr = m_nameConstraintMap.find(name);
1919  if (constraintPtr && *constraintPtr)
1920  {
1921  return *constraintPtr;
1922  }
1923  return 0;
1924 }
1925 
1926 const char* btWorldImporter::getNameForPointer(const void* ptr) const
1927 {
1928  const char* const* namePtr = m_objectNameMap.find(ptr);
1929  if (namePtr && *namePtr)
1930  return *namePtr;
1931  return 0;
1932 }
1933 
1935 {
1936  return m_allocatedRigidBodies.size();
1937 }
1938 
1940 {
1941  return m_allocatedRigidBodies[index];
1942 }
1944 {
1945  return m_allocatedConstraints.size();
1946 }
1947 
1949 {
1950  return m_allocatedConstraints[index];
1951 }
1952 
1954 {
1955  return m_allocatedBvhs.size();
1956 }
1958 {
1959  return m_allocatedBvhs[index];
1960 }
1961 
1963 {
1965 }
1966 
1968 {
1969  return m_allocatedTriangleInfoMaps[index];
1970 }
1971 
1973 {
1974  btScalar mass = btScalar(colObjData->m_inverseMass ? 1.f / colObjData->m_inverseMass : 0.f);
1975  btVector3 localInertia;
1976  localInertia.setZero();
1978  if (shapePtr && *shapePtr)
1979  {
1980  btTransform startTransform;
1982  startTransform.deSerializeFloat(colObjData->m_collisionObjectData.m_worldTransform);
1983 
1984  // startTransform.setBasis(btMatrix3x3::getIdentity());
1985  btCollisionShape* shape = (btCollisionShape*)*shapePtr;
1986  if (shape->isNonMoving())
1987  {
1988  mass = 0.f;
1989  }
1990  if (mass)
1991  {
1992  shape->calculateLocalInertia(mass, localInertia);
1993  }
1994  bool isDynamic = mass != 0.f;
1995  btRigidBody* body = createRigidBody(isDynamic, mass, startTransform, shape, colObjData->m_collisionObjectData.m_name);
1996  body->setFriction(colObjData->m_collisionObjectData.m_friction);
1998  btVector3 linearFactor, angularFactor;
1999  linearFactor.deSerializeFloat(colObjData->m_linearFactor);
2000  angularFactor.deSerializeFloat(colObjData->m_angularFactor);
2001  body->setLinearFactor(linearFactor);
2002  body->setAngularFactor(angularFactor);
2003 
2004 #ifdef USE_INTERNAL_EDGE_UTILITY
2006  {
2008  if (trimesh->getTriangleInfoMap())
2009  {
2011  }
2012  }
2013 #endif //USE_INTERNAL_EDGE_UTILITY
2014  m_bodyMap.insert(colObjData, body);
2015  }
2016  else
2017  {
2018  printf("error: no shape found\n");
2019  }
2020 }
2021 
2023 {
2024  btScalar mass = btScalar(colObjData->m_inverseMass ? 1.f / colObjData->m_inverseMass : 0.f);
2025  btVector3 localInertia;
2026  localInertia.setZero();
2028  if (shapePtr && *shapePtr)
2029  {
2030  btTransform startTransform;
2032  startTransform.deSerializeDouble(colObjData->m_collisionObjectData.m_worldTransform);
2033 
2034  // startTransform.setBasis(btMatrix3x3::getIdentity());
2035  btCollisionShape* shape = (btCollisionShape*)*shapePtr;
2036  if (shape->isNonMoving())
2037  {
2038  mass = 0.f;
2039  }
2040  if (mass)
2041  {
2042  shape->calculateLocalInertia(mass, localInertia);
2043  }
2044  bool isDynamic = mass != 0.f;
2045  btRigidBody* body = createRigidBody(isDynamic, mass, startTransform, shape, colObjData->m_collisionObjectData.m_name);
2048  btVector3 linearFactor, angularFactor;
2049  linearFactor.deSerializeDouble(colObjData->m_linearFactor);
2050  angularFactor.deSerializeDouble(colObjData->m_angularFactor);
2051  body->setLinearFactor(linearFactor);
2052  body->setAngularFactor(angularFactor);
2053 
2054 #ifdef USE_INTERNAL_EDGE_UTILITY
2056  {
2058  if (trimesh->getTriangleInfoMap())
2059  {
2061  }
2062  }
2063 #endif //USE_INTERNAL_EDGE_UTILITY
2064  m_bodyMap.insert(colObjData, body);
2065  }
2066  else
2067  {
2068  printf("error: no shape found\n");
2069  }
2070 }
btSliderConstraintData::m_angularLowerLimit
float m_angularLowerLimit
Definition: btSliderConstraint.h:301
btCollisionShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btCollisionShape.h:151
btGeneric6DofSpring2ConstraintData::m_angularSpringDampingLimited
char m_angularSpringDampingLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:529
btTypedConstraintFloatData::m_objectType
int m_objectType
Definition: btTypedConstraint.h:364
btHingeConstraint
hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in lo...
Definition: btHingeConstraint.h:47
btGeneric6DofConstraintData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:566
btMeshPartData::m_3indices16
btShortIntIndexTripletData * m_3indices16
Definition: btStridingMeshInterface.h:127
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition: btTypedConstraint.h:74
btWorldImporter::getRigidBodyByIndex
btCollisionObject * getRigidBodyByIndex(int index) const
Definition: btWorldImporter.cpp:1939
btTypedConstraintFloatData::m_name
char * m_name
Definition: btTypedConstraint.h:362
btConeTwistConstraintDoubleData::m_twistSpan
double m_twistSpan
Definition: btConeTwistConstraint.h:367
btGeneric6DofConstraintData::m_linearUpperLimit
btVector3FloatData m_linearUpperLimit
Definition: btGeneric6DofConstraint.h:560
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:48
btGeneric6DofSpringConstraintData::m_springStiffness
float m_springStiffness[6]
Definition: btGeneric6DofSpringConstraint.h:99
btGeneric6DofSpring2ConstraintData::m_linearEnableSpring
char m_linearEnableSpring[4]
Definition: btGeneric6DofSpring2Constraint.h:507
btWorldImporter::createConeShapeZ
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1703
btWorldImporter::getConstraintByName
btTypedConstraint * getConstraintByName(const char *name)
Definition: btWorldImporter.cpp:1916
btCollisionShapeData::m_shapeType
int m_shapeType
Definition: btCollisionShape.h:154
btWorldImporter::createStridingMeshInterfaceData
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
Definition: btWorldImporter.cpp:1499
btHingeConstraintDoubleData2::m_biasFactor
double m_biasFactor
Definition: btHingeConstraint.h:431
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:59
SOFTBODY_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:73
btTypedConstraintFloatData::m_dbgDrawSize
float m_dbgDrawSize
Definition: btTypedConstraint.h:370
RO_XYZ
Definition: btGeneric6DofSpring2Constraint.h:59
btRigidBody::setAngularFactor
void setAngularFactor(const btVector3 &angFac)
Definition: btRigidBody.h:476
btPoint2PointConstraintFloatData::m_pivotInB
btVector3FloatData m_pivotInB
Definition: btPoint2PointConstraint.h:133
btSliderConstraint::setUseFrameOffset
void setUseFrameOffset(bool frameOffsetOnOff)
Definition: btSliderConstraint.h:262
btCompoundShapeChildData::m_childShape
btCollisionShapeData * m_childShape
Definition: btCompoundShape.h:182
btWorldImporter::getNumRigidBodies
int getNumRigidBodies() const
Definition: btWorldImporter.cpp:1934
btAlignedFree
#define btAlignedFree(ptr)
Definition: btAlignedAllocator.h:47
btPoint2PointConstraintFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btPoint2PointConstraint.h:129
btGeneric6DofSpring2ConstraintData::m_rotateOrder
int m_rotateOrder
Definition: btGeneric6DofSpring2Constraint.h:531
btCollisionShape::getShapeType
int getShapeType() const
Definition: btCollisionShape.h:106
btGeneric6DofSpring2ConstraintData::m_linearLowerLimit
btVector3FloatData m_linearLowerLimit
Definition: btGeneric6DofSpring2Constraint.h:493
btWorldImporter::createBoxShape
virtual btCollisionShape * createBoxShape(const btVector3 &halfExtents)
Definition: btWorldImporter.cpp:1634
btGeneric6DofSpring2Constraint::setLinearUpperLimit
void setLinearUpperLimit(const btVector3 &linearUpper)
Definition: btGeneric6DofSpring2Constraint.h:358
btHingeConstraintFloatData::m_useReferenceFrameA
int m_useReferenceFrameA
Definition: btHingeConstraint.h:402
btTransform::inverse
btTransform inverse() const
Return the inverse of this transform.
Definition: btTransform.h:182
btGeneric6DofSpring2ConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btGeneric6DofSpring2Constraint.h:490
btGeneric6DofSpring2ConstraintData::m_angularSpringDamping
btVector3FloatData m_angularSpringDamping
Definition: btGeneric6DofSpring2Constraint.h:523
btWorldImporter::m_bodyMap
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
Definition: btWorldImporter.h:100
CYLINDER_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:44
btOptimizedBvh
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes,...
Definition: btOptimizedBvh.h:26
btTransformDoubleData::m_origin
btVector3DoubleData m_origin
Definition: btTransform.h:253
btHingeConstraintFloatData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btHingeConstraint.h:400
btWorldImporter::createSphereShape
virtual btCollisionShape * createSphereShape(btScalar radius)
Definition: btWorldImporter.cpp:1640
btGeneric6DofSpringConstraintData::m_6dofData
btGeneric6DofConstraintData m_6dofData
Definition: btGeneric6DofSpringConstraint.h:95
btHingeConstraintFloatData::m_maxMotorImpulse
float m_maxMotorImpulse
Definition: btHingeConstraint.h:407
btHingeConstraintFloatData::m_relaxationFactor
float m_relaxationFactor
Definition: btHingeConstraint.h:413
btContactSolverInfo
Definition: btContactSolverInfo.h:69
btCollisionObjectFloatData::m_name
char * m_name
Definition: btCollisionObject.h:631
btHingeConstraintDoubleData2::m_useReferenceFrameA
int m_useReferenceFrameA
Definition: btHingeConstraint.h:422
btShortIntIndexTripletData::m_values
short m_values[3]
Definition: btStridingMeshInterface.h:108
btSliderConstraintDoubleData::m_angularLowerLimit
double m_angularLowerLimit
Definition: btSliderConstraint.h:317
RotateOrder
RotateOrder
Definition: btGeneric6DofSpring2Constraint.h:57
btStaticPlaneShapeData::m_planeConstant
float m_planeConstant
Definition: btStaticPlaneShape.h:75
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:294
btWorldImporter::m_objectNameMap
btHashMap< btHashPtr, const char * > m_objectNameMap
Definition: btWorldImporter.h:97
btBoxShape
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
Definition: btBoxShape.h:26
btConvexHullShapeData::m_unscaledPointsFloatPtr
btVector3FloatData * m_unscaledPointsFloatPtr
Definition: btConvexHullShape.h:101
btMeshPartData::m_vertices3f
btVector3FloatData * m_vertices3f
Definition: btStridingMeshInterface.h:123
btConeShapeData::m_upIndex
int m_upIndex
Definition: btConeShape.h:147
btWorldImporter::getNumConstraints
int getNumConstraints() const
Definition: btWorldImporter.cpp:1943
btConeTwistConstraintDoubleData::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btConeTwistConstraint.h:362
btScaledTriangleMeshShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btScaledBvhTriangleMeshShape.h:64
btSliderConstraintDoubleData::m_linearLowerLimit
double m_linearLowerLimit
Definition: btSliderConstraint.h:314
btGeneric6DofSpring2ConstraintDoubleData2::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btGeneric6DofSpring2Constraint.h:538
btCylinderShapeData::m_upAxis
int m_upAxis
Definition: btCylinderShape.h:178
btConeTwistConstraintDoubleData::m_limitSoftness
double m_limitSoftness
Definition: btConeTwistConstraint.h:368
btAdjustInternalEdgeContacts
void btAdjustInternalEdgeContacts(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, const btCollisionObjectWrapper *colObj1Wrap, int partId0, int index0, int normalAdjustFlags)
Changes a btManifoldPoint collision normal to the normal from the mesh.
Definition: btInternalEdgeUtility.cpp:423
btWorldImporter::convertRigidBodyDouble
void convertRigidBodyDouble(btRigidBodyDoubleData *colObjData)
Definition: btWorldImporter.cpp:2022
btTriangleMeshShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btBvhTriangleMeshShape.h:120
btSliderConstraintDoubleData::m_angularUpperLimit
double m_angularUpperLimit
Definition: btSliderConstraint.h:316
btPoint2PointConstraintDoubleData2::m_pivotInB
btVector3DoubleData m_pivotInB
Definition: btPoint2PointConstraint.h:141
btWorldImporter::createGeneric6DofSpring2Constraint
virtual btGeneric6DofSpring2Constraint * createGeneric6DofSpring2Constraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, int rotateOrder)
Definition: btWorldImporter.cpp:1850
btGeneric6DofSpring2ConstraintData::m_angularLowerLimit
btVector3FloatData m_angularLowerLimit
Definition: btGeneric6DofSpring2Constraint.h:513
btGeneric6DofConstraintDoubleData2::m_linearLowerLimit
btVector3DoubleData m_linearLowerLimit
Definition: btGeneric6DofConstraint.h:577
btWorldImporter::~btWorldImporter
virtual ~btWorldImporter()
Definition: btWorldImporter.cpp:28
btBvhTriangleMeshShape
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
Definition: btBvhTriangleMeshShape.h:34
btWorldImporter::createSliderConstraint
virtual btSliderConstraint * createSliderConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
Definition: btWorldImporter.cpp:1864
btCompoundShapeChildData::m_transform
btTransformFloatData m_transform
Definition: btCompoundShape.h:181
btGeneric6DofSpringConstraintDoubleData2::m_springStiffness
double m_springStiffness[6]
Definition: btGeneric6DofSpringConstraint.h:109
btGeneric6DofSpring2Constraint
Definition: btGeneric6DofSpring2Constraint.h:271
btTypedConstraintFloatData::m_breakingImpulseThreshold
float m_breakingImpulseThreshold
Definition: btTypedConstraint.h:375
btPoint2PointConstraintDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 th...
Definition: btPoint2PointConstraint.h:148
btGeneric6DofSpring2ConstraintData::m_angularUpperLimit
btVector3FloatData m_angularUpperLimit
Definition: btGeneric6DofSpring2Constraint.h:512
btIndexedMesh::m_vertexType
PHY_ScalarType m_vertexType
Definition: btTriangleIndexVertexArray.h:46
btGeneric6DofSpring2ConstraintDoubleData2::m_linearSpringDampingLimited
char m_linearSpringDampingLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:557
btHingeConstraintDoubleData2::m_maxMotorImpulse
double m_maxMotorImpulse
Definition: btHingeConstraint.h:426
btTypedConstraintDoubleData::m_dbgDrawSize
double m_dbgDrawSize
Definition: btTypedConstraint.h:422
CONETWIST_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:38
btRigidBodyFloatData::m_linearFactor
btVector3FloatData m_linearFactor
Definition: btRigidBody.h:550
btStridingMeshInterface::setScaling
void setScaling(const btVector3 &scaling)
Definition: btStridingMeshInterface.h:84
btRigidBodyDoubleData::m_angularFactor
btVector3DoubleData m_angularFactor
Definition: btRigidBody.h:575
btGeneric6DofSpring2ConstraintDoubleData2::m_angularEnableSpring
char m_angularEnableSpring[4]
Definition: btGeneric6DofSpring2Constraint.h:575
btHingeConstraintDoubleData::m_relaxationFactor
float m_relaxationFactor
Definition: btHingeConstraint.h:355
btStaticPlaneShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btStaticPlaneShape.h:69
btWorldImporter::m_allocatedNames
btAlignedObjectArray< char * > m_allocatedNames
Definition: btWorldImporter.h:82
btAlignedObjectArray::clear
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
Definition: btAlignedObjectArray.h:183
btMeshPartData::m_indices16
btShortIntIndexData * m_indices16
Definition: btStridingMeshInterface.h:130
btTypedConstraintData::m_dbgDrawSize
float m_dbgDrawSize
Definition: btTypedConstraint.h:399
gContactAddedCallback
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
Definition: btManifoldResult.cpp:22
btRigidBodyDoubleData::m_collisionObjectData
btCollisionObjectDoubleData m_collisionObjectData
Definition: btRigidBody.h:571
btHingeConstraintFloatData::m_angularOnly
int m_angularOnly
Definition: btHingeConstraint.h:403
btHingeConstraintDoubleData::m_upperLimit
float m_upperLimit
Definition: btHingeConstraint.h:352
btConeTwistConstraintData::m_biasFactor
float m_biasFactor
Definition: btConeTwistConstraint.h:388
btDynamicsWorld::getSolverInfo
btContactSolverInfo & getSolverInfo()
Definition: btDynamicsWorld.h:139
btHingeConstraintDoubleData2::m_motorTargetVelocity
double m_motorTargetVelocity
Definition: btHingeConstraint.h:425
btMeshPartData::m_numVertices
int m_numVertices
Definition: btStridingMeshInterface.h:133
btWorldImporter::createMultiSphereShape
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
Definition: btWorldImporter.cpp:1780
btGeneric6DofConstraintData
Definition: btGeneric6DofConstraint.h:554
btWorldImporter::getCollisionShapeByName
btCollisionShape * getCollisionShapeByName(const char *name)
Definition: btWorldImporter.cpp:1896
btGeneric6DofSpring2Constraint::setStiffness
void setStiffness(int index, btScalar stiffness, bool limitIfNeeded=true)
Definition: btGeneric6DofSpring2Constraint.cpp:1135
btVector3DoubleData::m_floats
double m_floats[4]
Definition: btVector3.h:1288
btAlignedAlloc
#define btAlignedAlloc(size, alignment)
Definition: btAlignedAllocator.h:46
btWorldImporter::m_indexArrays
btAlignedObjectArray< int * > m_indexArrays
Definition: btWorldImporter.h:84
btStridingMeshInterfaceData::m_numMeshParts
int m_numMeshParts
Definition: btStridingMeshInterface.h:142
btSliderConstraintData::m_linearLowerLimit
float m_linearLowerLimit
Definition: btSliderConstraint.h:298
btCollisionObjectDoubleData::m_worldTransform
btTransformDoubleData m_worldTransform
Definition: btCollisionObject.h:598
btGeneric6DofSpring2ConstraintData::m_linearSpringStiffness
btVector3FloatData m_linearSpringStiffness
Definition: btGeneric6DofSpring2Constraint.h:502
btDynamicsWorld
The btDynamicsWorld is the interface class for several dynamics implementation, basic,...
Definition: btDynamicsWorld.h:41
btCollisionObjectDoubleData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:594
btSliderConstraint::setLowerAngLimit
void setLowerAngLimit(btScalar lowerLimit)
Definition: btSliderConstraint.h:192
btRigidBodyFloatData::m_angularFactor
btVector3FloatData m_angularFactor
Definition: btRigidBody.h:549
btGeneric6DofSpringConstraintDoubleData2::m_springEnabled
int m_springEnabled[6]
Definition: btGeneric6DofSpringConstraint.h:107
btGImpactMeshShape::setLocalScaling
virtual void setLocalScaling(const btVector3 &scaling)
Definition: btGImpactShape.h:912
btVector3::setZero
void setZero()
Definition: btVector3.h:671
btSliderConstraintData::m_linearUpperLimit
float m_linearUpperLimit
Definition: btSliderConstraint.h:297
btTypedConstraintFloatData::m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
Definition: btTypedConstraint.h:372
btGImpactMeshShape
This class manages a mesh supplied by the btStridingMeshInterface interface.
Definition: btGImpactShape.h:842
btSliderConstraintData::m_angularUpperLimit
float m_angularUpperLimit
Definition: btSliderConstraint.h:300
btHingeConstraintDoubleData::m_useReferenceFrameA
int m_useReferenceFrameA
Definition: btHingeConstraint.h:345
btPositionAndRadius::m_pos
btVector3FloatData m_pos
Definition: btMultiSphereShape.h:73
PHY_FLOAT
Definition: btConcaveShape.h:27
btSliderConstraintDoubleData::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition: btSliderConstraint.h:320
btTriangleInfoMap::deSerialize
void deSerialize(struct btTriangleInfoMapData &data)
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition: btTriangleInfoMap.h:204
btGeneric6DofConstraint
btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis locatio...
Definition: btGeneric6DofConstraint.h:266
btCharIndexTripletData
Definition: btStridingMeshInterface.h:112
btIndexedMesh::m_triangleIndexBase
const unsigned char * m_triangleIndexBase
Definition: btTriangleIndexVertexArray.h:31
btTypedConstraintData::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:402
btConeTwistConstraintDoubleData::m_biasFactor
double m_biasFactor
Definition: btConeTwistConstraint.h:369
btHingeConstraintFloatData::m_lowerLimit
float m_lowerLimit
Definition: btHingeConstraint.h:409
btMeshPartData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btStridingMeshInterface.h:121
btWorldImporter::getNameForPointer
const char * getNameForPointer(const void *ptr) const
Definition: btWorldImporter.cpp:1926
btWorldImporter::createGearConstraint
virtual btGearConstraint * createGearConstraint(btRigidBody &rbA, btRigidBody &rbB, const btVector3 &axisInA, const btVector3 &axisInB, btScalar ratio)
Definition: btWorldImporter.cpp:1878
btWorldImporter::m_nameShapeMap
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
Definition: btWorldImporter.h:94
btWorldImporter::getFixedBody
static btRigidBody & getFixedBody()
Definition: btWorldImporter.cpp:1787
btMultiSphereShapeData::m_localPositionArraySize
int m_localPositionArraySize
Definition: btMultiSphereShape.h:84
btGearConstraintFloatData::m_axisInA
btVector3FloatData m_axisInA
Definition: btGearConstraint.h:102
btWorldImporter::convertConstraintFloat
void convertConstraintFloat(btTypedConstraintFloatData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
Definition: btWorldImporter.cpp:728
btTriangleMeshShapeData::m_meshInterface
btStridingMeshInterfaceData m_meshInterface
Definition: btBvhTriangleMeshShape.h:124
btVector3FloatData
Definition: btVector3.h:1281
btWorldImporter::createHingeConstraint
virtual btHingeConstraint * createHingeConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
Definition: btWorldImporter.cpp:1808
btGeneric6DofSpring2ConstraintDoubleData2::m_linearEquilibriumPoint
btVector3DoubleData m_linearEquilibriumPoint
Definition: btGeneric6DofSpring2Constraint.h:552
btCollisionObjectDoubleData::m_restitution
double m_restitution
Definition: btCollisionObject.h:609
btGeneric6DofSpringConstraint::setDamping
void setDamping(int index, btScalar damping)
Definition: btGeneric6DofSpringConstraint.cpp:65
GIMPACT_SHAPE_PROXYTYPE
Used for GIMPACT Trimesh integration.
Definition: btBroadphaseProxy.h:61
btTransform::setIdentity
void setIdentity()
Set this transformation to the identity.
Definition: btTransform.h:166
btShortIntIndexData::m_value
short m_value
Definition: btStridingMeshInterface.h:102
btRigidBody::setLinearFactor
void setLinearFactor(const btVector3 &linearFactor)
Definition: btRigidBody.h:256
btCollisionObjectFloatData::m_restitution
float m_restitution
Definition: btCollisionObject.h:644
btGeneric6DofConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btGeneric6DofConstraint.h:557
btCapsuleShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btCapsuleShape.h:141
btStridingMeshInterface
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
Definition: btStridingMeshInterface.h:26
btHingeConstraintDoubleData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btHingeConstraint.h:340
btGeneric6DofSpringConstraint::setStiffness
void setStiffness(int index, btScalar stiffness)
Definition: btGeneric6DofSpringConstraint.cpp:59
btWorldImporter::createTriangleMeshContainer
virtual class btTriangleIndexVertexArray * createTriangleMeshContainer()
Definition: btWorldImporter.cpp:1710
btPoint2PointConstraint
point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocke...
Definition: btPoint2PointConstraint.h:52
btVector3::getX
const btScalar & getX() const
Return the x value.
Definition: btVector3.h:561
btGeneric6DofConstraintDoubleData2::m_angularUpperLimit
btVector3DoubleData m_angularUpperLimit
Definition: btGeneric6DofConstraint.h:579
btBvhTriangleMeshShape::setOptimizedBvh
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
Definition: btBvhTriangleMeshShape.cpp:345
btTriangleMeshShapeData::m_collisionMargin
float m_collisionMargin
Definition: btBvhTriangleMeshShape.h:131
btTriangleMeshShapeData::m_triangleInfoMap
btTriangleInfoMapData * m_triangleInfoMap
Definition: btBvhTriangleMeshShape.h:129
btCollisionObjectFloatData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:629
btWorldImporter::deleteAllData
virtual void deleteAllData()
delete all memory collision shapes, rigid bodies, constraints etc.
Definition: btWorldImporter.cpp:32
btCollisionObject::getWorldTransform
btTransform & getWorldTransform()
Definition: btCollisionObject.h:365
btSliderConstraintDoubleData
Definition: btSliderConstraint.h:307
btWorldImporter::duplicateName
char * duplicateName(const char *name)
Definition: btWorldImporter.cpp:491
btShortIntIndexTripletData
Definition: btStridingMeshInterface.h:106
btGeneric6DofSpring2ConstraintDoubleData2::m_linearSpringStiffness
btVector3DoubleData m_linearSpringStiffness
Definition: btGeneric6DofSpring2Constraint.h:550
FIXED_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:44
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:26
btSliderConstraintData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btSliderConstraint.h:291
MULTI_SPHERE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:40
btGeneric6DofSpring2ConstraintDoubleData2::m_angularSpringDamping
btVector3DoubleData m_angularSpringDamping
Definition: btGeneric6DofSpring2Constraint.h:571
btSliderConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btSliderConstraint.h:295
btGearConstraintFloatData::m_axisInB
btVector3FloatData m_axisInB
Definition: btGearConstraint.h:103
btAssert
#define btAssert(x)
Definition: btScalar.h:133
btDynamicsWorld::removeRigidBody
virtual void removeRigidBody(btRigidBody *body)=0
btConvexInternalShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btConvexInternalShape.h:139
btCapsuleShapeX
btCapsuleShapeX represents a capsule around the Z axis the total height is height+2*radius,...
Definition: btCapsuleShape.h:114
btCollisionObject::setRestitution
void setRestitution(btScalar rest)
Definition: btCollisionObject.h:297
btGeneric6DofSpring2Constraint::enableSpring
void enableSpring(int index, bool onOff)
Definition: btGeneric6DofSpring2Constraint.cpp:1126
btConcaveShape::setMargin
virtual void setMargin(btScalar collisionMargin)
Definition: btConcaveShape.h:56
btGImpactMeshShapeData::m_gimpactSubType
int m_gimpactSubType
Definition: btGImpactShape.h:1099
btRigidBodyFloatData::m_inverseMass
float m_inverseMass
Definition: btRigidBody.h:556
btWorldImporter::getNumBvhs
int getNumBvhs() const
Definition: btWorldImporter.cpp:1953
PHY_DOUBLE
Definition: btConcaveShape.h:28
btVector3DoubleData
Definition: btVector3.h:1286
CAPSULE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:41
btHingeConstraintDoubleData::m_biasFactor
float m_biasFactor
Definition: btHingeConstraint.h:354
btGeneric6DofConstraint::setAngularUpperLimit
void setAngularUpperLimit(const btVector3 &angularUpper)
Definition: btGeneric6DofConstraint.h:465
SLIDER_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:40
btPoint2PointConstraintDoubleData2
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btPoint2PointConstraint.h:137
btGeneric6DofSpringConstraintData
Definition: btGeneric6DofSpringConstraint.h:93
btDynamicsWorld::addConstraint
virtual void addConstraint(btTypedConstraint *constraint, bool disableCollisionsBetweenLinkedBodies=false)
Definition: btDynamicsWorld.h:68
btManifoldPoint
ManifoldContactPoint collects and maintains persistent contactpoints.
Definition: btManifoldPoint.h:51
btGeneric6DofSpringConstraintData::m_springEnabled
int m_springEnabled[6]
Definition: btGeneric6DofSpringConstraint.h:97
btTypedConstraintDoubleData::m_breakingImpulseThreshold
double m_breakingImpulseThreshold
Definition: btTypedConstraint.h:427
btMultiSphereShapeData::m_localPositionArrayPtr
btPositionAndRadius * m_localPositionArrayPtr
Definition: btMultiSphereShape.h:83
btMultiSphereShape
The btMultiSphereShape represents the convex hull of a collection of spheres.
Definition: btMultiSphereShape.h:26
btGeneric6DofConstraintData::m_angularUpperLimit
btVector3FloatData m_angularUpperLimit
Definition: btGeneric6DofConstraint.h:563
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
btWorldImporter::m_dynamicsWorld
btDynamicsWorld * m_dynamicsWorld
Definition: btWorldImporter.h:69
btGeneric6DofSpringConstraint
Generic 6 DOF constraint that allows to set spring motors to any translational and rotational DOF.
Definition: btGeneric6DofSpringConstraint.h:41
btGeneric6DofSpring2Constraint::setEquilibriumPoint
void setEquilibriumPoint()
Definition: btGeneric6DofSpring2Constraint.cpp:1165
btGImpactMeshShapeData::m_collisionMargin
float m_collisionMargin
Definition: btGImpactShape.h:1097
HINGE_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:37
btConeTwistConstraintData::m_limitSoftness
float m_limitSoftness
Definition: btConeTwistConstraint.h:387
btGImpactMeshShapeData::m_meshInterface
btStridingMeshInterfaceData m_meshInterface
Definition: btGImpactShape.h:1093
btTypedConstraint::setDbgDrawSize
void setDbgDrawSize(btScalar dbgDrawSize)
Definition: btTypedConstraint.h:307
btGeneric6DofSpring2Constraint::setAngularLowerLimit
void setAngularLowerLimit(const btVector3 &angularLower)
Definition: btGeneric6DofSpring2Constraint.h:361
btAlignedObjectArray::resize
void resize(int newsize, const T &fillData=T())
Definition: btAlignedObjectArray.h:210
btWorldImporter::m_nameBodyMap
btHashMap< btHashString, btRigidBody * > m_nameBodyMap
Definition: btWorldImporter.h:95
btGeneric6DofSpring2ConstraintData::m_linearUpperLimit
btVector3FloatData m_linearUpperLimit
Definition: btGeneric6DofSpring2Constraint.h:492
btIndexedMesh::m_numTriangles
int m_numTriangles
Definition: btTriangleIndexVertexArray.h:30
btBulletDynamicsCommon.h
btMultiSphereShapeData
Definition: btMultiSphereShape.h:79
btHingeConstraintDoubleData2
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btHingeConstraint.h:417
btGeneric6DofSpring2ConstraintDoubleData2::m_linearEnableSpring
char m_linearEnableSpring[4]
Definition: btGeneric6DofSpring2Constraint.h:555
btCylinderShapeX
Definition: btCylinderShape.h:129
btTriangleInfoMap
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
Definition: btTriangleInfoMap.h:53
btGImpactMeshShape::setMargin
virtual void setMargin(btScalar margin)
Definition: btGImpactShape.h:926
btWorldImporter::createConeShapeX
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1689
btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK
Definition: btCollisionObject.h:131
btCollisionObjectFloatData::m_worldTransform
btTransformFloatData m_worldTransform
Definition: btCollisionObject.h:633
SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:55
btWorldImporter::getCollisionShapeByIndex
btCollisionShape * getCollisionShapeByIndex(int index)
Definition: btWorldImporter.cpp:1891
btWorldImporter::createGeneric6DofConstraint
virtual btGeneric6DofConstraint * createGeneric6DofConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
Definition: btWorldImporter.cpp:1836
btGearConstraintDoubleData::m_ratio
double m_ratio
Definition: btGearConstraint.h:116
btWorldImporter::convertRigidBodyFloat
void convertRigidBodyFloat(btRigidBodyFloatData *colObjData)
Definition: btWorldImporter.cpp:1972
btDynamicsWorld::addRigidBody
virtual void addRigidBody(btRigidBody *body)=0
btHingeConstraint::setAngularOnly
void setAngularOnly(bool angularOnly)
Definition: btHingeConstraint.h:154
btWorldImporter::createBvhTriangleMeshShape
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
Definition: btWorldImporter.cpp:1731
btConeTwistConstraintData::m_swingSpan1
float m_swingSpan1
Definition: btConeTwistConstraint.h:384
btPoint2PointConstraintDoubleData::m_pivotInB
btVector3DoubleData m_pivotInB
Definition: btPoint2PointConstraint.h:152
btGearConstraint
The btGeatConstraint will couple the angular velocity for two bodies around given local axis and rati...
Definition: btGearConstraint.h:31
btConeTwistConstraint
btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc)
Definition: btConeTwistConstraint.h:57
btConeTwistConstraintDoubleData::m_damping
double m_damping
Definition: btConeTwistConstraint.h:372
btHingeConstraintDoubleData2::m_limitSoftness
double m_limitSoftness
Definition: btHingeConstraint.h:430
btCompoundShapeData::m_childShapePtr
btCompoundShapeChildData * m_childShapePtr
Definition: btCompoundShape.h:192
btCollisionObject::setFriction
void setFriction(btScalar frict)
Definition: btCollisionObject.h:306
btGeneric6DofSpring2ConstraintData::m_linearSpringStiffnessLimited
char m_linearSpringStiffnessLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:508
btCollisionShape::isNonMoving
bool isNonMoving() const
Definition: btCollisionShape.h:73
btQuantizedBvh::deSerializeDouble
virtual void deSerializeDouble(struct btQuantizedBvhDoubleData &quantizedBvhDoubleData)
Definition: btQuantizedBvh.cpp:1200
btCollisionObject::setWorldTransform
void setWorldTransform(const btTransform &worldTrans)
Definition: btCollisionObject.h:375
btSliderConstraintData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btSliderConstraint.h:303
POINT2POINT_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:36
btSliderConstraint::setLowerLinLimit
void setLowerLinLimit(btScalar lowerLimit)
Definition: btSliderConstraint.h:188
btGeneric6DofConstraintDoubleData2::m_angularLowerLimit
btVector3DoubleData m_angularLowerLimit
Definition: btGeneric6DofConstraint.h:580
btGearConstraintDoubleData
Definition: btGearConstraint.h:109
btGeneric6DofSpringConstraint::enableSpring
void enableSpring(int index, bool onOff)
Definition: btGeneric6DofSpringConstraint.cpp:45
btGeneric6DofSpring2ConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btGeneric6DofSpring2Constraint.h:489
btVector3::setW
void setW(btScalar _w)
Set the w value.
Definition: btVector3.h:573
btGeneric6DofSpring2ConstraintDoubleData2::m_angularSpringDampingLimited
char m_angularSpringDampingLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:577
btHingeConstraintDoubleData::m_limitSoftness
float m_limitSoftness
Definition: btHingeConstraint.h:353
btGeneric6DofSpring2ConstraintDoubleData2::m_linearSpringStiffnessLimited
char m_linearSpringStiffnessLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:556
btWorldImporter::createMeshInterface
virtual btTriangleIndexVertexArray * createMeshInterface(btStridingMeshInterfaceData &meshData)
Definition: btWorldImporter.cpp:1382
btTypedConstraint::setBreakingImpulseThreshold
void setBreakingImpulseThreshold(btScalar threshold)
Definition: btTypedConstraint.h:196
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:28
btGeneric6DofSpringConstraint::setEquilibriumPoint
void setEquilibriumPoint()
Definition: btGeneric6DofSpringConstraint.cpp:71
btHingeConstraintDoubleData::m_lowerLimit
float m_lowerLimit
Definition: btHingeConstraint.h:351
BOX_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:30
btTriangleMeshShapeData::m_quantizedDoubleBvh
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
Definition: btBvhTriangleMeshShape.h:127
btCollisionObject::getCollisionFlags
int getCollisionFlags() const
Definition: btCollisionObject.h:475
ContactAddedCallback
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
Definition: btManifoldResult.h:31
GEAR_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:43
btConvexHullShapeData::m_numUnscaledPoints
int m_numUnscaledPoints
Definition: btConvexHullShape.h:104
btWorldImporter::m_allocatedConstraints
btAlignedObjectArray< btTypedConstraint * > m_allocatedConstraints
Definition: btWorldImporter.h:76
btRigidBodyFloatData::m_collisionObjectData
btCollisionObjectFloatData m_collisionObjectData
Definition: btRigidBody.h:545
btIndexedMesh
The btIndexedMesh indexes a single vertex and index array.
Definition: btTriangleIndexVertexArray.h:25
btGeneric6DofSpringConstraintData::m_equilibriumPoint
float m_equilibriumPoint[6]
Definition: btGeneric6DofSpringConstraint.h:98
btTypedConstraintDoubleData::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:425
btConeShapeZ
btConeShapeZ implements a Cone shape, around the Z axis
Definition: btConeShape.h:125
btHingeConstraintDoubleData::m_maxMotorImpulse
float m_maxMotorImpulse
Definition: btHingeConstraint.h:349
btPoint2PointConstraintDoubleData2::m_pivotInA
btVector3DoubleData m_pivotInA
Definition: btPoint2PointConstraint.h:140
btCompoundShapeData::m_numChildShapes
int m_numChildShapes
Definition: btCompoundShape.h:194
btGeneric6DofSpring2ConstraintData::m_angularEnableSpring
char m_angularEnableSpring[4]
Definition: btGeneric6DofSpring2Constraint.h:527
btCapsuleShape
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
Definition: btCapsuleShape.h:25
btHingeConstraintFloatData::m_motorTargetVelocity
float m_motorTargetVelocity
Definition: btHingeConstraint.h:406
btConeTwistConstraintDoubleData::m_swingSpan1
double m_swingSpan1
Definition: btConeTwistConstraint.h:365
btSphereShape
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
Definition: btSphereShape.h:22
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:80
btWorldImporter::createScaledTrangleMeshShape
virtual class btScaledBvhTriangleMeshShape * createScaledTrangleMeshShape(btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
Definition: btWorldImporter.cpp:1773
btHingeConstraintDoubleData::m_enableAngularMotor
int m_enableAngularMotor
Definition: btHingeConstraint.h:347
btConeTwistConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btConeTwistConstraint.h:381
btHingeConstraintFloatData::m_limitSoftness
float m_limitSoftness
Definition: btHingeConstraint.h:411
btWorldImporter::convertConstraintDouble
void convertConstraintDouble(btTypedConstraintDoubleData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
Definition: btWorldImporter.cpp:1053
btHingeConstraintDoubleData2::m_angularOnly
int m_angularOnly
Definition: btHingeConstraint.h:423
btSliderConstraintDoubleData::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btSliderConstraint.h:319
btDynamicsWorld::setGravity
virtual void setGravity(const btVector3 &gravity)=0
btTransform::getOrigin
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:113
D6_SPRING_2_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:45
btHingeConstraintFloatData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btHingeConstraint.h:401
CONVEX_HULL_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:34
btGeneric6DofSpring2ConstraintDoubleData2::m_linearLowerLimit
btVector3DoubleData m_linearLowerLimit
Definition: btGeneric6DofSpring2Constraint.h:541
btCylinderShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btCylinderShape.h:174
btGeneric6DofSpring2ConstraintDoubleData2::m_angularSpringStiffnessLimited
char m_angularSpringStiffnessLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:576
btIndexedMesh::m_triangleIndexStride
int m_triangleIndexStride
Definition: btTriangleIndexVertexArray.h:33
btGeneric6DofSpring2ConstraintDoubleData2::m_angularSpringStiffness
btVector3DoubleData m_angularSpringStiffness
Definition: btGeneric6DofSpring2Constraint.h:570
btMeshPartData::m_vertices3d
btVector3DoubleData * m_vertices3d
Definition: btStridingMeshInterface.h:124
btHingeConstraintDoubleData2::m_relaxationFactor
double m_relaxationFactor
Definition: btHingeConstraint.h:432
btWorldImporter::m_floatVertexArrays
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
Definition: btWorldImporter.h:88
btTypedConstraintData::m_objectType
int m_objectType
Definition: btTypedConstraint.h:393
btGeneric6DofConstraintDoubleData2::m_linearUpperLimit
btVector3DoubleData m_linearUpperLimit
Definition: btGeneric6DofConstraint.h:576
btRigidBodyDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btRigidBody.h:569
btWorldImporter::btWorldImporter
btWorldImporter(btDynamicsWorld *world)
Definition: btWorldImporter.cpp:21
btConvexInternalShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btConvexInternalShape.h:135
btTypedConstraintFloatData::m_overrideNumSolverIterations
int m_overrideNumSolverIterations
Definition: btTypedConstraint.h:373
btRigidBodyFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btRigidBody.h:543
btIndexedMesh::m_vertexStride
int m_vertexStride
Definition: btTriangleIndexVertexArray.h:37
btQuantizedBvh::deSerializeFloat
virtual void deSerializeFloat(struct btQuantizedBvhFloatData &quantizedBvhFloatData)
Definition: btQuantizedBvh.cpp:1129
btCharIndexTripletData::m_values
unsigned char m_values[3]
Definition: btStridingMeshInterface.h:114
btGeneric6DofConstraintDoubleData2::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btGeneric6DofConstraint.h:573
btConeTwistConstraintData::m_damping
float m_damping
Definition: btConeTwistConstraint.h:391
btGeneric6DofSpring2ConstraintDoubleData2::m_linearUpperLimit
btVector3DoubleData m_linearUpperLimit
Definition: btGeneric6DofSpring2Constraint.h:540
btWorldImporter::createCapsuleShapeZ
virtual btCollisionShape * createCapsuleShapeZ(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1661
btConeTwistConstraintData::m_relaxationFactor
float m_relaxationFactor
Definition: btConeTwistConstraint.h:389
btConvexHullShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btConvexHullShape.h:97
SPHERE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:39
btHingeConstraintFloatData::m_biasFactor
float m_biasFactor
Definition: btHingeConstraint.h:412
btGeneric6DofSpring2ConstraintDoubleData2::m_angularUpperLimit
btVector3DoubleData m_angularUpperLimit
Definition: btGeneric6DofSpring2Constraint.h:560
btWorldImporter::m_allocatedBvhs
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
Definition: btWorldImporter.h:77
btWorldImporter::m_charIndexArrays
btAlignedObjectArray< unsigned char * > m_charIndexArrays
Definition: btWorldImporter.h:86
btBvhTriangleMeshShape::setTriangleInfoMap
void setTriangleInfoMap(btTriangleInfoMap *triangleInfoMap)
Definition: btBvhTriangleMeshShape.h:92
btVector3::getZ
const btScalar & getZ() const
Return the z value.
Definition: btVector3.h:565
btMeshPartData::m_indices32
btIntIndexData * m_indices32
Definition: btStridingMeshInterface.h:126
D6_SPRING_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:42
btGeneric6DofSpring2ConstraintDoubleData2::m_angularEquilibriumPoint
btVector3DoubleData m_angularEquilibriumPoint
Definition: btGeneric6DofSpring2Constraint.h:572
btConvexInternalShapeData::m_collisionMargin
float m_collisionMargin
Definition: btConvexInternalShape.h:143
btGeneric6DofSpring2ConstraintDoubleData2::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btGeneric6DofSpring2Constraint.h:537
btWorldImporter::createConvexHullShape
virtual class btConvexHullShape * createConvexHullShape()
Definition: btWorldImporter.cpp:1759
btGeneric6DofSpring2ConstraintDoubleData2::m_linearSpringDamping
btVector3DoubleData m_linearSpringDamping
Definition: btGeneric6DofSpring2Constraint.h:551
btAlignedObjectArray< btVector3 >
btHingeConstraintDoubleData::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btHingeConstraint.h:344
btHingeConstraintFloatData::m_upperLimit
float m_upperLimit
Definition: btHingeConstraint.h:410
btVector3::getY
const btScalar & getY() const
Return the y value.
Definition: btVector3.h:563
btTypedConstraintDoubleData::m_isEnabled
int m_isEnabled
Definition: btTypedConstraint.h:428
btSliderConstraint::setUpperAngLimit
void setUpperAngLimit(btScalar upperLimit)
Definition: btSliderConstraint.h:194
D6_CONSTRAINT_TYPE
Definition: btTypedConstraint.h:39
btWorldImporter::getNumCollisionShapes
int getNumCollisionShapes() const
Definition: btWorldImporter.cpp:1886
btGeneric6DofSpring2ConstraintData::m_linearSpringDamping
btVector3FloatData m_linearSpringDamping
Definition: btGeneric6DofSpring2Constraint.h:503
btSliderConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btSliderConstraint.h:294
btWorldImporter::createCylinderShapeZ
virtual btCollisionShape * createCylinderShapeZ(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1682
btHashMap::find
const Value * find(const Key &key) const
Definition: btHashMap.h:424
btWorldImporter::createCompoundShape
virtual class btCompoundShape * createCompoundShape()
Definition: btWorldImporter.cpp:1766
btGearConstraintFloatData::m_ratio
float m_ratio
Definition: btGearConstraint.h:105
btWorldImporter::createCollisionObject
virtual btCollisionObject * createCollisionObject(const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
Definition: btWorldImporter.cpp:1590
btConeTwistConstraint::setLimit
void setLimit(int limitIndex, btScalar limitValue)
Definition: btConeTwistConstraint.h:170
btHingeConstraintFloatData
Definition: btHingeConstraint.h:397
btSliderConstraintDoubleData::m_linearUpperLimit
double m_linearUpperLimit
Definition: btSliderConstraint.h:313
btGeneric6DofSpring2Constraint::setLinearLowerLimit
void setLinearLowerLimit(const btVector3 &linearLower)
Definition: btGeneric6DofSpring2Constraint.h:356
btTriangleMeshShapeData::m_quantizedFloatBvh
btQuantizedBvhFloatData * m_quantizedFloatBvh
Definition: btBvhTriangleMeshShape.h:126
btConeTwistConstraintData::m_rbAFrame
btTransformFloatData m_rbAFrame
Definition: btConeTwistConstraint.h:380
btGeneric6DofConstraintData::m_linearLowerLimit
btVector3FloatData m_linearLowerLimit
Definition: btGeneric6DofConstraint.h:561
btCompoundShape
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
Definition: btCompoundShape.h:55
btHingeConstraintDoubleData::m_motorTargetVelocity
float m_motorTargetVelocity
Definition: btHingeConstraint.h:348
btWorldImporter::createConeShapeY
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1696
btWorldImporter::m_shapeMap
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
Definition: btWorldImporter.h:99
btWorldImporter::m_allocatedCollisionShapes
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes
Definition: btWorldImporter.h:74
btConvexHullShape
The btConvexHullShape implements an implicit convex hull of an array of vertices.
Definition: btConvexHullShape.h:25
btWorldImporter::getNumTriangleInfoMaps
int getNumTriangleInfoMaps() const
Definition: btWorldImporter.cpp:1962
btWorldImporter::m_allocatedbtStridingMeshInterfaceDatas
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
Definition: btWorldImporter.h:80
CONST_GIMPACT_TRIMESH_SHAPE
Definition: btGImpactShape.h:48
btRigidBody::setMassProps
void setMassProps(btScalar mass, const btVector3 &inertia)
Definition: btRigidBody.cpp:214
btGeneric6DofConstraintDoubleData2::m_useLinearReferenceFrameA
int m_useLinearReferenceFrameA
Definition: btGeneric6DofConstraint.h:582
btCollisionShape::setMargin
virtual void setMargin(btScalar margin)=0
btWorldImporter::getConstraintByIndex
btTypedConstraint * getConstraintByIndex(int index) const
Definition: btWorldImporter.cpp:1948
btConeTwistConstraintDoubleData::m_relaxationFactor
double m_relaxationFactor
Definition: btConeTwistConstraint.h:370
btShortIntIndexData
Definition: btStridingMeshInterface.h:100
TRIANGLE_MESH_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:54
btGeneric6DofSpring2ConstraintDoubleData2::m_rotateOrder
int m_rotateOrder
Definition: btGeneric6DofSpring2Constraint.h:579
btMeshPartData::m_numTriangles
int m_numTriangles
Definition: btStridingMeshInterface.h:132
btIntIndexData::m_value
int m_value
Definition: btStridingMeshInterface.h:97
btWorldImporter::m_allocatedTriangleIndexArrays
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
Definition: btWorldImporter.h:79
btWorldImporter::createCylinderShapeY
virtual btCollisionShape * createCylinderShapeY(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1675
btCollisionObject::setCollisionFlags
void setCollisionFlags(int flags)
Definition: btCollisionObject.h:480
btScaledTriangleMeshShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btScaledBvhTriangleMeshShape.h:68
btGeneric6DofConstraintDoubleData2
Definition: btGeneric6DofConstraint.h:570
btCompoundShape::addChildShape
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
Definition: btCompoundShape.cpp:50
btCollisionShape::calculateLocalInertia
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const =0
btStaticPlaneShapeData::m_planeNormal
btVector3FloatData m_planeNormal
Definition: btStaticPlaneShape.h:74
btTypedConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btTypedConstraint.h:387
btWorldImporter::getBvhByIndex
btOptimizedBvh * getBvhByIndex(int index) const
Definition: btWorldImporter.cpp:1957
btConvexHullShapeData::m_unscaledPointsDoublePtr
btVector3DoubleData * m_unscaledPointsDoublePtr
Definition: btConvexHullShape.h:102
btDynamicsWorld::removeConstraint
virtual void removeConstraint(btTypedConstraint *constraint)
Definition: btDynamicsWorld.h:74
btHashMap::insert
void insert(const Key &key, const Value &value)
Definition: btHashMap.h:264
btGImpactMeshShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btGImpactShape.h:1095
btStaticPlaneShape
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
Definition: btStaticPlaneShape.h:22
btWorldImporter::m_bvhMap
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
Definition: btWorldImporter.h:91
btGeneric6DofSpring2ConstraintDoubleData2::m_angularLowerLimit
btVector3DoubleData m_angularLowerLimit
Definition: btGeneric6DofSpring2Constraint.h:561
btConeTwistConstraintDoubleData::m_swingSpan2
double m_swingSpan2
Definition: btConeTwistConstraint.h:366
btGeneric6DofSpring2ConstraintData::m_angularEquilibriumPoint
btVector3FloatData m_angularEquilibriumPoint
Definition: btGeneric6DofSpring2Constraint.h:524
btTriangleIndexVertexArray::getNumSubParts
virtual int getNumSubParts() const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertice...
Definition: btTriangleIndexVertexArray.h:105
btStridingMeshInterfaceData::m_meshPartsPtr
btMeshPartData * m_meshPartsPtr
Definition: btStridingMeshInterface.h:140
btGeneric6DofSpring2ConstraintData::m_angularSpringStiffnessLimited
char m_angularSpringStiffnessLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:528
btWorldImporter::createOptimizedBvh
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
Definition: btWorldImporter.cpp:1717
btVector3::deSerializeDouble
void deSerializeDouble(const struct btVector3DoubleData &dataIn)
Definition: btVector3.h:1311
btWorldImporter::convertConstraintBackwardsCompatible281
void convertConstraintBackwardsCompatible281(btTypedConstraintData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
Definition: btWorldImporter.cpp:505
btTriangleIndexVertexArray::addIndexedMesh
void addIndexedMesh(const btIndexedMesh &mesh, PHY_ScalarType indexType=PHY_INTEGER)
Definition: btTriangleIndexVertexArray.h:87
btConeShape
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
Definition: btConeShape.h:23
btGeneric6DofConstraint::setAngularLowerLimit
void setAngularLowerLimit(const btVector3 &angularLower)
Definition: btGeneric6DofConstraint.h:453
btConeTwistConstraintDoubleData
Definition: btConeTwistConstraint.h:358
PHY_INTEGER
Definition: btConcaveShape.h:29
btQuantizedBvh::isQuantized
bool isQuantized()
Definition: btQuantizedBvh.h:453
btCapsuleShape::deSerializeFloat
void deSerializeFloat(struct btCapsuleShapeData *dataBuffer)
Definition: btCapsuleShape.h:173
btTypedConstraint::setEnabled
void setEnabled(bool enabled)
Definition: btTypedConstraint.h:206
btGeneric6DofSpringConstraintDoubleData2::m_equilibriumPoint
double m_equilibriumPoint[6]
Definition: btGeneric6DofSpringConstraint.h:108
btTypedConstraintFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btTypedConstraint.h:358
btWorldImporter::convertCollisionShape
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
Definition: btWorldImporter.cpp:141
btHingeConstraintDoubleData2::m_lowerLimit
double m_lowerLimit
Definition: btHingeConstraint.h:428
btCollisionObjectDoubleData::m_name
char * m_name
Definition: btCollisionObject.h:596
btConeTwistConstraint::setDamping
void setDamping(btScalar damping)
Definition: btConeTwistConstraint.h:296
btTypedConstraintDoubleData::m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
Definition: btTypedConstraint.h:424
btCollisionObjectFloatData::m_friction
float m_friction
Definition: btCollisionObject.h:640
btConvexInternalShape::setMargin
virtual void setMargin(btScalar margin)
Definition: btConvexInternalShape.h:102
btStridingMeshInterfaceData::m_scaling
btVector3FloatData m_scaling
Definition: btStridingMeshInterface.h:141
btWorldImporter::createPoint2PointConstraint
virtual btPoint2PointConstraint * createPoint2PointConstraint(btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB)
constraints
Definition: btWorldImporter.cpp:1794
btHingeConstraintDoubleData2::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btHingeConstraint.h:420
btTypedConstraintFloatData::m_isEnabled
int m_isEnabled
Definition: btTypedConstraint.h:376
btTypedConstraintDoubleData::m_objectType
int m_objectType
Definition: btTypedConstraint.h:416
btCylinderShape
The btCylinderShape class implements a cylinder shape primitive, centered around the origin....
Definition: btCylinderShape.h:24
btGearConstraintFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btGearConstraint.h:98
btHingeConstraintDoubleData2::m_enableAngularMotor
int m_enableAngularMotor
Definition: btHingeConstraint.h:424
btGeneric6DofSpring2ConstraintData::m_linearSpringDampingLimited
char m_linearSpringDampingLimited[4]
Definition: btGeneric6DofSpring2Constraint.h:509
btTransformFloatData::m_origin
btVector3FloatData m_origin
Definition: btTransform.h:247
btGeneric6DofSpring2ConstraintData
Definition: btGeneric6DofSpring2Constraint.h:486
btIntIndexData
Definition: btStridingMeshInterface.h:95
btSliderConstraintDoubleData::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btSliderConstraint.h:310
btWorldImporter::m_nameConstraintMap
btHashMap< btHashString, btTypedConstraint * > m_nameConstraintMap
Definition: btWorldImporter.h:96
btStaticPlaneShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btStaticPlaneShape.h:73
PHY_UCHAR
Definition: btConcaveShape.h:32
btGeneric6DofSpring2Constraint::setDamping
void setDamping(int index, btScalar damping, bool limitIfNeeded=true)
Definition: btGeneric6DofSpring2Constraint.cpp:1150
btGearConstraintDoubleData::m_axisInB
btVector3DoubleData m_axisInB
Definition: btGearConstraint.h:114
btGeneric6DofSpringConstraintData::m_springDamping
float m_springDamping[6]
Definition: btGeneric6DofSpringConstraint.h:100
btGeneric6DofConstraint::setLinearLowerLimit
void setLinearLowerLimit(const btVector3 &linearLower)
Definition: btGeneric6DofConstraint.h:433
btCollisionShape::setLocalScaling
virtual void setLocalScaling(const btVector3 &scaling)=0
btVector3::deSerializeFloat
void deSerializeFloat(const struct btVector3FloatData &dataIn)
Definition: btVector3.h:1298
btGeneric6DofSpringConstraintDoubleData2
Definition: btGeneric6DofSpringConstraint.h:103
btGeneric6DofConstraintDoubleData2::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btGeneric6DofConstraint.h:574
btGearConstraintDoubleData::m_axisInA
btVector3DoubleData m_axisInA
Definition: btGearConstraint.h:113
btTypedConstraintDoubleData::m_name
char * m_name
Definition: btTypedConstraint.h:414
btConeTwistConstraintData::m_swingSpan2
float m_swingSpan2
Definition: btConeTwistConstraint.h:385
btConeTwistConstraintDoubleData::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btConeTwistConstraint.h:361
btHingeConstraintDoubleData2::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btHingeConstraint.h:421
btWorldImporter.h
btConvexHullShape::addPoint
void addPoint(const btVector3 &point, bool recalculateLocalAabb=true)
Definition: btConvexHullShape.cpp:51
btBvhTriangleMeshShape::getTriangleInfoMap
const btTriangleInfoMap * getTriangleInfoMap() const
Definition: btBvhTriangleMeshShape.h:97
btHingeConstraint::setLimit
void setLimit(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Definition: btHingeConstraint.h:175
btConeTwistConstraintData::m_twistSpan
float m_twistSpan
Definition: btConeTwistConstraint.h:386
btStridingMeshInterfaceData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btStridingMeshInterface.h:138
btRigidBodyDoubleData::m_inverseMass
double m_inverseMass
Definition: btRigidBody.h:582
btWorldImporter::createGimpactShape
virtual btGImpactMeshShape * createGimpactShape(btStridingMeshInterface *trimesh)
Definition: btWorldImporter.cpp:1749
btPoint2PointConstraintDoubleData::m_pivotInA
btVector3DoubleData m_pivotInA
Definition: btPoint2PointConstraint.h:151
CONE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:42
btHingeConstraintDoubleData2::m_upperLimit
double m_upperLimit
Definition: btHingeConstraint.h:429
btTriangleIndexVertexArray
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
Definition: btTriangleIndexVertexArray.h:65
btCompoundShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btCompoundShape.h:188
btGeneric6DofConstraintData::m_rbBFrame
btTransformFloatData m_rbBFrame
Definition: btGeneric6DofConstraint.h:558
btWorldImporter::createRigidBody
virtual btRigidBody * createRigidBody(bool isDynamic, btScalar mass, const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
Definition: btWorldImporter.cpp:1604
btPositionAndRadius::m_radius
float m_radius
Definition: btMultiSphereShape.h:74
btAlignedObjectArray::push_back
void push_back(const T &_Val)
Definition: btAlignedObjectArray.h:264
btSliderConstraint::setUpperLinLimit
void setUpperLinLimit(btScalar upperLimit)
Definition: btSliderConstraint.h:190
btPoint2PointConstraintFloatData::m_pivotInA
btVector3FloatData m_pivotInA
Definition: btPoint2PointConstraint.h:132
btTypedConstraintData::m_isEnabled
int m_isEnabled
Definition: btTypedConstraint.h:405
btGeneric6DofSpring2Constraint::setAngularUpperLimit
void setAngularUpperLimit(const btVector3 &angularUpper)
Definition: btGeneric6DofSpring2Constraint.h:385
btHingeConstraintFloatData::m_enableAngularMotor
int m_enableAngularMotor
Definition: btHingeConstraint.h:405
btGImpactMeshShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btGImpactShape.h:1089
btWorldImporter::createConvexTriangleMeshShape
virtual btCollisionShape * createConvexTriangleMeshShape(btStridingMeshInterface *trimesh)
Definition: btWorldImporter.cpp:1745
btGImpactShapeInterface::updateBound
void updateBound()
performs refit operation
Definition: btGImpactShape.h:115
btIndexedMesh::m_vertexBase
const unsigned char * m_vertexBase
Definition: btTriangleIndexVertexArray.h:35
btCylinderShapeZ
Definition: btCylinderShape.h:151
btWorldImporter::getTriangleInfoMapByIndex
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
Definition: btWorldImporter.cpp:1967
btCapsuleShapeData::m_upAxis
int m_upAxis
Definition: btCapsuleShape.h:145
btGeneric6DofSpringConstraintDoubleData2::m_6dofData
btGeneric6DofConstraintDoubleData2 m_6dofData
Definition: btGeneric6DofSpringConstraint.h:105
STATIC_PLANE_PROXYTYPE
Definition: btBroadphaseProxy.h:66
btSliderConstraintData::m_useOffsetForConstraintFrame
int m_useOffsetForConstraintFrame
Definition: btSliderConstraint.h:304
btWorldImporter::createCapsuleShapeX
virtual btCollisionShape * createCapsuleShapeX(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1647
btTransform::deSerializeFloat
void deSerializeFloat(const struct btTransformFloatData &dataIn)
Definition: btTransform.h:274
btTransform::deSerializeDouble
void deSerializeDouble(const struct btTransformDoubleData &dataIn)
Definition: btTransform.h:280
btWorldImporter::getRigidBodyByName
btRigidBody * getRigidBodyByName(const char *name)
Definition: btWorldImporter.cpp:1906
btGeneric6DofConstraint::setLinearUpperLimit
void setLinearUpperLimit(const btVector3 &linearUpper)
Definition: btGeneric6DofConstraint.h:443
btTypedConstraintData::m_breakingImpulseThreshold
float m_breakingImpulseThreshold
Definition: btTypedConstraint.h:404
btGeneric6DofSpring2ConstraintDoubleData2
Definition: btGeneric6DofSpring2Constraint.h:534
btTransform::setOrigin
void setOrigin(const btVector3 &origin)
Set the translational element.
Definition: btTransform.h:146
btGeneric6DofSpring2ConstraintData::m_angularSpringStiffness
btVector3FloatData m_angularSpringStiffness
Definition: btGeneric6DofSpring2Constraint.h:522
btWorldImporter::setDynamicsWorldInfo
virtual void setDynamicsWorldInfo(const btVector3 &gravity, const btContactSolverInfo &solverInfo)
those virtuals are called by load and can be overridden by the user
Definition: btWorldImporter.cpp:1595
btHingeConstraintDoubleData::m_angularOnly
int m_angularOnly
Definition: btHingeConstraint.h:346
btHingeConstraint::enableAngularMotor
void enableAngularMotor(bool enableMotor, btScalar targetVelocity, btScalar maxMotorImpulse)
Definition: btHingeConstraint.h:159
btConeTwistConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btConeTwistConstraint.h:377
btWorldImporter::m_shortIndexArrays
btAlignedObjectArray< short int * > m_shortIndexArrays
Definition: btWorldImporter.h:85
btIndexedMesh::m_numVertices
int m_numVertices
Definition: btTriangleIndexVertexArray.h:34
btConeShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
Definition: btConeShape.h:143
btScaledBvhTriangleMeshShape
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
Definition: btScaledBvhTriangleMeshShape.h:23
btTypedConstraintData::m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
Definition: btTypedConstraint.h:401
btWorldImporter::m_allocatedRigidBodies
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
Definition: btWorldImporter.h:75
btWorldImporter::createCapsuleShapeY
virtual btCollisionShape * createCapsuleShapeY(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1654
btHingeConstraintDoubleData::m_rbAFrame
btTransformDoubleData m_rbAFrame
Definition: btHingeConstraint.h:343
btSliderConstraintDoubleData::m_rbBFrame
btTransformDoubleData m_rbBFrame
Definition: btSliderConstraint.h:311
btSliderConstraint
Definition: btSliderConstraint.h:65
btWorldImporter::m_doubleVertexArrays
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
Definition: btWorldImporter.h:89
btWorldImporter::createTriangleInfoMap
virtual btTriangleInfoMap * createTriangleInfoMap()
Definition: btWorldImporter.cpp:1724
btWorldImporter::createCylinderShapeX
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
Definition: btWorldImporter.cpp:1668
btTypedConstraintData::m_name
char * m_name
Definition: btTypedConstraint.h:391
btWorldImporter::createConeTwistConstraint
virtual btConeTwistConstraint * createConeTwistConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame)
Definition: btWorldImporter.cpp:1822
btVector3FloatData::m_floats
float m_floats[4]
Definition: btVector3.h:1283
btCapsuleShapeZ
btCapsuleShapeZ represents a capsule around the Z axis the total height is height+2*radius,...
Definition: btCapsuleShape.h:128
btGeneric6DofSpringConstraintDoubleData2::m_springDamping
double m_springDamping[6]
Definition: btGeneric6DofSpringConstraint.h:110
btRigidBody::upcast
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
Definition: btRigidBody.h:189
btGeneric6DofSpring2ConstraintData::m_linearEquilibriumPoint
btVector3FloatData m_linearEquilibriumPoint
Definition: btGeneric6DofSpring2Constraint.h:504
btWorldImporter::createPlaneShape
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
Definition: btWorldImporter.cpp:1628
btCollisionObjectDoubleData::m_friction
double m_friction
Definition: btCollisionObject.h:605
btIndexedMesh::m_indexType
PHY_ScalarType m_indexType
Definition: btTriangleIndexVertexArray.h:41
btGeneric6DofConstraintData::m_angularLowerLimit
btVector3FloatData m_angularLowerLimit
Definition: btGeneric6DofConstraint.h:564
btScaledTriangleMeshShapeData::m_trimeshShapeData
btTriangleMeshShapeData m_trimeshShapeData
Definition: btScaledBvhTriangleMeshShape.h:66
btConvexInternalShapeData::m_implicitShapeDimensions
btVector3FloatData m_implicitShapeDimensions
Definition: btConvexInternalShape.h:141
btGImpactShape.h
btConeShapeX
btConeShape implements a Cone shape, around the X axis
Definition: btConeShape.h:107
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:149
btMeshPartData::m_3indices8
btCharIndexTripletData * m_3indices8
Definition: btStridingMeshInterface.h:128
btRigidBodyDoubleData::m_linearFactor
btVector3DoubleData m_linearFactor
Definition: btRigidBody.h:576
PHY_SHORT
Definition: btConcaveShape.h:30
btWorldImporter::createGeneric6DofSpringConstraint
virtual btGeneric6DofSpringConstraint * createGeneric6DofSpringConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
Definition: btWorldImporter.cpp:1857
COMPOUND_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:71
btWorldImporter::m_allocatedTriangleInfoMaps
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
Definition: btWorldImporter.h:78
btTypedConstraintDoubleData
Definition: btTypedConstraint.h:410