Fix for btCapsuleShape, m_localScaling is already applied to the radius/halfExtents so don't apply it again in the localGetSupportVertex(NonVirtual)
Make sure SerializeDemo compiles fine without DESERIALIZE_SOFT_BODIES defined
This commit is contained in:
@@ -55,7 +55,7 @@ btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInter
|
||||
btVector3 pos(0,0,0);
|
||||
pos[getUpAxis()] = getHalfHeight();
|
||||
|
||||
vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
|
||||
vtx = pos +vec*(radius) - vec * getMargin();
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInter
|
||||
btVector3 pos(0,0,0);
|
||||
pos[getUpAxis()] = -getHalfHeight();
|
||||
|
||||
vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
|
||||
vtx = pos +vec*(radius) - vec * getMargin();
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
{
|
||||
@@ -96,7 +96,7 @@ btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInter
|
||||
{
|
||||
btVector3 pos(0,0,0);
|
||||
pos[getUpAxis()] = getHalfHeight();
|
||||
vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
|
||||
vtx = pos +vec*(radius) - vec * getMargin();
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
{
|
||||
@@ -107,7 +107,7 @@ btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInter
|
||||
{
|
||||
btVector3 pos(0,0,0);
|
||||
pos[getUpAxis()] = -getHalfHeight();
|
||||
vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
|
||||
vtx = pos +vec*(radius) - vec * getMargin();
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
{
|
||||
|
||||
@@ -244,7 +244,7 @@ btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btV
|
||||
pos[capsuleUpAxis] = halfHeight;
|
||||
|
||||
//vtx = pos +vec*(radius);
|
||||
vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
|
||||
vtx = pos +vec*(radius) - vec * capsuleShape->getMarginNV();
|
||||
newDot = vec.dot(vtx);
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btV
|
||||
pos[capsuleUpAxis] = -halfHeight;
|
||||
|
||||
//vtx = pos +vec*(radius);
|
||||
vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
|
||||
vtx = pos +vec*(radius) - vec * capsuleShape->getMarginNV();
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user