Fix for problem in btBulletWorldImporter

Aardwolf
Posts: 13
Joined: Thu Jul 07, 2011 2:57 am

Fix for problem in btBulletWorldImporter

Post by Aardwolf »

In my project I am reading/writing bullet collision shapes... it seemed to be working properly, but I noticed that btMultiSphereShapes were not loading properly. After a great deal of hair-pulling, I found out what was causing the problem. Shapes of type btMultiSphereShape, and a few other types, are not being added to the collection m_allocatedCollisionShapes.

In btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShapeData* shapeData ), I changed the following...

Code: Select all

				if (shape)
				{
					shape->setMargin(bsd->m_collisionMargin);
					btVector3 localScaling;
					localScaling.deSerializeFloat(bsd->m_localScaling);
					shape->setLocalScaling(localScaling);
				}
to

Code: Select all

				if (shape)
				{
					shape->setMargin(bsd->m_collisionMargin);
					btVector3 localScaling;
					localScaling.deSerializeFloat(bsd->m_localScaling);
					shape->setLocalScaling(localScaling);
					m_allocatedCollisionShapes.push_back(shape);
				}


I hope this is the right place to post this? :?