add capsule support in urdf parser (non-standard extension), capsule.urdf

fix btCapsuleShape (X,Y,Z) margin issue
fix uninitialized variables in TinyRenderer: m_hasLightDistance, m_hasLightAmbientCoeff, m_hasLightDiffuseCoeff, m_hasLightSpecularCoeff
pybullet/shared memory API 'getClosestPoints' / b3InitClosestDistanceQuery, only report contacts equal/smaller distance than given
This commit is contained in:
Erwin Coumans
2017-01-23 16:45:18 -08:00
parent 73e83d6e84
commit d465e1eea5
6 changed files with 87 additions and 22 deletions

View File

@@ -19,8 +19,10 @@ subject to the following restrictions:
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInternalShape ()
btCapsuleShape::btCapsuleShape(btScalar orgRadius, btScalar height) : btConvexInternalShape ()
{
m_collisionMargin = orgRadius;
btScalar radius = 0.f;
m_shapeType = CAPSULE_SHAPE_PROXYTYPE;
m_upAxis = 1;
m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
@@ -133,7 +135,7 @@ void btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia) con
btVector3 halfExtents(radius,radius,radius);
halfExtents[getUpAxis()]+=getHalfHeight();
btScalar margin = CONVEX_DISTANCE_MARGIN;
btScalar margin = m_collisionMargin;
btScalar lx=btScalar(2.)*(halfExtents[0]+margin);
btScalar ly=btScalar(2.)*(halfExtents[1]+margin);
@@ -149,8 +151,10 @@ void btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia) con
}
btCapsuleShapeX::btCapsuleShapeX(btScalar radius,btScalar height)
btCapsuleShapeX::btCapsuleShapeX(btScalar orgRadius,btScalar height)
{
m_collisionMargin = orgRadius;
btScalar radius = 0.f;
m_upAxis = 0;
m_implicitShapeDimensions.setValue(0.5f*height, radius,radius);
}
@@ -160,8 +164,10 @@ btCapsuleShapeX::btCapsuleShapeX(btScalar radius,btScalar height)
btCapsuleShapeZ::btCapsuleShapeZ(btScalar radius,btScalar height)
btCapsuleShapeZ::btCapsuleShapeZ(btScalar orgRadius,btScalar height)
{
m_collisionMargin = orgRadius;
btScalar radius = 0.f;
m_upAxis = 2;
m_implicitShapeDimensions.setValue(radius,radius,0.5f*height);
}