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

Bullet Collision Detection & Physics Library

btBulletWorldImporter.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
17 #include "btBulletWorldImporter.h"
18 #include "../BulletFileLoader/btBulletFile.h"
19
20 #include "btBulletDynamicsCommon.h"
21 #ifndef USE_GIMPACT
22 #include "BulletCollision/Gimpact/btGImpactShape.h"
23 #endif
24
25
26 //#define USE_INTERNAL_EDGE_UTILITY
27 #ifdef USE_INTERNAL_EDGE_UTILITY
28 #include "BulletCollision/CollisionDispatch/btInternalEdgeUtility.h"
29 #endif //USE_INTERNAL_EDGE_UTILITY
30
31 btBulletWorldImporter::btBulletWorldImporter(btDynamicsWorld* world)
32 :btWorldImporter(world)
33 {
34 }
35
36 btBulletWorldImporter::~btBulletWorldImporter()
37 {
38 }
39
40
41 bool btBulletWorldImporter::loadFile( const char* fileName, const char* preSwapFilenameOut)
42 {
43 bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile(fileName);
44
45
46 bool result = loadFileFromMemory(bulletFile2);
47 //now you could save the file in 'native' format using
48 //bulletFile2->writeFile("native.bullet");
49 if (result)
50 {
51 if (preSwapFilenameOut)
52 {
53 bulletFile2->preSwap();
54 bulletFile2->writeFile(preSwapFilenameOut);
55 }
56
57 }
58 delete bulletFile2;
59
60 return result;
61
62 }
63
64
65
66 bool btBulletWorldImporter::loadFileFromMemory( char* memoryBuffer, int len)
67 {
68 bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile(memoryBuffer,len);
69
70 bool result = loadFileFromMemory(bulletFile2);
71
72 delete bulletFile2;
73
74 return result;
75 }
76
77
78
79
80 bool btBulletWorldImporter::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
81 {
82 bool ok = (bulletFile2->getFlags()& bParse::FD_OK)!=0;
83
84 if (ok)
85 bulletFile2->parse(m_verboseMode);
86 else
87 return false;
88
89 if (m_verboseMode & bParse::FD_VERBOSE_DUMP_CHUNKS)
90 {
91 bulletFile2->dumpChunks(bulletFile2->getFileDNA());
92 }
93
94 return convertAllObjects(bulletFile2);
95
96 }
97
98 bool btBulletWorldImporter::convertAllObjects( bParse::btBulletFile* bulletFile2)
99 {
100
101 m_shapeMap.clear();
102 m_bodyMap.clear();
103
104 int i;
105
106 for (i=0;i<bulletFile2->m_bvhs.size();i++)
107 {
108 btOptimizedBvh* bvh = createOptimizedBvh();
109
110 if (bulletFile2->getFlags() & bParse::FD_DOUBLE_PRECISION)
111 {
112 btQuantizedBvhDoubleData* bvhData = (btQuantizedBvhDoubleData*)bulletFile2->m_bvhs[i];
113 bvh->deSerializeDouble(*bvhData);
114 } else
115 {
116 btQuantizedBvhFloatData* bvhData = (btQuantizedBvhFloatData*)bulletFile2->m_bvhs[i];
117 bvh->deSerializeFloat(*bvhData);
118 }
119 m_bvhMap.insert(bulletFile2->m_bvhs[i],bvh);
120 }
121
122
123
124
125
126 for (i=0;i<bulletFile2->m_collisionShapes.size();i++)
127 {
128 btCollisionShapeData* shapeData = (btCollisionShapeData*)bulletFile2->m_collisionShapes[i];
129 btCollisionShape* shape = convertCollisionShape(shapeData);
130 if (shape)
131 {
132 // printf("shapeMap.insert(%x,%x)\n",shapeData,shape);
133 m_shapeMap.insert(shapeData,shape);
134 }
135
136 if (shape&& shapeData->m_name)
137 {
138 char* newname = duplicateName(shapeData->m_name);
139 m_objectNameMap.insert(shape,newname);
140 m_nameShapeMap.insert(newname,shape);
141 }
142 }
143
144
145
146
147
148 for (int i=0;i<bulletFile2->m_dynamicsWorldInfo.size();i++)
149 {
150 if (bulletFile2->getFlags() & bParse::FD_DOUBLE_PRECISION)
151 {
152 btDynamicsWorldDoubleData* solverInfoData = (btDynamicsWorldDoubleData*)bulletFile2->m_dynamicsWorldInfo[i];
153 btContactSolverInfo solverInfo;
154
155 btVector3 gravity;
156 gravity.deSerializeDouble(solverInfoData->m_gravity);
157
158 solverInfo.m_tau = btScalar(solverInfoData->m_solverInfo.m_tau);
159 solverInfo.m_damping = btScalar(solverInfoData->m_solverInfo.m_damping);
160 solverInfo.m_friction = btScalar(solverInfoData->m_solverInfo.m_friction);
161 solverInfo.m_timeStep = btScalar(solverInfoData->m_solverInfo.m_timeStep);
162
163 solverInfo.m_restitution = btScalar(solverInfoData->m_solverInfo.m_restitution);
164 solverInfo.m_maxErrorReduction = btScalar(solverInfoData->m_solverInfo.m_maxErrorReduction);
165 solverInfo.m_sor = btScalar(solverInfoData->m_solverInfo.m_sor);
166 solverInfo.m_erp = btScalar(solverInfoData->m_solverInfo.m_erp);
167
168 solverInfo.m_erp2 = btScalar(solverInfoData->m_solverInfo.m_erp2);
169 solverInfo.m_globalCfm = btScalar(solverInfoData->m_solverInfo.m_globalCfm);
170 solverInfo.m_splitImpulsePenetrationThreshold = btScalar(solverInfoData->m_solverInfo.m_splitImpulsePenetrationThreshold);
171 solverInfo.m_splitImpulseTurnErp = btScalar(solverInfoData->m_solverInfo.m_splitImpulseTurnErp);
172
173 solverInfo.m_linearSlop = btScalar(solverInfoData->m_solverInfo.m_linearSlop);
174 solverInfo.m_warmstartingFactor = btScalar(solverInfoData->m_solverInfo.m_warmstartingFactor);
175 solverInfo.m_maxGyroscopicForce = btScalar(solverInfoData->m_solverInfo.m_maxGyroscopicForce);
176 solverInfo.m_singleAxisRollingFrictionThreshold = btScalar(solverInfoData->m_solverInfo.m_singleAxisRollingFrictionThreshold);
177
178 solverInfo.m_numIterations = solverInfoData->m_solverInfo.m_numIterations;
179 solverInfo.m_solverMode = solverInfoData->m_solverInfo.m_solverMode;
180 solverInfo.m_restingContactRestitutionThreshold = solverInfoData->m_solverInfo.m_restingContactRestitutionThreshold;
181 solverInfo.m_minimumSolverBatchSize = solverInfoData->m_solverInfo.m_minimumSolverBatchSize;
182
183 solverInfo.m_splitImpulse = solverInfoData->m_solverInfo.m_splitImpulse;
184
185 setDynamicsWorldInfo(gravity,solverInfo);
186 } else
187 {
188 btDynamicsWorldFloatData* solverInfoData = (btDynamicsWorldFloatData*)bulletFile2->m_dynamicsWorldInfo[i];
189 btContactSolverInfo solverInfo;
190
191 btVector3 gravity;
192 gravity.deSerializeFloat(solverInfoData->m_gravity);
193
194 solverInfo.m_tau = solverInfoData->m_solverInfo.m_tau;
195 solverInfo.m_damping = solverInfoData->m_solverInfo.m_damping;
196 solverInfo.m_friction = solverInfoData->m_solverInfo.m_friction;
197 solverInfo.m_timeStep = solverInfoData->m_solverInfo.m_timeStep;
198
199 solverInfo.m_restitution = solverInfoData->m_solverInfo.m_restitution;
200 solverInfo.m_maxErrorReduction = solverInfoData->m_solverInfo.m_maxErrorReduction;
201 solverInfo.m_sor = solverInfoData->m_solverInfo.m_sor;
202 solverInfo.m_erp = solverInfoData->m_solverInfo.m_erp;
203
204 solverInfo.m_erp2 = solverInfoData->m_solverInfo.m_erp2;
205 solverInfo.m_globalCfm = solverInfoData->m_solverInfo.m_globalCfm;
206 solverInfo.m_splitImpulsePenetrationThreshold = solverInfoData->m_solverInfo.m_splitImpulsePenetrationThreshold;
207 solverInfo.m_splitImpulseTurnErp = solverInfoData->m_solverInfo.m_splitImpulseTurnErp;
208
209 solverInfo.m_linearSlop = solverInfoData->m_solverInfo.m_linearSlop;
210 solverInfo.m_warmstartingFactor = solverInfoData->m_solverInfo.m_warmstartingFactor;
211 solverInfo.m_maxGyroscopicForce = solverInfoData->m_solverInfo.m_maxGyroscopicForce;
212 solverInfo.m_singleAxisRollingFrictionThreshold = solverInfoData->m_solverInfo.m_singleAxisRollingFrictionThreshold;
213
214 solverInfo.m_numIterations = solverInfoData->m_solverInfo.m_numIterations;
215 solverInfo.m_solverMode = solverInfoData->m_solverInfo.m_solverMode;
216 solverInfo.m_restingContactRestitutionThreshold = solverInfoData->m_solverInfo.m_restingContactRestitutionThreshold;
217 solverInfo.m_minimumSolverBatchSize = solverInfoData->m_solverInfo.m_minimumSolverBatchSize;
218
219 solverInfo.m_splitImpulse = solverInfoData->m_solverInfo.m_splitImpulse;
220
221 setDynamicsWorldInfo(gravity,solverInfo);
222 }
223 }
224
225
226 for (i=0;i<bulletFile2->m_rigidBodies.size();i++)
227 {
228 if (bulletFile2->getFlags() & bParse::FD_DOUBLE_PRECISION)
229 {
230 btRigidBodyDoubleData* colObjData = (btRigidBodyDoubleData*)bulletFile2->m_rigidBodies[i];
231 convertRigidBodyDouble(colObjData);
232 } else
233 {
234 btRigidBodyFloatData* colObjData = (btRigidBodyFloatData*)bulletFile2->m_rigidBodies[i];
235 convertRigidBodyFloat(colObjData);
236 }
237
238
239 }
240
241 for (i=0;i<bulletFile2->m_collisionObjects.size();i++)
242 {
243 if (bulletFile2->getFlags() & bParse::FD_DOUBLE_PRECISION)
244 {
245 btCollisionObjectDoubleData* colObjData = (btCollisionObjectDoubleData*)bulletFile2->m_collisionObjects[i];
246 btCollisionShape** shapePtr = m_shapeMap.find(colObjData->m_collisionShape);
247 if (shapePtr && *shapePtr)
248 {
249 btTransform startTransform;
250 colObjData->m_worldTransform.m_origin.m_floats[3] = 0.f;
251 startTransform.deSerializeDouble(colObjData->m_worldTransform);
252
253 btCollisionShape* shape = (btCollisionShape*)*shapePtr;
254 btCollisionObject* body = createCollisionObject(startTransform,shape,colObjData->m_name);
255 body->setFriction(btScalar(colObjData->m_friction));
256 body->setRestitution(btScalar(colObjData->m_restitution));
257
258 #ifdef USE_INTERNAL_EDGE_UTILITY
259 if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
260 {
261 btBvhTriangleMeshShape* trimesh = (btBvhTriangleMeshShape*)shape;
262 if (trimesh->getTriangleInfoMap())
263 {
264 body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
265 }
266 }
267 #endif //USE_INTERNAL_EDGE_UTILITY
268 m_bodyMap.insert(colObjData,body);
269 } else
270 {
271 printf("error: no shape found\n");
272 }
273
274 } else
275 {
276 btCollisionObjectFloatData* colObjData = (btCollisionObjectFloatData*)bulletFile2->m_collisionObjects[i];
277 btCollisionShape** shapePtr = m_shapeMap.find(colObjData->m_collisionShape);
278 if (shapePtr && *shapePtr)
279 {
280 btTransform startTransform;
281 colObjData->m_worldTransform.m_origin.m_floats[3] = 0.f;
282 startTransform.deSerializeFloat(colObjData->m_worldTransform);
283
284 btCollisionShape* shape = (btCollisionShape*)*shapePtr;
285 btCollisionObject* body = createCollisionObject(startTransform,shape,colObjData->m_name);
286
287 #ifdef USE_INTERNAL_EDGE_UTILITY
288 if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
289 {
290 btBvhTriangleMeshShape* trimesh = (btBvhTriangleMeshShape*)shape;
291 if (trimesh->getTriangleInfoMap())
292 {
293 body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
294 }
295 }
296 #endif //USE_INTERNAL_EDGE_UTILITY
297 m_bodyMap.insert(colObjData,body);
298 } else
299 {
300 printf("error: no shape found\n");
301 }
302 }
303
304 }
305
306
307 for (i=0;i<bulletFile2->m_constraints.size();i++)
308 {
309 btTypedConstraintData2* constraintData = (btTypedConstraintData2*)bulletFile2->m_constraints[i];
310
311 btCollisionObject** colAptr = m_bodyMap.find(constraintData->m_rbA);
312 btCollisionObject** colBptr = m_bodyMap.find(constraintData->m_rbB);
313
314 btRigidBody* rbA = 0;
315 btRigidBody* rbB = 0;
316
317 if (colAptr)
318 {
319 rbA = btRigidBody::upcast(*colAptr);
320 if (!rbA)
321 rbA = &getFixedBody();
322 }
323 if (colBptr)
324 {
325 rbB = btRigidBody::upcast(*colBptr);
326 if (!rbB)
327 rbB = &getFixedBody();
328 }
329 if (!rbA && !rbB)
330 continue;
331
332 bool isDoublePrecisionData = (bulletFile2->getFlags() & bParse::FD_DOUBLE_PRECISION)!=0;
333
334 if (isDoublePrecisionData)
335 {
336 if (bulletFile2->getVersion()>=282)
337 {
338 btTypedConstraintDoubleData* dc = (btTypedConstraintDoubleData*)constraintData;
339 convertConstraintDouble(dc, rbA,rbB, bulletFile2->getVersion());
340 } else
341 {
342 //double-precision constraints were messed up until 2.82, try to recover data...
343
344 btTypedConstraintData* oldData = (btTypedConstraintData*)constraintData;
345
346 convertConstraintBackwardsCompatible281(oldData, rbA,rbB, bulletFile2->getVersion());
347
348 }
349 }
350 else
351 {
352 btTypedConstraintFloatData* dc = (btTypedConstraintFloatData*)constraintData;
353 convertConstraintFloat(dc, rbA,rbB, bulletFile2->getVersion());
354 }
355
356
357 }
358
359 return true;
360 }
361
btHashMap::clear
void clear()
Definition: btHashMap.h:457
btCollisionObjectFloatData::m_worldTransform
btTransformFloatData m_worldTransform
Definition: btCollisionObject.h:642
btRigidBody::upcast
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don&#39;t store a rigidbody pointer but a rigidbody ...
Definition: btRigidBody.h:203
btContactSolverInfoDoubleData::m_timeStep
double m_timeStep
Definition: btContactSolverInfo.h:104
btDynamicsWorldDoubleData::m_gravity
btVector3DoubleData m_gravity
Definition: btDynamicsWorld.h:155
btBvhTriangleMeshShape::getTriangleInfoMap
const btTriangleInfoMap * getTriangleInfoMap() const
Definition: btBvhTriangleMeshShape.h:102
btCollisionObjectFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:635
btWorldImporter::convertConstraintBackwardsCompatible281
void convertConstraintBackwardsCompatible281(btTypedConstraintData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
Definition: btWorldImporter.cpp:528
btWorldImporter::convertCollisionShape
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
Definition: btWorldImporter.cpp:149
btTransform::deSerializeFloat
void deSerializeFloat(const struct btTransformFloatData &dataIn)
Definition: btTransform.h:286
btWorldImporter::convertRigidBodyDouble
void convertRigidBodyDouble(btRigidBodyDoubleData *colObjData)
Definition: btWorldImporter.cpp:2074
btWorldImporter
Definition: btWorldImporter.h:63
btVector3::deSerializeDouble
void deSerializeDouble(const struct btVector3DoubleData &dataIn)
Definition: btVector3.h:1343
btContactSolverInfoDoubleData::m_damping
double m_damping
Definition: btContactSolverInfo.h:102
btInternalEdgeUtility.h
btWorldImporter::convertRigidBodyFloat
void convertRigidBodyFloat(btRigidBodyFloatData *colObjData)
Definition: btWorldImporter.cpp:2025
btContactSolverInfoFloatData::m_restingContactRestitutionThreshold
int m_restingContactRestitutionThreshold
Definition: btContactSolverInfo.h:151
btContactSolverInfoDoubleData::m_sor
double m_sor
Definition: btContactSolverInfo.h:107
btBulletDynamicsCommon.h
btQuantizedBvhFloatData
Definition: btQuantizedBvh.h:539
btContactSolverInfoDoubleData::m_warmstartingFactor
double m_warmstartingFactor
Definition: btContactSolverInfo.h:114
bParse::btBulletFile::m_constraints
btAlignedObjectArray< bStructHandle * > m_constraints
Definition: btBulletFile.h:52
btContactSolverInfoDoubleData::m_maxErrorReduction
double m_maxErrorReduction
Definition: btContactSolverInfo.h:106
btVector3DoubleData::m_floats
double m_floats[4]
Definition: btVector3.h:1318
btDynamicsWorldDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btDynamicsWorld.h:152
btHashMap::find
const Value * find(const Key &key) const
Definition: btHashMap.h:419
btContactSolverInfoFloatData::m_restitution
float m_restitution
Definition: btContactSolverInfo.h:134
btContactSolverInfoDoubleData::m_minimumSolverBatchSize
int m_minimumSolverBatchSize
Definition: btContactSolverInfo.h:121
btContactSolverInfoDoubleData::m_numIterations
int m_numIterations
Definition: btContactSolverInfo.h:118
btContactSolverInfoFloatData::m_minimumSolverBatchSize
int m_minimumSolverBatchSize
Definition: btContactSolverInfo.h:152
TRIANGLE_MESH_SHAPE_PROXYTYPE
Definition: btBroadphaseProxy.h:55
bParse::btBulletFile
Definition: btBulletFile.h:32
btContactSolverInfoDoubleData::m_maxGyroscopicForce
double m_maxGyroscopicForce
Definition: btContactSolverInfo.h:115
btDynamicsWorld
The btDynamicsWorld is the interface class for several dynamics implementation, basic, discrete, parallel, and continuous etc.
Definition: btDynamicsWorld.h:42
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:27
btGImpactShape.h
bParse::btBulletFile::m_collisionObjects
btAlignedObjectArray< bStructHandle * > m_collisionObjects
Definition: btBulletFile.h:48
btWorldImporter::m_nameShapeMap
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
Definition: btWorldImporter.h:91
btContactSolverInfoDoubleData::m_splitImpulse
int m_splitImpulse
Definition: btContactSolverInfo.h:122
btBulletWorldImporter::loadFile
bool loadFile(const char *fileName, const char *preSwapFilenameOut=0)
if you pass a valid preSwapFilenameOut, it will save a new file with a different endianness this pre-...
Definition: btBulletWorldImporter.cpp:41
btContactSolverInfoDoubleData::m_splitImpulseTurnErp
double m_splitImpulseTurnErp
Definition: btContactSolverInfo.h:112
btCollisionObjectDoubleData::m_name
char * m_name
Definition: btCollisionObject.h:605
btContactSolverInfoFloatData::m_linearSlop
float m_linearSlop
Definition: btContactSolverInfo.h:144
bParse::bFile::dumpChunks
void dumpChunks(bDNA *dna)
Definition: bFile.cpp:1530
btVector3FloatData::m_floats
float m_floats[4]
Definition: btVector3.h:1313
btContactSolverInfoFloatData::m_erp
float m_erp
Definition: btContactSolverInfo.h:137
bParse::bFile::getFileDNA
bDNA * getFileDNA()
Definition: bFile.h:120
btDynamicsWorldFloatData::m_gravity
btVector3FloatData m_gravity
Definition: btDynamicsWorld.h:162
btCollisionObject::setRestitution
void setRestitution(btScalar rest)
Definition: btCollisionObject.h:302
btCollisionShapeData::m_name
char * m_name
Definition: btCollisionShape.h:157
btContactSolverInfoDoubleData::m_tau
double m_tau
Definition: btContactSolverInfo.h:101
btDynamicsWorldFloatData::m_solverInfo
btContactSolverInfoFloatData m_solverInfo
Definition: btDynamicsWorld.h:161
btContactSolverInfoFloatData::m_maxGyroscopicForce
float m_maxGyroscopicForce
Definition: btContactSolverInfo.h:146
btBvhTriangleMeshShape
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
Definition: btBvhTriangleMeshShape.h:34
btWorldImporter::m_verboseMode
int m_verboseMode
Definition: btWorldImporter.h:68
bParse::bFile::preSwap
void preSwap()
Definition: bFile.cpp:574
btCollisionObjectDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:600
btCollisionObjectFloatData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:638
btContactSolverInfoFloatData::m_splitImpulseTurnErp
float m_splitImpulseTurnErp
Definition: btContactSolverInfo.h:142
btWorldImporter::m_bvhMap
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
Definition: btWorldImporter.h:88
bParse::btBulletFile::parse
virtual void parse(int verboseMode)
Definition: btBulletFile.cpp:310
bParse::FD_OK
Definition: bFile.h:29
btTransformFloatData::m_origin
btVector3FloatData m_origin
Definition: btTransform.h:256
btCollisionObject::setFriction
void setFriction(btScalar frict)
Definition: btCollisionObject.h:311
btContactSolverInfoFloatData::m_solverMode
int m_solverMode
Definition: btContactSolverInfo.h:150
btRigidBodyDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:590
btContactSolverInfoFloatData::m_maxErrorReduction
float m_maxErrorReduction
Definition: btContactSolverInfo.h:135
btQuantizedBvh::deSerializeDouble
virtual void deSerializeDouble(struct btQuantizedBvhDoubleData &quantizedBvhDoubleData)
Definition: btQuantizedBvh.cpp:1238
btContactSolverInfoFloatData::m_globalCfm
float m_globalCfm
Definition: btContactSolverInfo.h:140
btWorldImporter::createOptimizedBvh
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
Definition: btWorldImporter.cpp:1759
btBulletWorldImporter::~btBulletWorldImporter
virtual ~btBulletWorldImporter()
Definition: btBulletWorldImporter.cpp:36
btWorldImporter::m_shapeMap
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
Definition: btWorldImporter.h:96
btContactSolverInfoDoubleData::m_globalCfm
double m_globalCfm
Definition: btContactSolverInfo.h:110
btCollisionObjectDoubleData::m_friction
double m_friction
Definition: btCollisionObject.h:614
btWorldImporter::duplicateName
char * duplicateName(const char *name)
Definition: btWorldImporter.cpp:514
btTypedConstraintDoubleData
Definition: btTypedConstraint.h:416
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:49
btTypedConstraintData2
#define btTypedConstraintData2
Definition: btTypedConstraint.h:28
btHashMap::insert
void insert(const Key &key, const Value &value)
Definition: btHashMap.h:269
btContactSolverInfoDoubleData::m_solverMode
int m_solverMode
Definition: btContactSolverInfo.h:119
btContactSolverInfoFloatData::m_tau
float m_tau
Definition: btContactSolverInfo.h:129
btContactSolverInfoDoubleData::m_friction
double m_friction
Definition: btContactSolverInfo.h:103
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition: btRigidBody.h:62
btOptimizedBvh
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
Definition: btOptimizedBvh.h:27
btWorldImporter::createCollisionObject
virtual btCollisionObject * createCollisionObject(const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
Definition: btWorldImporter.cpp:1629
btRigidBodyFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btRigidBody.h:564
btTypedConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
Definition: btTypedConstraint.h:393
btContactSolverInfoFloatData::m_damping
float m_damping
Definition: btContactSolverInfo.h:130
btWorldImporter::convertConstraintFloat
void convertConstraintFloat(btTypedConstraintFloatData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
Definition: btWorldImporter.cpp:749
btCollisionObject::getCollisionFlags
int getCollisionFlags() const
Definition: btCollisionObject.h:483
bParse::FD_DOUBLE_PRECISION
Definition: bFile.h:35
bParse::bFile::writeFile
void writeFile(const char *fileName)
Definition: bFile.cpp:567
btContactSolverInfoFloatData::m_erp2
float m_erp2
Definition: btContactSolverInfo.h:139
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:1634
btDynamicsWorldDoubleData::m_solverInfo
btContactSolverInfoDoubleData m_solverInfo
Definition: btDynamicsWorld.h:154
btQuantizedBvhDoubleData
Definition: btQuantizedBvh.h:556
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
bParse::bFile::getVersion
int getVersion() const
Definition: bFile.h:161
btContactSolverInfoFloatData::m_numIterations
int m_numIterations
Definition: btContactSolverInfo.h:149
btContactSolverInfoDoubleData::m_erp2
double m_erp2
Definition: btContactSolverInfo.h:109
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:155
btContactSolverInfoFloatData::m_singleAxisRollingFrictionThreshold
float m_singleAxisRollingFrictionThreshold
Definition: btContactSolverInfo.h:147
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
btContactSolverInfoDoubleData::m_linearSlop
double m_linearSlop
Definition: btContactSolverInfo.h:113
btBulletWorldImporter::convertAllObjects
virtual bool convertAllObjects(bParse::btBulletFile *file)
Definition: btBulletWorldImporter.cpp:98
btContactSolverInfo
Definition: btContactSolverInfo.h:65
btContactSolverInfoFloatData::m_timeStep
float m_timeStep
Definition: btContactSolverInfo.h:132
btCollisionObject::setCollisionFlags
void setCollisionFlags(int flags)
Definition: btCollisionObject.h:488
btContactSolverInfoFloatData::m_sor
float m_sor
Definition: btContactSolverInfo.h:136
btContactSolverInfoFloatData::m_splitImpulsePenetrationThreshold
float m_splitImpulsePenetrationThreshold
Definition: btContactSolverInfo.h:141
btCollisionObjectFloatData::m_name
char * m_name
Definition: btCollisionObject.h:640
btCollisionObjectDoubleData::m_worldTransform
btTransformDoubleData m_worldTransform
Definition: btCollisionObject.h:607
bParse::btBulletFile::m_bvhs
btAlignedObjectArray< bStructHandle * > m_bvhs
Definition: btBulletFile.h:54
btQuantizedBvh::deSerializeFloat
virtual void deSerializeFloat(struct btQuantizedBvhFloatData &quantizedBvhFloatData)
Definition: btQuantizedBvh.cpp:1167
btContactSolverInfoDoubleData::m_restitution
double m_restitution
Definition: btContactSolverInfo.h:105
btWorldImporter::getFixedBody
static btRigidBody & getFixedBody()
Definition: btWorldImporter.cpp:1833
btContactSolverInfoDoubleData::m_singleAxisRollingFrictionThreshold
double m_singleAxisRollingFrictionThreshold
it is only used for &#39;explicit&#39; version of gyroscopic force
Definition: btContactSolverInfo.h:116
btContactSolverInfoDoubleData::m_splitImpulsePenetrationThreshold
double m_splitImpulsePenetrationThreshold
Definition: btContactSolverInfo.h:111
bParse::btBulletFile::m_collisionShapes
btAlignedObjectArray< bStructHandle * > m_collisionShapes
Definition: btBulletFile.h:50
bParse::FD_VERBOSE_DUMP_CHUNKS
Definition: bFile.h:44
btContactSolverInfoFloatData::m_warmstartingFactor
float m_warmstartingFactor
Definition: btContactSolverInfo.h:145
btWorldImporter::m_bodyMap
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
Definition: btWorldImporter.h:97
btBulletWorldImporter::loadFileFromMemory
bool loadFileFromMemory(char *memoryBuffer, int len)
the memoryBuffer might be modified (for example if endian swaps are necessary)
Definition: btBulletWorldImporter.cpp:66
btDynamicsWorldFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btDynamicsWorld.h:159
btContactSolverInfoFloatData::m_splitImpulse
int m_splitImpulse
Definition: btContactSolverInfo.h:154
btCollisionObjectDoubleData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:603
btCollisionShape::getShapeType
int getShapeType() const
Definition: btCollisionShape.h:112
bParse::btBulletFile::m_dynamicsWorldInfo
btAlignedObjectArray< bStructHandle * > m_dynamicsWorldInfo
Definition: btBulletFile.h:58
btVector3::deSerializeFloat
void deSerializeFloat(const struct btVector3FloatData &dataIn)
Definition: btVector3.h:1329
btTransform::deSerializeDouble
void deSerializeDouble(const struct btTransformDoubleData &dataIn)
Definition: btTransform.h:292
btCollisionObjectDoubleData::m_restitution
double m_restitution
Definition: btCollisionObject.h:618
btBulletWorldImporter::btBulletWorldImporter
btBulletWorldImporter(btDynamicsWorld *world=0)
Definition: btBulletWorldImporter.cpp:31
btWorldImporter::m_objectNameMap
btHashMap< btHashPtr, const char * > m_objectNameMap
Definition: btWorldImporter.h:94
btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK
Definition: btCollisionObject.h:136
bParse::btBulletFile::m_rigidBodies
btAlignedObjectArray< bStructHandle * > m_rigidBodies
Definition: btBulletFile.h:46
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
btContactSolverInfoDoubleData::m_restingContactRestitutionThreshold
int m_restingContactRestitutionThreshold
Definition: btContactSolverInfo.h:120
btBulletWorldImporter.h
btTypedConstraintFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btTypedConstraint.h:366
btContactSolverInfoDoubleData::m_erp
double m_erp
Definition: btContactSolverInfo.h:108
btWorldImporter::convertConstraintDouble
void convertConstraintDouble(btTypedConstraintDoubleData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
Definition: btWorldImporter.cpp:1077
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:279
btContactSolverInfoFloatData::m_friction
float m_friction
Definition: btContactSolverInfo.h:131
bParse::bFile::getFlags
int getFlags() const
Definition: bFile.h:127