Bullet Collision Detection & Physics Library: btCollisionWorldImporter.cpp Source File

Bullet Collision Detection & Physics Library

btCollisionWorldImporter.cpp
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2014 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 "btCollisionWorldImporter.h"
17 #include "btBulletCollisionCommon.h"
18 #include "LinearMath/btSerializer.h" //for btBulletSerializedArrays definition
19
20 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
21 #include "BulletCollision/Gimpact/btGImpactShape.h"
22 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT
23
24 btCollisionWorldImporter::btCollisionWorldImporter(btCollisionWorld* world)
25 :m_collisionWorld(world),
26 m_verboseMode(0)
27 {
28
29 }
30
31 btCollisionWorldImporter::~btCollisionWorldImporter()
32 {
33 }
34
35
36
37
38
39 bool btCollisionWorldImporter::convertAllObjects( btBulletSerializedArrays* arrays)
40 {
41
42 m_shapeMap.clear();
43 m_bodyMap.clear();
44
45 int i;
46
47 for (i=0;i<arrays->m_bvhsDouble.size();i++)
48 {
49 btOptimizedBvh* bvh = createOptimizedBvh();
50 btQuantizedBvhDoubleData* bvhData = arrays->m_bvhsDouble[i];
51 bvh->deSerializeDouble(*bvhData);
52 m_bvhMap.insert(arrays->m_bvhsDouble[i],bvh);
53 }
54 for (i=0;i<arrays->m_bvhsFloat.size();i++)
55 {
56 btOptimizedBvh* bvh = createOptimizedBvh();
57 btQuantizedBvhFloatData* bvhData = arrays->m_bvhsFloat[i];
58 bvh->deSerializeFloat(*bvhData);
59 m_bvhMap.insert(arrays->m_bvhsFloat[i],bvh);
60 }
61
62
63
64
65
66 for (i=0;i<arrays->m_colShapeData.size();i++)
67 {
68 btCollisionShapeData* shapeData = arrays->m_colShapeData[i];
69 btCollisionShape* shape = convertCollisionShape(shapeData);
70 if (shape)
71 {
72 // printf("shapeMap.insert(%x,%x)\n",shapeData,shape);
73 m_shapeMap.insert(shapeData,shape);
74 }
75
76 if (shape&& shapeData->m_name)
77 {
78 char* newname = duplicateName(shapeData->m_name);
79 m_objectNameMap.insert(shape,newname);
80 m_nameShapeMap.insert(newname,shape);
81 }
82 }
83
84
85 for (i=0;i<arrays->m_collisionObjectDataDouble.size();i++)
86 {
87 btCollisionObjectDoubleData* colObjData = arrays->m_collisionObjectDataDouble[i];
88 btCollisionShape** shapePtr = m_shapeMap.find(colObjData->m_collisionShape);
89 if (shapePtr && *shapePtr)
90 {
91 btTransform startTransform;
92 colObjData->m_worldTransform.m_origin.m_floats[3] = 0.f;
93 startTransform.deSerializeDouble(colObjData->m_worldTransform);
94
95 btCollisionShape* shape = (btCollisionShape*)*shapePtr;
96 btCollisionObject* body = createCollisionObject(startTransform,shape,colObjData->m_name);
97 body->setFriction(btScalar(colObjData->m_friction));
98 body->setRestitution(btScalar(colObjData->m_restitution));
99
100 #ifdef USE_INTERNAL_EDGE_UTILITY
101 if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
102 {
103 btBvhTriangleMeshShape* trimesh = (btBvhTriangleMeshShape*)shape;
104 if (trimesh->getTriangleInfoMap())
105 {
106 body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
107 }
108 }
109 #endif //USE_INTERNAL_EDGE_UTILITY
110 m_bodyMap.insert(colObjData,body);
111 } else
112 {
113 printf("error: no shape found\n");
114 }
115 }
116 for (i=0;i<arrays->m_collisionObjectDataFloat.size();i++)
117 {
118 btCollisionObjectFloatData* colObjData = arrays->m_collisionObjectDataFloat[i];
119 btCollisionShape** shapePtr = m_shapeMap.find(colObjData->m_collisionShape);
120 if (shapePtr && *shapePtr)
121 {
122 btTransform startTransform;
123 colObjData->m_worldTransform.m_origin.m_floats[3] = 0.f;
124 startTransform.deSerializeFloat(colObjData->m_worldTransform);
125
126 btCollisionShape* shape = (btCollisionShape*)*shapePtr;
127 btCollisionObject* body = createCollisionObject(startTransform,shape,colObjData->m_name);
128
129 #ifdef USE_INTERNAL_EDGE_UTILITY
130 if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
131 {
132 btBvhTriangleMeshShape* trimesh = (btBvhTriangleMeshShape*)shape;
133 if (trimesh->getTriangleInfoMap())
134 {
135 body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
136 }
137 }
138 #endif //USE_INTERNAL_EDGE_UTILITY
139 m_bodyMap.insert(colObjData,body);
140 } else
141 {
142 printf("error: no shape found\n");
143 }
144 }
145
146 return true;
147 }
148
149
150
151 void btCollisionWorldImporter::deleteAllData()
152 {
153 int i;
154
155 for (i=0;i<m_allocatedCollisionObjects.size();i++)
156 {
157 if(m_collisionWorld)
158 m_collisionWorld->removeCollisionObject(m_allocatedCollisionObjects[i]);
159 delete m_allocatedCollisionObjects[i];
160 }
161
162 m_allocatedCollisionObjects.clear();
163
164
165 for (i=0;i<m_allocatedCollisionShapes.size();i++)
166 {
167 delete m_allocatedCollisionShapes[i];
168 }
169 m_allocatedCollisionShapes.clear();
170
171
172 for (i=0;i<m_allocatedBvhs.size();i++)
173 {
174 delete m_allocatedBvhs[i];
175 }
176 m_allocatedBvhs.clear();
177
178 for (i=0;i<m_allocatedTriangleInfoMaps.size();i++)
179 {
180 delete m_allocatedTriangleInfoMaps[i];
181 }
182 m_allocatedTriangleInfoMaps.clear();
183 for (i=0;i<m_allocatedTriangleIndexArrays.size();i++)
184 {
185 delete m_allocatedTriangleIndexArrays[i];
186 }
187 m_allocatedTriangleIndexArrays.clear();
188 for (i=0;i<m_allocatedNames.size();i++)
189 {
190 delete[] m_allocatedNames[i];
191 }
192 m_allocatedNames.clear();
193
194 for (i=0;i<m_allocatedbtStridingMeshInterfaceDatas.size();i++)
195 {
196 btStridingMeshInterfaceData* curData = m_allocatedbtStridingMeshInterfaceDatas[i];
197
198 for(int a = 0;a < curData->m_numMeshParts;a++)
199 {
200 btMeshPartData* curPart = &curData->m_meshPartsPtr[a];
201 if(curPart->m_vertices3f)
202 delete [] curPart->m_vertices3f;
203
204 if(curPart->m_vertices3d)
205 delete [] curPart->m_vertices3d;
206
207 if(curPart->m_indices32)
208 delete [] curPart->m_indices32;
209
210 if(curPart->m_3indices16)
211 delete [] curPart->m_3indices16;
212
213 if(curPart->m_indices16)
214 delete [] curPart->m_indices16;
215
216 if (curPart->m_3indices8)
217 delete [] curPart->m_3indices8;
218
219 }
220 delete [] curData->m_meshPartsPtr;
221 delete curData;
222 }
223 m_allocatedbtStridingMeshInterfaceDatas.clear();
224
225 for (i=0;i<m_indexArrays.size();i++)
226 {
227 btAlignedFree(m_indexArrays[i]);
228 }
229 m_indexArrays.clear();
230
231 for (i=0;i<m_shortIndexArrays.size();i++)
232 {
233 btAlignedFree(m_shortIndexArrays[i]);
234 }
235 m_shortIndexArrays.clear();
236
237 for (i=0;i<m_charIndexArrays.size();i++)
238 {
239 btAlignedFree(m_charIndexArrays[i]);
240 }
241 m_charIndexArrays.clear();
242
243 for (i=0;i<m_floatVertexArrays.size();i++)
244 {
245 btAlignedFree(m_floatVertexArrays[i]);
246 }
247 m_floatVertexArrays.clear();
248
249 for (i=0;i<m_doubleVertexArrays.size();i++)
250 {
251 btAlignedFree(m_doubleVertexArrays[i]);
252 }
253 m_doubleVertexArrays.clear();
254
255
256 }
257
258
259
260 btCollisionShape* btCollisionWorldImporter::convertCollisionShape( btCollisionShapeData* shapeData )
261 {
262 btCollisionShape* shape = 0;
263
264 switch (shapeData->m_shapeType)
265 {
266 case STATIC_PLANE_PROXYTYPE:
267 {
268 btStaticPlaneShapeData* planeData = (btStaticPlaneShapeData*)shapeData;
269 btVector3 planeNormal,localScaling;
270 planeNormal.deSerializeFloat(planeData->m_planeNormal);
271 localScaling.deSerializeFloat(planeData->m_localScaling);
272 shape = createPlaneShape(planeNormal,planeData->m_planeConstant);
273 shape->setLocalScaling(localScaling);
274
275 break;
276 }
277 case SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE:
278 {
279 btScaledTriangleMeshShapeData* scaledMesh = (btScaledTriangleMeshShapeData*) shapeData;
280 btCollisionShapeData* colShapeData = (btCollisionShapeData*) &scaledMesh->m_trimeshShapeData;
281 colShapeData->m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
282 btCollisionShape* childShape = convertCollisionShape(colShapeData);
283 btBvhTriangleMeshShape* meshShape = (btBvhTriangleMeshShape*)childShape;
284 btVector3 localScaling;
285 localScaling.deSerializeFloat(scaledMesh->m_localScaling);
286
287 shape = createScaledTrangleMeshShape(meshShape, localScaling);
288 break;
289 }
290 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
291 case GIMPACT_SHAPE_PROXYTYPE:
292 {
293 btGImpactMeshShapeData* gimpactData = (btGImpactMeshShapeData*) shapeData;
294 if (gimpactData->m_gimpactSubType == CONST_GIMPACT_TRIMESH_SHAPE)
295 {
296 btStridingMeshInterfaceData* interfaceData = createStridingMeshInterfaceData(&gimpactData->m_meshInterface);
297 btTriangleIndexVertexArray* meshInterface = createMeshInterface(*interfaceData);
298
299
300 btGImpactMeshShape* gimpactShape = createGimpactShape(meshInterface);
301 btVector3 localScaling;
302 localScaling.deSerializeFloat(gimpactData->m_localScaling);
303 gimpactShape->setLocalScaling(localScaling);
304 gimpactShape->setMargin(btScalar(gimpactData->m_collisionMargin));
305 gimpactShape->updateBound();
306 shape = gimpactShape;
307 } else
308 {
309 printf("unsupported gimpact sub type\n");
310 }
311 break;
312 }
313 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT
314 //The btCapsuleShape* API has issue passing the margin/scaling/halfextents unmodified through the API
315 //so deal with this
316 case CAPSULE_SHAPE_PROXYTYPE:
317 {
318 btCapsuleShapeData* capData = (btCapsuleShapeData*)shapeData;
319
320
321 switch (capData->m_upAxis)
322 {
323 case 0:
324 {
325 shape = createCapsuleShapeX(1,1);
326 break;
327 }
328 case 1:
329 {
330 shape = createCapsuleShapeY(1,1);
331 break;
332 }
333 case 2:
334 {
335 shape = createCapsuleShapeZ(1,1);
336 break;
337 }
338 default:
339 {
340 printf("error: wrong up axis for btCapsuleShape\n");
341 }
342
343
344 };
345 if (shape)
346 {
347 btCapsuleShape* cap = (btCapsuleShape*) shape;
348 cap->deSerializeFloat(capData);
349 }
350 break;
351 }
352 case CYLINDER_SHAPE_PROXYTYPE:
353 case CONE_SHAPE_PROXYTYPE:
354 case BOX_SHAPE_PROXYTYPE:
355 case SPHERE_SHAPE_PROXYTYPE:
356 case MULTI_SPHERE_SHAPE_PROXYTYPE:
357 case CONVEX_HULL_SHAPE_PROXYTYPE:
358 {
359 btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData;
360 btVector3 implicitShapeDimensions;
361 implicitShapeDimensions.deSerializeFloat(bsd->m_implicitShapeDimensions);
362 btVector3 localScaling;
363 localScaling.deSerializeFloat(bsd->m_localScaling);
364 btVector3 margin(bsd->m_collisionMargin,bsd->m_collisionMargin,bsd->m_collisionMargin);
365 switch (shapeData->m_shapeType)
366 {
367 case BOX_SHAPE_PROXYTYPE:
368 {
369 btBoxShape* box= (btBoxShape*)createBoxShape(implicitShapeDimensions/localScaling+margin);
370 //box->initializePolyhedralFeatures();
371 shape = box;
372
373 break;
374 }
375 case SPHERE_SHAPE_PROXYTYPE:
376 {
377 shape = createSphereShape(implicitShapeDimensions.getX());
378 break;
379 }
380
381 case CYLINDER_SHAPE_PROXYTYPE:
382 {
383 btCylinderShapeData* cylData = (btCylinderShapeData*) shapeData;
384 btVector3 halfExtents = implicitShapeDimensions+margin;
385 switch (cylData->m_upAxis)
386 {
387 case 0:
388 {
389 shape = createCylinderShapeX(halfExtents.getY(),halfExtents.getX());
390 break;
391 }
392 case 1:
393 {
394 shape = createCylinderShapeY(halfExtents.getX(),halfExtents.getY());
395 break;
396 }
397 case 2:
398 {
399 shape = createCylinderShapeZ(halfExtents.getX(),halfExtents.getZ());
400 break;
401 }
402 default:
403 {
404 printf("unknown Cylinder up axis\n");
405 }
406
407 };
408
409
410
411 break;
412 }
413 case CONE_SHAPE_PROXYTYPE:
414 {
415 btConeShapeData* conData = (btConeShapeData*) shapeData;
416 btVector3 halfExtents = implicitShapeDimensions;//+margin;
417 switch (conData->m_upIndex)
418 {
419 case 0:
420 {
421 shape = createConeShapeX(halfExtents.getY(),halfExtents.getX());
422 break;
423 }
424 case 1:
425 {
426 shape = createConeShapeY(halfExtents.getX(),halfExtents.getY());
427 break;
428 }
429 case 2:
430 {
431 shape = createConeShapeZ(halfExtents.getX(),halfExtents.getZ());
432 break;
433 }
434 default:
435 {
436 printf("unknown Cone up axis\n");
437 }
438
439 };
440
441
442
443 break;
444 }
445 case MULTI_SPHERE_SHAPE_PROXYTYPE:
446 {
447 btMultiSphereShapeData* mss = (btMultiSphereShapeData*)bsd;
448 int numSpheres = mss->m_localPositionArraySize;
449
450 btAlignedObjectArray<btVector3> tmpPos;
451 btAlignedObjectArray<btScalar> radii;
452 radii.resize(numSpheres);
453 tmpPos.resize(numSpheres);
454 int i;
455 for ( i=0;i<numSpheres;i++)
456 {
457 tmpPos[i].deSerializeFloat(mss->m_localPositionArrayPtr[i].m_pos);
458 radii[i] = mss->m_localPositionArrayPtr[i].m_radius;
459 }
460 shape = createMultiSphereShape(&tmpPos[0],&radii[0],numSpheres);
461 break;
462 }
463 case CONVEX_HULL_SHAPE_PROXYTYPE:
464 {
465 // int sz = sizeof(btConvexHullShapeData);
466 // int sz2 = sizeof(btConvexInternalShapeData);
467 // int sz3 = sizeof(btCollisionShapeData);
468 btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd;
469 int numPoints = convexData->m_numUnscaledPoints;
470
471 btAlignedObjectArray<btVector3> tmpPoints;
472 tmpPoints.resize(numPoints);
473 int i;
474 for ( i=0;i<numPoints;i++)
475 {
476 #ifdef BT_USE_DOUBLE_PRECISION
477 if (convexData->m_unscaledPointsDoublePtr)
478 tmpPoints[i].deSerialize(convexData->m_unscaledPointsDoublePtr[i]);
479 if (convexData->m_unscaledPointsFloatPtr)
480 tmpPoints[i].deSerializeFloat(convexData->m_unscaledPointsFloatPtr[i]);
481 #else
482 if (convexData->m_unscaledPointsFloatPtr)
483 tmpPoints[i].deSerialize(convexData->m_unscaledPointsFloatPtr[i]);
484 if (convexData->m_unscaledPointsDoublePtr)
485 tmpPoints[i].deSerializeDouble(convexData->m_unscaledPointsDoublePtr[i]);
486 #endif //BT_USE_DOUBLE_PRECISION
487 }
488 btConvexHullShape* hullShape = createConvexHullShape();
489 for (i=0;i<numPoints;i++)
490 {
491 hullShape->addPoint(tmpPoints[i]);
492 }
493 hullShape->setMargin(bsd->m_collisionMargin);
494 //hullShape->initializePolyhedralFeatures();
495 shape = hullShape;
496 break;
497 }
498 default:
499 {
500 printf("error: cannot create shape type (%d)\n",shapeData->m_shapeType);
501 }
502 }
503
504 if (shape)
505 {
506 shape->setMargin(bsd->m_collisionMargin);
507
508 btVector3 localScaling;
509 localScaling.deSerializeFloat(bsd->m_localScaling);
510 shape->setLocalScaling(localScaling);
511
512 }
513 break;
514 }
515 case TRIANGLE_MESH_SHAPE_PROXYTYPE:
516 {
517 btTriangleMeshShapeData* trimesh = (btTriangleMeshShapeData*)shapeData;
518 btStridingMeshInterfaceData* interfaceData = createStridingMeshInterfaceData(&trimesh->m_meshInterface);
519 btTriangleIndexVertexArray* meshInterface = createMeshInterface(*interfaceData);
520 if (!meshInterface->getNumSubParts())
521 {
522 return 0;
523 }
524
525 btVector3 scaling; scaling.deSerializeFloat(trimesh->m_meshInterface.m_scaling);
526 meshInterface->setScaling(scaling);
527
528
529 btOptimizedBvh* bvh = 0;
530 #if 1
531 if (trimesh->m_quantizedFloatBvh)
532 {
533 btOptimizedBvh** bvhPtr = m_bvhMap.find(trimesh->m_quantizedFloatBvh);
534 if (bvhPtr && *bvhPtr)
535 {
536 bvh = *bvhPtr;
537 } else
538 {
539 bvh = createOptimizedBvh();
540 bvh->deSerializeFloat(*trimesh->m_quantizedFloatBvh);
541 }
542 }
543 if (trimesh->m_quantizedDoubleBvh)
544 {
545 btOptimizedBvh** bvhPtr = m_bvhMap.find(trimesh->m_quantizedDoubleBvh);
546 if (bvhPtr && *bvhPtr)
547 {
548 bvh = *bvhPtr;
549 } else
550 {
551 bvh = createOptimizedBvh();
552 bvh->deSerializeDouble(*trimesh->m_quantizedDoubleBvh);
553 }
554 }
555 #endif
556
557
558 btBvhTriangleMeshShape* trimeshShape = createBvhTriangleMeshShape(meshInterface,bvh);
559 trimeshShape->setMargin(trimesh->m_collisionMargin);
560 shape = trimeshShape;
561
562 if (trimesh->m_triangleInfoMap)
563 {
564 btTriangleInfoMap* map = createTriangleInfoMap();
565 map->deSerialize(*trimesh->m_triangleInfoMap);
566 trimeshShape->setTriangleInfoMap(map);
567
568 #ifdef USE_INTERNAL_EDGE_UTILITY
569 gContactAddedCallback = btAdjustInternalEdgeContactsCallback;
570 #endif //USE_INTERNAL_EDGE_UTILITY
571
572 }
573
574 //printf("trimesh->m_collisionMargin=%f\n",trimesh->m_collisionMargin);
575 break;
576 }
577 case COMPOUND_SHAPE_PROXYTYPE:
578 {
579 btCompoundShapeData* compoundData = (btCompoundShapeData*)shapeData;
580 btCompoundShape* compoundShape = createCompoundShape();
581
582 //btCompoundShapeChildData* childShapeDataArray = &compoundData->m_childShapePtr[0];
583
584
585 btAlignedObjectArray<btCollisionShape*> childShapes;
586 for (int i=0;i<compoundData->m_numChildShapes;i++)
587 {
588 //btCompoundShapeChildData* ptr = &compoundData->m_childShapePtr[i];
589
590 btCollisionShapeData* cd = compoundData->m_childShapePtr[i].m_childShape;
591
592 btCollisionShape* childShape = convertCollisionShape(cd);
593 if (childShape)
594 {
595 btTransform localTransform;
596 localTransform.deSerializeFloat(compoundData->m_childShapePtr[i].m_transform);
597 compoundShape->addChildShape(localTransform,childShape);
598 } else
599 {
600 #ifdef _DEBUG
601 printf("error: couldn't create childShape for compoundShape\n");
602 #endif
603 }
604
605 }
606 shape = compoundShape;
607
608 break;
609 }
610 case SOFTBODY_SHAPE_PROXYTYPE:
611 {
612 return 0;
613 }
614 default:
615 {
616 #ifdef _DEBUG
617 printf("unsupported shape type (%d)\n",shapeData->m_shapeType);
618 #endif
619 }
620 }
621
622 return shape;
623
624 }
625
626
627
628 char* btCollisionWorldImporter::duplicateName(const char* name)
629 {
630 if (name)
631 {
632 int l = (int)strlen(name);
633 char* newName = new char[l+1];
634 memcpy(newName,name,l);
635 newName[l] = 0;
636 m_allocatedNames.push_back(newName);
637 return newName;
638 }
639 return 0;
640 }
641
642
643
644
645
646
647
648
649
650
651
652 btTriangleIndexVertexArray* btCollisionWorldImporter::createMeshInterface(btStridingMeshInterfaceData& meshData)
653 {
654 btTriangleIndexVertexArray* meshInterface = createTriangleMeshContainer();
655
656 for (int i=0;i<meshData.m_numMeshParts;i++)
657 {
658 btIndexedMesh meshPart;
659 meshPart.m_numTriangles = meshData.m_meshPartsPtr[i].m_numTriangles;
660 meshPart.m_numVertices = meshData.m_meshPartsPtr[i].m_numVertices;
661
662
663 if (meshData.m_meshPartsPtr[i].m_indices32)
664 {
665 meshPart.m_indexType = PHY_INTEGER;
666 meshPart.m_triangleIndexStride = 3*sizeof(int);
667 int* indexArray = (int*)btAlignedAlloc(sizeof(int)*3*meshPart.m_numTriangles,16);
668 m_indexArrays.push_back(indexArray);
669 for (int j=0;j<3*meshPart.m_numTriangles;j++)
670 {
671 indexArray[j] = meshData.m_meshPartsPtr[i].m_indices32[j].m_value;
672 }
673 meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
674 } else
675 {
676 if (meshData.m_meshPartsPtr[i].m_3indices16)
677 {
678 meshPart.m_indexType = PHY_SHORT;
679 meshPart.m_triangleIndexStride = sizeof(short int)*3;//sizeof(btShortIntIndexTripletData);
680
681 short int* indexArray = (short int*)btAlignedAlloc(sizeof(short int)*3*meshPart.m_numTriangles,16);
682 m_shortIndexArrays.push_back(indexArray);
683
684 for (int j=0;j<meshPart.m_numTriangles;j++)
685 {
686 indexArray[3*j] = meshData.m_meshPartsPtr[i].m_3indices16[j].m_values[0];
687 indexArray[3*j+1] = meshData.m_meshPartsPtr[i].m_3indices16[j].m_values[1];
688 indexArray[3*j+2] = meshData.m_meshPartsPtr[i].m_3indices16[j].m_values[2];
689 }
690
691 meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
692 }
693 if (meshData.m_meshPartsPtr[i].m_indices16)
694 {
695 meshPart.m_indexType = PHY_SHORT;
696 meshPart.m_triangleIndexStride = 3*sizeof(short int);
697 short int* indexArray = (short int*)btAlignedAlloc(sizeof(short int)*3*meshPart.m_numTriangles,16);
698 m_shortIndexArrays.push_back(indexArray);
699 for (int j=0;j<3*meshPart.m_numTriangles;j++)
700 {
701 indexArray[j] = meshData.m_meshPartsPtr[i].m_indices16[j].m_value;
702 }
703
704 meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
705 }
706
707 if (meshData.m_meshPartsPtr[i].m_3indices8)
708 {
709 meshPart.m_indexType = PHY_UCHAR;
710 meshPart.m_triangleIndexStride = sizeof(unsigned char)*3;
711
712 unsigned char* indexArray = (unsigned char*)btAlignedAlloc(sizeof(unsigned char)*3*meshPart.m_numTriangles,16);
713 m_charIndexArrays.push_back(indexArray);
714
715 for (int j=0;j<meshPart.m_numTriangles;j++)
716 {
717 indexArray[3*j] = meshData.m_meshPartsPtr[i].m_3indices8[j].m_values[0];
718 indexArray[3*j+1] = meshData.m_meshPartsPtr[i].m_3indices8[j].m_values[1];
719 indexArray[3*j+2] = meshData.m_meshPartsPtr[i].m_3indices8[j].m_values[2];
720 }
721
722 meshPart.m_triangleIndexBase = (const unsigned char*)indexArray;
723 }
724 }
725
726 if (meshData.m_meshPartsPtr[i].m_vertices3f)
727 {
728 meshPart.m_vertexType = PHY_FLOAT;
729 meshPart.m_vertexStride = sizeof(btVector3FloatData);
730 btVector3FloatData* vertices = (btVector3FloatData*) btAlignedAlloc(sizeof(btVector3FloatData)*meshPart.m_numVertices,16);
731 m_floatVertexArrays.push_back(vertices);
732
733 for (int j=0;j<meshPart.m_numVertices;j++)
734 {
735 vertices[j].m_floats[0] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[0];
736 vertices[j].m_floats[1] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[1];
737 vertices[j].m_floats[2] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[2];
738 vertices[j].m_floats[3] = meshData.m_meshPartsPtr[i].m_vertices3f[j].m_floats[3];
739 }
740 meshPart.m_vertexBase = (const unsigned char*)vertices;
741 } else
742 {
743 meshPart.m_vertexType = PHY_DOUBLE;
744 meshPart.m_vertexStride = sizeof(btVector3DoubleData);
745
746
747 btVector3DoubleData* vertices = (btVector3DoubleData*) btAlignedAlloc(sizeof(btVector3DoubleData)*meshPart.m_numVertices,16);
748 m_doubleVertexArrays.push_back(vertices);
749
750 for (int j=0;j<meshPart.m_numVertices;j++)
751 {
752 vertices[j].m_floats[0] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[0];
753 vertices[j].m_floats[1] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[1];
754 vertices[j].m_floats[2] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[2];
755 vertices[j].m_floats[3] = meshData.m_meshPartsPtr[i].m_vertices3d[j].m_floats[3];
756 }
757 meshPart.m_vertexBase = (const unsigned char*)vertices;
758 }
759
760 if (meshPart.m_triangleIndexBase && meshPart.m_vertexBase)
761 {
762 meshInterface->addIndexedMesh(meshPart,meshPart.m_indexType);
763 }
764 }
765
766 return meshInterface;
767 }
768
769
770 btStridingMeshInterfaceData* btCollisionWorldImporter::createStridingMeshInterfaceData(btStridingMeshInterfaceData* interfaceData)
771 {
772 //create a new btStridingMeshInterfaceData that is an exact copy of shapedata and store it in the WorldImporter
773 btStridingMeshInterfaceData* newData = new btStridingMeshInterfaceData;
774
775 newData->m_scaling = interfaceData->m_scaling;
776 newData->m_numMeshParts = interfaceData->m_numMeshParts;
777 newData->m_meshPartsPtr = new btMeshPartData[newData->m_numMeshParts];
778
779 for(int i = 0;i < newData->m_numMeshParts;i++)
780 {
781 btMeshPartData* curPart = &interfaceData->m_meshPartsPtr[i];
782 btMeshPartData* curNewPart = &newData->m_meshPartsPtr[i];
783
784 curNewPart->m_numTriangles = curPart->m_numTriangles;
785 curNewPart->m_numVertices = curPart->m_numVertices;
786
787 if(curPart->m_vertices3f)
788 {
789 curNewPart->m_vertices3f = new btVector3FloatData[curNewPart->m_numVertices];
790 memcpy(curNewPart->m_vertices3f,curPart->m_vertices3f,sizeof(btVector3FloatData) * curNewPart->m_numVertices);
791 }
792 else
793 curNewPart->m_vertices3f = NULL;
794
795 if(curPart->m_vertices3d)
796 {
797 curNewPart->m_vertices3d = new btVector3DoubleData[curNewPart->m_numVertices];
798 memcpy(curNewPart->m_vertices3d,curPart->m_vertices3d,sizeof(btVector3DoubleData) * curNewPart->m_numVertices);
799 }
800 else
801 curNewPart->m_vertices3d = NULL;
802
803 int numIndices = curNewPart->m_numTriangles * 3;
806 bool uninitialized3indices8Workaround =false;
807
808 if(curPart->m_indices32)
809 {
810 uninitialized3indices8Workaround=true;
811 curNewPart->m_indices32 = new btIntIndexData[numIndices];
812 memcpy(curNewPart->m_indices32,curPart->m_indices32,sizeof(btIntIndexData) * numIndices);
813 }
814 else
815 curNewPart->m_indices32 = NULL;
816
817 if(curPart->m_3indices16)
818 {
819 uninitialized3indices8Workaround=true;
820 curNewPart->m_3indices16 = new btShortIntIndexTripletData[curNewPart->m_numTriangles];
821 memcpy(curNewPart->m_3indices16,curPart->m_3indices16,sizeof(btShortIntIndexTripletData) * curNewPart->m_numTriangles);
822 }
823 else
824 curNewPart->m_3indices16 = NULL;
825
826 if(curPart->m_indices16)
827 {
828 uninitialized3indices8Workaround=true;
829 curNewPart->m_indices16 = new btShortIntIndexData[numIndices];
830 memcpy(curNewPart->m_indices16,curPart->m_indices16,sizeof(btShortIntIndexData) * numIndices);
831 }
832 else
833 curNewPart->m_indices16 = NULL;
834
835 if(!uninitialized3indices8Workaround && curPart->m_3indices8)
836 {
837 curNewPart->m_3indices8 = new btCharIndexTripletData[curNewPart->m_numTriangles];
838 memcpy(curNewPart->m_3indices8,curPart->m_3indices8,sizeof(btCharIndexTripletData) * curNewPart->m_numTriangles);
839 }
840 else
841 curNewPart->m_3indices8 = NULL;
842
843 }
844
845 m_allocatedbtStridingMeshInterfaceDatas.push_back(newData);
846
847 return(newData);
848 }
849
850 #ifdef USE_INTERNAL_EDGE_UTILITY
851 extern ContactAddedCallback gContactAddedCallback;
852
853 static bool btAdjustInternalEdgeContactsCallback(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
854 {
855
856 btAdjustInternalEdgeContacts(cp,colObj1,colObj0, partId1,index1);
857 //btAdjustInternalEdgeContacts(cp,colObj1,colObj0, partId1,index1, BT_TRIANGLE_CONVEX_BACKFACE_MODE);
858 //btAdjustInternalEdgeContacts(cp,colObj1,colObj0, partId1,index1, BT_TRIANGLE_CONVEX_DOUBLE_SIDED+BT_TRIANGLE_CONCAVE_DOUBLE_SIDED);
859 return true;
860 }
861 #endif //USE_INTERNAL_EDGE_UTILITY
862
863
864 /*
865 btRigidBody* btWorldImporter::createRigidBody(bool isDynamic, btScalar mass, const btTransform& startTransform,btCollisionShape* shape,const char* bodyName)
866 {
867 btVector3 localInertia;
868 localInertia.setZero();
869
870 if (mass)
871 shape->calculateLocalInertia(mass,localInertia);
872
873 btRigidBody* body = new btRigidBody(mass,0,shape,localInertia);
874 body->setWorldTransform(startTransform);
875
876 if (m_dynamicsWorld)
877 m_dynamicsWorld->addRigidBody(body);
878
879 if (bodyName)
880 {
881 char* newname = duplicateName(bodyName);
882 m_objectNameMap.insert(body,newname);
883 m_nameBodyMap.insert(newname,body);
884 }
885 m_allocatedRigidBodies.push_back(body);
886 return body;
887
888 }
889 */
890
891 btCollisionObject* btCollisionWorldImporter::getCollisionObjectByName(const char* name)
892 {
893 btCollisionObject** bodyPtr = m_nameColObjMap.find(name);
894 if (bodyPtr && *bodyPtr)
895 {
896 return *bodyPtr;
897 }
898 return 0;
899 }
900
901 btCollisionObject* btCollisionWorldImporter::createCollisionObject(const btTransform& startTransform,btCollisionShape* shape, const char* bodyName)
902 {
903 btCollisionObject* colObj = new btCollisionObject();
904 colObj->setWorldTransform(startTransform);
905 colObj->setCollisionShape(shape);
906 m_collisionWorld->addCollisionObject(colObj);//todo: flags etc
907
908 if (bodyName)
909 {
910 char* newname = duplicateName(bodyName);
911 m_objectNameMap.insert(colObj,newname);
912 m_nameColObjMap.insert(newname,colObj);
913 }
914 m_allocatedCollisionObjects.push_back(colObj);
915
916 return colObj;
917 }
918
919
920
921 btCollisionShape* btCollisionWorldImporter::createPlaneShape(const btVector3& planeNormal,btScalar planeConstant)
922 {
923 btStaticPlaneShape* shape = new btStaticPlaneShape(planeNormal,planeConstant);
924 m_allocatedCollisionShapes.push_back(shape);
925 return shape;
926 }
927 btCollisionShape* btCollisionWorldImporter::createBoxShape(const btVector3& halfExtents)
928 {
929 btBoxShape* shape = new btBoxShape(halfExtents);
930 m_allocatedCollisionShapes.push_back(shape);
931 return shape;
932 }
933 btCollisionShape* btCollisionWorldImporter::createSphereShape(btScalar radius)
934 {
935 btSphereShape* shape = new btSphereShape(radius);
936 m_allocatedCollisionShapes.push_back(shape);
937 return shape;
938 }
939
940
941 btCollisionShape* btCollisionWorldImporter::createCapsuleShapeX(btScalar radius, btScalar height)
942 {
943 btCapsuleShapeX* shape = new btCapsuleShapeX(radius,height);
944 m_allocatedCollisionShapes.push_back(shape);
945 return shape;
946 }
947
948 btCollisionShape* btCollisionWorldImporter::createCapsuleShapeY(btScalar radius, btScalar height)
949 {
950 btCapsuleShape* shape = new btCapsuleShape(radius,height);
951 m_allocatedCollisionShapes.push_back(shape);
952 return shape;
953 }
954
955 btCollisionShape* btCollisionWorldImporter::createCapsuleShapeZ(btScalar radius, btScalar height)
956 {
957 btCapsuleShapeZ* shape = new btCapsuleShapeZ(radius,height);
958 m_allocatedCollisionShapes.push_back(shape);
959 return shape;
960 }
961
962 btCollisionShape* btCollisionWorldImporter::createCylinderShapeX(btScalar radius,btScalar height)
963 {
964 btCylinderShapeX* shape = new btCylinderShapeX(btVector3(height,radius,radius));
965 m_allocatedCollisionShapes.push_back(shape);
966 return shape;
967 }
968
969 btCollisionShape* btCollisionWorldImporter::createCylinderShapeY(btScalar radius,btScalar height)
970 {
971 btCylinderShape* shape = new btCylinderShape(btVector3(radius,height,radius));
972 m_allocatedCollisionShapes.push_back(shape);
973 return shape;
974 }
975
976 btCollisionShape* btCollisionWorldImporter::createCylinderShapeZ(btScalar radius,btScalar height)
977 {
978 btCylinderShapeZ* shape = new btCylinderShapeZ(btVector3(radius,radius,height));
979 m_allocatedCollisionShapes.push_back(shape);
980 return shape;
981 }
982
983 btCollisionShape* btCollisionWorldImporter::createConeShapeX(btScalar radius,btScalar height)
984 {
985 btConeShapeX* shape = new btConeShapeX(radius,height);
986 m_allocatedCollisionShapes.push_back(shape);
987 return shape;
988 }
989
990 btCollisionShape* btCollisionWorldImporter::createConeShapeY(btScalar radius,btScalar height)
991 {
992 btConeShape* shape = new btConeShape(radius,height);
993 m_allocatedCollisionShapes.push_back(shape);
994 return shape;
995 }
996
997 btCollisionShape* btCollisionWorldImporter::createConeShapeZ(btScalar radius,btScalar height)
998 {
999 btConeShapeZ* shape = new btConeShapeZ(radius,height);
1000 m_allocatedCollisionShapes.push_back(shape);
1001 return shape;
1002 }
1003
1004 btTriangleIndexVertexArray* btCollisionWorldImporter::createTriangleMeshContainer()
1005 {
1006 btTriangleIndexVertexArray* in = new btTriangleIndexVertexArray();
1007 m_allocatedTriangleIndexArrays.push_back(in);
1008 return in;
1009 }
1010
1011 btOptimizedBvh* btCollisionWorldImporter::createOptimizedBvh()
1012 {
1013 btOptimizedBvh* bvh = new btOptimizedBvh();
1014 m_allocatedBvhs.push_back(bvh);
1015 return bvh;
1016 }
1017
1018
1019 btTriangleInfoMap* btCollisionWorldImporter::createTriangleInfoMap()
1020 {
1021 btTriangleInfoMap* tim = new btTriangleInfoMap();
1022 m_allocatedTriangleInfoMaps.push_back(tim);
1023 return tim;
1024 }
1025
1026 btBvhTriangleMeshShape* btCollisionWorldImporter::createBvhTriangleMeshShape(btStridingMeshInterface* trimesh, btOptimizedBvh* bvh)
1027 {
1028 if (bvh)
1029 {
1030 btBvhTriangleMeshShape* bvhTriMesh = new btBvhTriangleMeshShape(trimesh,bvh->isQuantized(), false);
1031 bvhTriMesh->setOptimizedBvh(bvh);
1032 m_allocatedCollisionShapes.push_back(bvhTriMesh);
1033 return bvhTriMesh;
1034 }
1035
1036 btBvhTriangleMeshShape* ts = new btBvhTriangleMeshShape(trimesh,true);
1037 m_allocatedCollisionShapes.push_back(ts);
1038 return ts;
1039
1040 }
1041 btCollisionShape* btCollisionWorldImporter::createConvexTriangleMeshShape(btStridingMeshInterface* trimesh)
1042 {
1043 return 0;
1044 }
1045 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
1046 btGImpactMeshShape* btCollisionWorldImporter::createGimpactShape(btStridingMeshInterface* trimesh)
1047 {
1048 btGImpactMeshShape* shape = new btGImpactMeshShape(trimesh);
1049 m_allocatedCollisionShapes.push_back(shape);
1050 return shape;
1051
1052 }
1053 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT
1054
1055 btConvexHullShape* btCollisionWorldImporter::createConvexHullShape()
1056 {
1057 btConvexHullShape* shape = new btConvexHullShape();
1058 m_allocatedCollisionShapes.push_back(shape);
1059 return shape;
1060 }
1061
1062 btCompoundShape* btCollisionWorldImporter::createCompoundShape()
1063 {
1064 btCompoundShape* shape = new btCompoundShape();
1065 m_allocatedCollisionShapes.push_back(shape);
1066 return shape;
1067 }
1068
1069
1070 btScaledBvhTriangleMeshShape* btCollisionWorldImporter::createScaledTrangleMeshShape(btBvhTriangleMeshShape* meshShape,const btVector3& localScaling)
1071 {
1072 btScaledBvhTriangleMeshShape* shape = new btScaledBvhTriangleMeshShape(meshShape,localScaling);
1073 m_allocatedCollisionShapes.push_back(shape);
1074 return shape;
1075 }
1076
1077 btMultiSphereShape* btCollisionWorldImporter::createMultiSphereShape(const btVector3* positions,const btScalar* radi,int numSpheres)
1078 {
1079 btMultiSphereShape* shape = new btMultiSphereShape(positions, radi, numSpheres);
1080 m_allocatedCollisionShapes.push_back(shape);
1081 return shape;
1082 }
1083
1084
1085
1086 // query for data
1087 int btCollisionWorldImporter::getNumCollisionShapes() const
1088 {
1089 return m_allocatedCollisionShapes.size();
1090 }
1091
1092 btCollisionShape* btCollisionWorldImporter::getCollisionShapeByIndex(int index)
1093 {
1094 return m_allocatedCollisionShapes[index];
1095 }
1096
1097 btCollisionShape* btCollisionWorldImporter::getCollisionShapeByName(const char* name)
1098 {
1099 btCollisionShape** shapePtr = m_nameShapeMap.find(name);
1100 if (shapePtr&& *shapePtr)
1101 {
1102 return *shapePtr;
1103 }
1104 return 0;
1105 }
1106
1107
1108 const char* btCollisionWorldImporter::getNameForPointer(const void* ptr) const
1109 {
1110 const char*const * namePtr = m_objectNameMap.find(ptr);
1111 if (namePtr && *namePtr)
1112 return *namePtr;
1113 return 0;
1114 }
1115
1116
1117 int btCollisionWorldImporter::getNumRigidBodies() const
1118 {
1119 return m_allocatedRigidBodies.size();
1120 }
1121
1122 btCollisionObject* btCollisionWorldImporter::getRigidBodyByIndex(int index) const
1123 {
1124 return m_allocatedRigidBodies[index];
1125 }
1126
1127
1128 int btCollisionWorldImporter::getNumBvhs() const
1129 {
1130 return m_allocatedBvhs.size();
1131 }
1132 btOptimizedBvh* btCollisionWorldImporter::getBvhByIndex(int index) const
1133 {
1134 return m_allocatedBvhs[index];
1135 }
1136
1137 int btCollisionWorldImporter::getNumTriangleInfoMaps() const
1138 {
1139 return m_allocatedTriangleInfoMaps.size();
1140 }
1141
1142 btTriangleInfoMap* btCollisionWorldImporter::getTriangleInfoMapByIndex(int index) const
1143 {
1144 return m_allocatedTriangleInfoMaps[index];
1145 }
1146
1147
btCollisionWorldImporter::getNumRigidBodies
int getNumRigidBodies() const
Definition: btCollisionWorldImporter.cpp:1117
SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:56
btHashMap::clear
void clear()
Definition: btHashMap.h:472
btIndexedMesh::m_numTriangles
int m_numTriangles
Definition: btTriangleIndexVertexArray.h:30
btCollisionObjectFloatData::m_worldTransform
btTransformFloatData m_worldTransform
Definition: btCollisionObject.h:644
btBvhTriangleMeshShape::getTriangleInfoMap
const btTriangleInfoMap * getTriangleInfoMap() const
Definition: btBvhTriangleMeshShape.h:102
btScaledTriangleMeshShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btScaledBvhTriangleMeshShape.h:70
btStridingMeshInterfaceData::m_meshPartsPtr
btMeshPartData * m_meshPartsPtr
Definition: btStridingMeshInterface.h:148
btCollisionObjectFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:637
CONE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:43
btAlignedObjectArray::push_back
void push_back(const T &_Val)
Definition: btAlignedObjectArray.h:274
SPHERE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:40
btCompoundShapeData::m_childShapePtr
btCompoundShapeChildData * m_childShapePtr
Definition: btCompoundShape.h:192
btCollisionWorldImporter::m_allocatedTriangleIndexArrays
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
Definition: btCollisionWorldImporter.h:64
btStaticPlaneShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btStaticPlaneShape.h:72
btTransform::deSerializeFloat
void deSerializeFloat(const struct btTransformFloatData &dataIn)
Definition: btTransform.h:286
SOFTBODY_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:73
btCollisionWorldImporter::m_allocatedCollisionShapes
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes
Definition: btCollisionWorldImporter.h:59
btCollisionWorldImporter::createOptimizedBvh
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
Definition: btCollisionWorldImporter.cpp:1011
btCollisionWorldImporter::getNumBvhs
int getNumBvhs() const
Definition: btCollisionWorldImporter.cpp:1128
btIntIndexData::m_value
int m_value
Definition: btStridingMeshInterface.h:106
PHY_UCHAR
Definition: btConcaveShape.h:31
btIndexedMesh
The btIndexedMesh indexes a single vertex and index array.
Definition: btTriangleIndexVertexArray.h:26
btCollisionWorldImporter::m_indexArrays
btAlignedObjectArray< int * > m_indexArrays
Definition: btCollisionWorldImporter.h:71
btCollisionWorldImporter::createCollisionObject
virtual btCollisionObject * createCollisionObject(const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
those virtuals are called by load and can be overridden by the user
Definition: btCollisionWorldImporter.cpp:901
btGImpactMeshShape::setLocalScaling
virtual void setLocalScaling(const btVector3 &scaling)
Definition: btGImpactShape.h:964
btAlignedObjectArray< btVector3 >
btQuantizedBvhFloatData
Definition: btQuantizedBvh.h:539
btCollisionWorldImporter::createCylinderShapeZ
virtual btCollisionShape * createCylinderShapeZ(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:976
btCollisionWorldImporter::createMeshInterface
virtual btTriangleIndexVertexArray * createMeshInterface(btStridingMeshInterfaceData &meshData)
Definition: btCollisionWorldImporter.cpp:652
btCollisionWorldImporter::m_doubleVertexArrays
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
Definition: btCollisionWorldImporter.h:76
btVector3DoubleData::m_floats
double m_floats[4]
Definition: btVector3.h:1319
btCollisionWorldImporter::createCylinderShapeX
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:962
btBulletCollisionCommon.h
btCollisionWorldImporter::duplicateName
char * duplicateName(const char *name)
Definition: btCollisionWorldImporter.cpp:628
btHashMap::find
const Value * find(const Key &key) const
Definition: btHashMap.h:434
btShortIntIndexData::m_value
short m_value
Definition: btStridingMeshInterface.h:111
btCollisionWorld::addCollisionObject
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
Definition: btCollisionWorld.cpp:111
btCollisionWorldImporter::createTriangleInfoMap
virtual btTriangleInfoMap * createTriangleInfoMap()
Definition: btCollisionWorldImporter.cpp:1019
btBulletSerializedArrays::m_bvhsFloat
btAlignedObjectArray< struct btQuantizedBvhFloatData * > m_bvhsFloat
Definition: btSerializer.h:148
btBulletSerializedArrays::m_bvhsDouble
btAlignedObjectArray< struct btQuantizedBvhDoubleData * > m_bvhsDouble
Definition: btSerializer.h:147
btMultiSphereShapeData::m_localPositionArraySize
int m_localPositionArraySize
Definition: btMultiSphereShape.h:88
btMultiSphereShape
The btMultiSphereShape represents the convex hull of a collection of spheres.
Definition: btMultiSphereShape.h:28
btScaledTriangleMeshShapeData::m_trimeshShapeData
btTriangleMeshShapeData m_trimeshShapeData
Definition: btScaledBvhTriangleMeshShape.h:72
CAPSULE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:42
btCharIndexTripletData
Definition: btStridingMeshInterface.h:121
btStaticPlaneShapeData::m_planeConstant
float m_planeConstant
Definition: btStaticPlaneShape.h:78
btCollisionWorldImporter::createSphereShape
virtual btCollisionShape * createSphereShape(btScalar radius)
Definition: btCollisionWorldImporter.cpp:933
TRIANGLE_MESH_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:55
btCapsuleShape
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
Definition: btCapsuleShape.h:26
btConvexHullShapeData::m_unscaledPointsDoublePtr
btVector3DoubleData * m_unscaledPointsDoublePtr
Definition: btConvexHullShape.h:106
CONST_GIMPACT_TRIMESH_SHAPE
Definition: btGImpactShape.h:50
btCollisionWorldImporter::m_allocatedbtStridingMeshInterfaceDatas
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
Definition: btCollisionWorldImporter.h:65
btCollisionWorldImporter::getNumTriangleInfoMaps
int getNumTriangleInfoMaps() const
Definition: btCollisionWorldImporter.cpp:1137
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:27
btGImpactShape.h
btCollisionWorldImporter::m_collisionWorld
btCollisionWorld * m_collisionWorld
Definition: btCollisionWorldImporter.h:55
btCapsuleShapeX
btCapsuleShapeX represents a capsule around the Z axis the total height is height+2*radius, so the height is just the height between the center of each &#39;sphere&#39; of the capsule caps.
Definition: btCapsuleShape.h:116
btConeShapeX
btConeShape implements a Cone shape, around the X axis
Definition: btConeShape.h:113
btVector3::getY
const btScalar & getY() const
Return the y value.
Definition: btVector3.h:575
btCollisionWorldImporter::createCapsuleShapeX
virtual btCollisionShape * createCapsuleShapeX(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:941
btSphereShape
The btSphereShape implements an implicit sphere, centered around a local origin with radius...
Definition: btSphereShape.h:22
btStridingMeshInterface::setScaling
void setScaling(const btVector3 &scaling)
Definition: btStridingMeshInterface.h:91
btCollisionObjectDoubleData::m_name
char * m_name
Definition: btCollisionObject.h:607
btMeshPartData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btStridingMeshInterface.h:129
btManifoldPoint
ManifoldContactPoint collects and maintains persistent contactpoints.
Definition: btManifoldPoint.h:49
btTriangleMeshShapeData::m_meshInterface
btStridingMeshInterfaceData m_meshInterface
Definition: btBvhTriangleMeshShape.h:128
btMeshPartData::m_numVertices
int m_numVertices
Definition: btStridingMeshInterface.h:141
btConvexInternalShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btConvexInternalShape.h:144
btCollisionWorldImporter::createConvexHullShape
virtual class btConvexHullShape * createConvexHullShape()
Definition: btCollisionWorldImporter.cpp:1055
btCollisionWorldImporter.h
btCollisionShapeData::m_shapeType
int m_shapeType
Definition: btCollisionShape.h:158
btMeshPartData::m_vertices3f
btVector3FloatData * m_vertices3f
Definition: btStridingMeshInterface.h:131
btCompoundShape::addChildShape
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
Definition: btCompoundShape.cpp:51
btVector3FloatData::m_floats
float m_floats[4]
Definition: btVector3.h:1314
BOX_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:31
btGImpactMeshShape
This class manages a mesh supplied by the btStridingMeshInterface interface.
Definition: btGImpactShape.h:890
GIMPACT_SHAPE_PROXYTYPE
Used for GIMPACT Trimesh integration.
Definition: btBroadphaseProxy.h:62
btTriangleMeshShapeData::m_triangleInfoMap
btTriangleInfoMapData * m_triangleInfoMap
Definition: btBvhTriangleMeshShape.h:133
btConcaveShape::setMargin
virtual void setMargin(btScalar collisionMargin)
Definition: btConcaveShape.h:53
btMeshPartData::m_numTriangles
int m_numTriangles
Definition: btStridingMeshInterface.h:140
btCollisionWorldImporter::createPlaneShape
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
Definition: btCollisionWorldImporter.cpp:921
btCollisionWorldImporter::m_nameColObjMap
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
Definition: btCollisionWorldImporter.h:83
btShortIntIndexTripletData
Definition: btStridingMeshInterface.h:115
btCollisionWorldImporter::createBvhTriangleMeshShape
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
Definition: btCollisionWorldImporter.cpp:1026
btCollisionWorldImporter::m_bodyMap
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
Definition: btCollisionWorldImporter.h:88
btCollisionObject::setRestitution
void setRestitution(btScalar rest)
Definition: btCollisionObject.h:304
btCollisionWorldImporter::m_allocatedNames
btAlignedObjectArray< char * > m_allocatedNames
Definition: btCollisionWorldImporter.h:69
btCollisionShapeData::m_name
char * m_name
Definition: btCollisionShape.h:157
btShortIntIndexTripletData::m_values
short m_values[3]
Definition: btStridingMeshInterface.h:117
btConvexInternalShapeData::m_collisionMargin
float m_collisionMargin
Definition: btConvexInternalShape.h:152
btCollisionWorldImporter::getNumCollisionShapes
int getNumCollisionShapes() const
Definition: btCollisionWorldImporter.cpp:1087
btIndexedMesh::m_indexType
PHY_ScalarType m_indexType
Definition: btTriangleIndexVertexArray.h:41
btMeshPartData::m_indices16
btShortIntIndexData * m_indices16
Definition: btStridingMeshInterface.h:138
btAlignedObjectArray::clear
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
Definition: btAlignedObjectArray.h:190
btCollisionWorldImporter::m_charIndexArrays
btAlignedObjectArray< unsigned char * > m_charIndexArrays
Definition: btCollisionWorldImporter.h:73
btCollisionWorldImporter::getNameForPointer
const char * getNameForPointer(const void *ptr) const
Definition: btCollisionWorldImporter.cpp:1108
btMeshPartData::m_3indices8
btCharIndexTripletData * m_3indices8
Definition: btStridingMeshInterface.h:136
btCollisionObject::setCollisionShape
virtual void setCollisionShape(btCollisionShape *collisionShape)
Definition: btCollisionObject.h:221
btCollisionWorldImporter::getRigidBodyByIndex
btCollisionObject * getRigidBodyByIndex(int index) const
Definition: btCollisionWorldImporter.cpp:1122
btVector3::getZ
const btScalar & getZ() const
Return the z value.
Definition: btVector3.h:577
btCylinderShapeZ
Definition: btCylinderShape.h:160
btBvhTriangleMeshShape
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
Definition: btBvhTriangleMeshShape.h:34
btCollisionObjectDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:602
btStridingMeshInterfaceData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btStridingMeshInterface.h:146
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:449
btGImpactMeshShapeData::m_collisionMargin
float m_collisionMargin
Definition: btGImpactShape.h:1153
btCollisionWorldImporter::createCompoundShape
virtual class btCompoundShape * createCompoundShape()
Definition: btCollisionWorldImporter.cpp:1062
btTriangleIndexVertexArray
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
Definition: btTriangleIndexVertexArray.h:68
btCollisionObjectFloatData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:640
CYLINDER_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:45
btConvexInternalShape::setMargin
virtual void setMargin(btScalar margin)
Definition: btConvexInternalShape.h:109
btCapsuleShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCapsuleShape.h:149
btCollisionWorldImporter::createCapsuleShapeZ
virtual btCollisionShape * createCapsuleShapeZ(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:955
btConvexHullShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btConvexHullShape.h:101
btMeshPartData::m_3indices16
btShortIntIndexTripletData * m_3indices16
Definition: btStridingMeshInterface.h:135
btTriangleIndexVertexArray::addIndexedMesh
void addIndexedMesh(const btIndexedMesh &mesh, PHY_ScalarType indexType=PHY_INTEGER)
Definition: btTriangleIndexVertexArray.h:90
btIndexedMesh::m_triangleIndexStride
int m_triangleIndexStride
Definition: btTriangleIndexVertexArray.h:33
btBulletSerializedArrays::m_collisionObjectDataFloat
btAlignedObjectArray< struct btCollisionObjectFloatData * > m_collisionObjectDataFloat
Definition: btSerializer.h:155
btTransformFloatData::m_origin
btVector3FloatData m_origin
Definition: btTransform.h:256
btCollisionWorldImporter::getBvhByIndex
btOptimizedBvh * getBvhByIndex(int index) const
Definition: btCollisionWorldImporter.cpp:1132
btCollisionObject::setFriction
void setFriction(btScalar frict)
Definition: btCollisionObject.h:313
btCollisionWorldImporter::createScaledTrangleMeshShape
virtual class btScaledBvhTriangleMeshShape * createScaledTrangleMeshShape(btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
Definition: btCollisionWorldImporter.cpp:1070
btConeShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btConeShape.h:153
btShortIntIndexData
Definition: btStridingMeshInterface.h:109
btQuantizedBvh::deSerializeDouble
virtual void deSerializeDouble(struct btQuantizedBvhDoubleData &quantizedBvhDoubleData)
Definition: btQuantizedBvh.cpp:1238
btBulletSerializedArrays::m_colShapeData
btAlignedObjectArray< struct btCollisionShapeData * > m_colShapeData
Definition: btSerializer.h:149
btConeShape
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
Definition: btConeShape.h:23
PHY_DOUBLE
Definition: btConcaveShape.h:27
PHY_SHORT
Definition: btConcaveShape.h:29
btCharIndexTripletData::m_values
unsigned char m_values[3]
Definition: btStridingMeshInterface.h:123
btMultiSphereShapeData::m_localPositionArrayPtr
btPositionAndRadius * m_localPositionArrayPtr
Definition: btMultiSphereShape.h:87
btGImpactMeshShapeData::m_meshInterface
btStridingMeshInterfaceData m_meshInterface
Definition: btGImpactShape.h:1149
btStridingMeshInterfaceData::m_numMeshParts
int m_numMeshParts
Definition: btStridingMeshInterface.h:150
btCompoundShapeChildData::m_transform
btTransformFloatData m_transform
Definition: btCompoundShape.h:181
MULTI_SPHERE_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:41
btCollisionObjectDoubleData::m_friction
double m_friction
Definition: btCollisionObject.h:616
btAlignedFree
#define btAlignedFree(ptr)
Definition: btAlignedAllocator.h:48
btPositionAndRadius::m_pos
btVector3FloatData m_pos
Definition: btMultiSphereShape.h:79
btCollisionWorldImporter::convertCollisionShape
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
Definition: btCollisionWorldImporter.cpp:260
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:49
btBvhTriangleMeshShape::setOptimizedBvh
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
Definition: btBvhTriangleMeshShape.cpp:356
btCollisionWorldImporter::m_floatVertexArrays
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
Definition: btCollisionWorldImporter.h:75
btHashMap::insert
void insert(const Key &key, const Value &value)
Definition: btHashMap.h:274
btOptimizedBvh
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
Definition: btOptimizedBvh.h:27
btConvexInternalShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btConvexInternalShape.h:148
btCollisionWorld::removeCollisionObject
virtual void removeCollisionObject(btCollisionObject *collisionObject)
Definition: btCollisionWorld.cpp:237
btStridingMeshInterfaceData::m_scaling
btVector3FloatData m_scaling
Definition: btStridingMeshInterface.h:149
btCollisionShape::setMargin
virtual void setMargin(btScalar margin)=0
btGImpactMeshShapeData::m_gimpactSubType
int m_gimpactSubType
Definition: btGImpactShape.h:1155
btIndexedMesh::m_triangleIndexBase
const unsigned char * m_triangleIndexBase
Definition: btTriangleIndexVertexArray.h:31
btPositionAndRadius::m_radius
float m_radius
Definition: btMultiSphereShape.h:80
btCollisionObject::setWorldTransform
void setWorldTransform(const btTransform &worldTrans)
Definition: btCollisionObject.h:382
btConvexInternalShapeData::m_implicitShapeDimensions
btVector3FloatData m_implicitShapeDimensions
Definition: btConvexInternalShape.h:150
btConvexHullShapeData::m_unscaledPointsFloatPtr
btVector3FloatData * m_unscaledPointsFloatPtr
Definition: btConvexHullShape.h:105
btScaledTriangleMeshShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btScaledBvhTriangleMeshShape.h:74
btCollisionShape::setLocalScaling
virtual void setLocalScaling(const btVector3 &scaling)=0
btTriangleMeshShapeData::m_quantizedDoubleBvh
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
Definition: btBvhTriangleMeshShape.h:131
btCollisionObject::getCollisionFlags
int getCollisionFlags() const
Definition: btCollisionObject.h:485
btCollisionWorldImporter::m_allocatedRigidBodies
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
Definition: btCollisionWorldImporter.h:60
btCollisionWorldImporter::m_shapeMap
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
Definition: btCollisionWorldImporter.h:87
btBoxShape
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
Definition: btBoxShape.h:26
btQuantizedBvhDoubleData
Definition: btQuantizedBvh.h:556
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
ContactAddedCallback
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
Definition: btManifoldResult.h:32
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:155
btCollisionWorldImporter::m_nameShapeMap
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
Definition: btCollisionWorldImporter.h:82
btCollisionWorldImporter::m_allocatedCollisionObjects
btAlignedObjectArray< btCollisionObject * > m_allocatedCollisionObjects
Definition: btCollisionWorldImporter.h:66
btCollisionWorldImporter::m_objectNameMap
btHashMap< btHashPtr, const char * > m_objectNameMap
Definition: btCollisionWorldImporter.h:85
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
btBulletSerializedArrays::m_collisionObjectDataDouble
btAlignedObjectArray< struct btCollisionObjectDoubleData * > m_collisionObjectDataDouble
Definition: btSerializer.h:154
btStridingMeshInterface
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
Definition: btStridingMeshInterface.h:30
btCollisionWorld
CollisionWorld is interface and container for the collision detection.
Definition: btCollisionWorld.h:88
btConeShapeZ
btConeShapeZ implements a Cone shape, around the Z axis
Definition: btConeShape.h:133
btCollisionWorldImporter::getCollisionShapeByIndex
btCollisionShape * getCollisionShapeByIndex(int index)
Definition: btCollisionWorldImporter.cpp:1092
btCollisionObject::setCollisionFlags
void setCollisionFlags(int flags)
Definition: btCollisionObject.h:490
btCollisionWorldImporter::createConeShapeY
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:990
btConeShapeData::m_upIndex
int m_upIndex
Definition: btConeShape.h:157
btCollisionWorldImporter::createStridingMeshInterfaceData
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
Definition: btCollisionWorldImporter.cpp:770
btCollisionObjectFloatData::m_name
char * m_name
Definition: btCollisionObject.h:642
btCollisionObjectDoubleData::m_worldTransform
btTransformDoubleData m_worldTransform
Definition: btCollisionObject.h:609
btQuantizedBvh::deSerializeFloat
virtual void deSerializeFloat(struct btQuantizedBvhFloatData &quantizedBvhFloatData)
Definition: btQuantizedBvh.cpp:1167
btTriangleMeshShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btBvhTriangleMeshShape.h:124
PHY_INTEGER
Definition: btConcaveShape.h:28
btTriangleIndexVertexArray::getNumSubParts
virtual int getNumSubParts() const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertice...
Definition: btTriangleIndexVertexArray.h:109
btCollisionWorldImporter::m_allocatedTriangleInfoMaps
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
Definition: btCollisionWorldImporter.h:63
btCollisionWorldImporter::convertAllObjects
bool convertAllObjects(btBulletSerializedArrays *arrays)
Definition: btCollisionWorldImporter.cpp:39
btAlignedObjectArray::resize
void resize(int newsize, const T &fillData=T())
Definition: btAlignedObjectArray.h:218
CONVEX_HULL_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:35
btCompoundShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCompoundShape.h:188
btCollisionWorldImporter::createMultiSphereShape
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
Definition: btCollisionWorldImporter.cpp:1077
btQuantizedBvh::isQuantized
bool isQuantized()
Definition: btQuantizedBvh.h:488
btCollisionWorldImporter::createBoxShape
virtual btCollisionShape * createBoxShape(const btVector3 &halfExtents)
Definition: btCollisionWorldImporter.cpp:927
btCollisionWorldImporter::createCylinderShapeY
virtual btCollisionShape * createCylinderShapeY(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:969
btGImpactMeshShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btGImpactShape.h:1145
btTriangleInfoMap::deSerialize
void deSerialize(struct btTriangleInfoMapData &data)
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition: btTriangleInfoMap.h:211
btStaticPlaneShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btStaticPlaneShape.h:76
btCylinderShape
The btCylinderShape class implements a cylinder shape primitive, centered around the origin...
Definition: btCylinderShape.h:24
btIndexedMesh::m_numVertices
int m_numVertices
Definition: btTriangleIndexVertexArray.h:34
gContactAddedCallback
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
Definition: btManifoldResult.cpp:23
btIntIndexData
Definition: btStridingMeshInterface.h:104
btCollisionWorldImporter::createTriangleMeshContainer
virtual class btTriangleIndexVertexArray * createTriangleMeshContainer()
Definition: btCollisionWorldImporter.cpp:1004
btCollisionWorldImporter::createConeShapeZ
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:997
btScaledBvhTriangleMeshShape
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
Definition: btScaledBvhTriangleMeshShape.h:24
btCollisionWorldImporter::deleteAllData
virtual void deleteAllData()
delete all memory collision shapes, rigid bodies, constraints etc.
Definition: btCollisionWorldImporter.cpp:151
btAlignedAlloc
#define btAlignedAlloc(size, alignment)
Definition: btAlignedAllocator.h:47
btCollisionWorldImporter::m_bvhMap
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
Definition: btCollisionWorldImporter.h:79
btCapsuleShapeZ
btCapsuleShapeZ represents a capsule around the Z axis the total height is height+2*radius, so the height is just the height between the center of each &#39;sphere&#39; of the capsule caps.
Definition: btCapsuleShape.h:134
btMeshPartData::m_indices32
btIntIndexData * m_indices32
Definition: btStridingMeshInterface.h:134
btCapsuleShape::deSerializeFloat
void deSerializeFloat(struct btCapsuleShapeData *dataBuffer)
Definition: btCapsuleShape.h:181
btBvhTriangleMeshShape::setTriangleInfoMap
void setTriangleInfoMap(btTriangleInfoMap *triangleInfoMap)
Definition: btBvhTriangleMeshShape.h:97
btStaticPlaneShapeData::m_planeNormal
btVector3FloatData m_planeNormal
Definition: btStaticPlaneShape.h:77
btConvexHullShape::addPoint
void addPoint(const btVector3 &point, bool recalculateLocalAabb=true)
Definition: btConvexHullShape.cpp:54
btCompoundShapeData::m_numChildShapes
int m_numChildShapes
Definition: btCompoundShape.h:194
COMPOUND_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:71
btConvexHullShape
The btConvexHullShape implements an implicit convex hull of an array of vertices. ...
Definition: btConvexHullShape.h:26
btCollisionObjectDoubleData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:605
btCollisionShape::getShapeType
int getShapeType() const
Definition: btCollisionShape.h:112
btVector3FloatData
Definition: btVector3.h:1312
btTriangleMeshShapeData::m_collisionMargin
float m_collisionMargin
Definition: btBvhTriangleMeshShape.h:135
btCollisionWorldImporter::createConeShapeX
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:983
btTriangleInfoMap
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
Definition: btTriangleInfoMap.h:58
btTriangleMeshShapeData::m_quantizedFloatBvh
btQuantizedBvhFloatData * m_quantizedFloatBvh
Definition: btBvhTriangleMeshShape.h:130
btBulletSerializedArrays
Definition: btSerializer.h:142
btCompoundShape
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
Definition: btCompoundShape.h:54
btCollisionWorldImporter::~btCollisionWorldImporter
virtual ~btCollisionWorldImporter()
Definition: btCollisionWorldImporter.cpp:31
btGImpactShapeInterface::updateBound
void updateBound()
performs refit operation
Definition: btGImpactShape.h:123
btVector3::deSerializeFloat
void deSerializeFloat(const struct btVector3FloatData &dataIn)
Definition: btVector3.h:1330
btCapsuleShapeData::m_upAxis
int m_upAxis
Definition: btCapsuleShape.h:153
btCompoundShapeChildData::m_childShape
btCollisionShapeData * m_childShape
Definition: btCompoundShape.h:182
btStaticPlaneShape
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane. ...
Definition: btStaticPlaneShape.h:23
btTransform::deSerializeDouble
void deSerializeDouble(const struct btTransformDoubleData &dataIn)
Definition: btTransform.h:292
btCollisionWorldImporter::m_shortIndexArrays
btAlignedObjectArray< short int * > m_shortIndexArrays
Definition: btCollisionWorldImporter.h:72
btCollisionWorldImporter::createCapsuleShapeY
virtual btCollisionShape * createCapsuleShapeY(btScalar radius, btScalar height)
Definition: btCollisionWorldImporter.cpp:948
btCollisionObjectDoubleData::m_restitution
double m_restitution
Definition: btCollisionObject.h:620
btIndexedMesh::m_vertexStride
int m_vertexStride
Definition: btTriangleIndexVertexArray.h:37
btGImpactMeshShapeData::m_localScaling
btVector3FloatData m_localScaling
Definition: btGImpactShape.h:1151
btCollisionWorldImporter::getCollisionObjectByName
btCollisionObject * getCollisionObjectByName(const char *name)
Definition: btCollisionWorldImporter.cpp:891
btCollisionWorldImporter::getTriangleInfoMapByIndex
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
Definition: btCollisionWorldImporter.cpp:1142
btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK
Definition: btCollisionObject.h:136
btTransformDoubleData::m_origin
btVector3DoubleData m_origin
Definition: btTransform.h:262
btCollisionShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionShape.h:155
btCollisionWorldImporter::getCollisionShapeByName
btCollisionShape * getCollisionShapeByName(const char *name)
Definition: btCollisionWorldImporter.cpp:1097
btVector3::getX
const btScalar & getX() const
Return the x value.
Definition: btVector3.h:573
btCylinderShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCylinderShape.h:184
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:292
btCylinderShapeX
Definition: btCylinderShape.h:137
btIndexedMesh::m_vertexType
PHY_ScalarType m_vertexType
Definition: btTriangleIndexVertexArray.h:46
btVector3DoubleData
Definition: btVector3.h:1317
btCollisionWorldImporter::createConvexTriangleMeshShape
virtual btCollisionShape * createConvexTriangleMeshShape(btStridingMeshInterface *trimesh)
Definition: btCollisionWorldImporter.cpp:1041
btCylinderShapeData::m_upAxis
int m_upAxis
Definition: btCylinderShape.h:188
PHY_FLOAT
Definition: btConcaveShape.h:26
btIndexedMesh::m_vertexBase
const unsigned char * m_vertexBase
Definition: btTriangleIndexVertexArray.h:35
btCollisionWorldImporter::btCollisionWorldImporter
btCollisionWorldImporter(btCollisionWorld *world)
Definition: btCollisionWorldImporter.cpp:24
STATIC_PLANE_PROXYTYPE
Definition: btBroadphaseProxy.h:67
btCollisionWorldImporter::m_allocatedBvhs
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
Definition: btCollisionWorldImporter.h:62
btSerializer.h
btMultiSphereShapeData
Definition: btMultiSphereShape.h:83
btGImpactMeshShape::setMargin
virtual void setMargin(btScalar margin)
Definition: btGImpactShape.h:978
btConvexHullShapeData::m_numUnscaledPoints
int m_numUnscaledPoints
Definition: btConvexHullShape.h:108
btMeshPartData::m_vertices3d
btVector3DoubleData * m_vertices3d
Definition: btStridingMeshInterface.h:132