more btCapsuleShape fixes
use hello_mjcf.xml for MJCF importer
This commit is contained in:
@@ -123,7 +123,7 @@ ImportMJCFSetup::ImportMJCFSetup(struct GUIHelperInterface* helper, int option,
|
||||
gMCFJFileNameArray.push_back("mjcf/humanoid.xml");
|
||||
gMCFJFileNameArray.push_back("mjcf/inverted_pendulum.xml");
|
||||
gMCFJFileNameArray.push_back("mjcf/ant.xml");
|
||||
gMCFJFileNameArray.push_back("mjcf/hello_mjcf2.xml");
|
||||
gMCFJFileNameArray.push_back("mjcf/hello_mjcf.xml");
|
||||
gMCFJFileNameArray.push_back("mjcf/capsule.xml");
|
||||
// gMCFJFileNameArray.push_back("mjcf/hopper.xml");
|
||||
// gMCFJFileNameArray.push_back("mjcf/swimmer.xml");
|
||||
|
||||
@@ -16,7 +16,6 @@ subject to the following restrictions:
|
||||
|
||||
#include "btCapsuleShape.h"
|
||||
|
||||
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
|
||||
#include "LinearMath/btQuaternion.h"
|
||||
|
||||
btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInternalShape ()
|
||||
@@ -49,8 +48,7 @@ btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInter
|
||||
btVector3 vtx;
|
||||
btScalar newDot;
|
||||
|
||||
btScalar radius = getRadius();
|
||||
|
||||
|
||||
|
||||
{
|
||||
btVector3 pos(0,0,0);
|
||||
@@ -85,8 +83,7 @@ btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInter
|
||||
{
|
||||
|
||||
|
||||
btScalar radius = getRadius();
|
||||
|
||||
|
||||
for (int j=0;j<numVectors;j++)
|
||||
{
|
||||
btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
|
||||
|
||||
@@ -86,7 +86,12 @@ public:
|
||||
|
||||
virtual void setLocalScaling(const btVector3& scaling)
|
||||
{
|
||||
btConvexInternalShape::setLocalScaling(scaling);
|
||||
btVector3 unScaledImplicitShapeDimensions = m_implicitShapeDimensions / m_localScaling;
|
||||
btConvexInternalShape::setLocalScaling(scaling);
|
||||
m_implicitShapeDimensions = (unScaledImplicitShapeDimensions * scaling);
|
||||
//update m_collisionMargin, since entire radius==margin
|
||||
int radiusAxis = (m_upAxis+2)%3;
|
||||
m_collisionMargin = m_implicitShapeDimensions[radiusAxis];
|
||||
}
|
||||
|
||||
virtual btVector3 getAnisotropicRollingFrictionDirection() const
|
||||
|
||||
@@ -230,7 +230,6 @@ btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btV
|
||||
btScalar halfHeight = capsuleShape->getHalfHeight();
|
||||
int capsuleUpAxis = capsuleShape->getUpAxis();
|
||||
|
||||
btScalar radius = capsuleShape->getRadius();
|
||||
btVector3 supVec(0,0,0);
|
||||
|
||||
btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
|
||||
|
||||
Reference in New Issue
Block a user