fix to setLocalScaling for a btCylinderShape, thanks to rutina for the patch:
http://code.google.com/p/bullet/issues/detail?id=393
This commit is contained in:
@@ -100,6 +100,18 @@ public:
|
|||||||
return getHalfExtentsWithMargin().getX();
|
return getHalfExtentsWithMargin().getX();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void setLocalScaling(const btVector3& scaling)
|
||||||
|
{
|
||||||
|
btVector3 oldMargin(getMargin(),getMargin(),getMargin());
|
||||||
|
btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
|
||||||
|
btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
|
||||||
|
|
||||||
|
btConvexInternalShape::setLocalScaling(scaling);
|
||||||
|
|
||||||
|
m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//debugging
|
//debugging
|
||||||
virtual const char* getName()const
|
virtual const char* getName()const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user