+ more consistent 'setLocalScaling' for the btCompoundShape. Full non-uniform scaling is not supported when child shapes have a rotation. If any child shapes have rotation, the best you can do is either uniform scaling, or 'baking' the non-uniform scaling into the child geometry (vertices of a convex hull for example)

+ fixed an issue with BulletWorldImporter, btBoxShape implicitShapeDimensions already includes local scaling.
This commit is contained in:
rponom
2010-01-28 23:41:09 +00:00
parent ae0e78efd8
commit ee3e231be5
2 changed files with 6 additions and 3 deletions

View File

@@ -64,12 +64,14 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap
btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData;
btVector3 implicitShapeDimensions;
implicitShapeDimensions.deSerializeFloat(bsd->m_implicitShapeDimensions);
btVector3 localScaling;
localScaling.deSerializeFloat(bsd->m_localScaling);
btVector3 margin(bsd->m_collisionMargin,bsd->m_collisionMargin,bsd->m_collisionMargin);
switch (shapeData->m_shapeType)
{
case BOX_SHAPE_PROXYTYPE:
{
shape = createBoxShape(implicitShapeDimensions+margin);
shape = createBoxShape(implicitShapeDimensions/localScaling+margin);
break;
}
case SPHERE_SHAPE_PROXYTYPE: