harrison-lucas / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

names of child shapes not added to m_nameShapeMap correctly for compound shape serialization #732

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Serialize a compound shape after registering names for the child shapes.  When 
loading it back up, getCollisionShapeByName doesn't work properly for the names 
registered to the child shape.

the children shapes are in m_collisionShapes, and so the m_nameShapeMap is 
populated with the name->shape mapping for those instances of the child shapes. 
 But those aren't the pointers to the shapes that finally get inserted into the 
compound shape.

In btBulletWorldImporter.cpp, the collision shapes loop calls 
m_nameShapeMap.insert(newname,shape); whenever there is a new name/shape 
mapping.  But convertCollisionShape does not do the same, as is required for a 
recursive shape.

Fix should probably go in :
btCollisionShape* btWorldImporter::convertCollisionShape(  
btCollisionShapeData* shapeData  )

in the "case COMPOUND_SHAPE_PROXYTYPE:".  something to register the name.  
Haven't tried editing it myself yet.

Original issue reported on code.google.com by kinnison...@gmail.com on 20 Aug 2013 at 11:31

GoogleCodeExporter commented 9 years ago
moved to https://github.com/bulletphysics/bullet3/issues/87

Original comment by erwin.coumans on 30 Mar 2014 at 6:02