fix some btMultiBody URDF conversion issues in ImportURDFSetup
remove various vertex format structures and use GLInstanceVertex from #include "OpenGLWindow/GLInstanceGraphicsShape.h" btMultiBody::setupPrismatic takes an additional argument to allow a shift of inertia tensor, relative to the joint frame (link frame at q=0)
This commit is contained in:
@@ -167,13 +167,15 @@ void btMultiBody::setupFixed(int i,
|
||||
|
||||
}
|
||||
|
||||
|
||||
void btMultiBody::setupPrismatic(int i,
|
||||
btScalar mass,
|
||||
const btVector3 &inertia,
|
||||
int parent,
|
||||
const btQuaternion &rotParentToThis,
|
||||
const btVector3 &jointAxis,
|
||||
const btVector3 &parentComToThisComOffset,
|
||||
const btVector3 &parentComToThisComOffset,
|
||||
const btVector3 &thisPivotToThisComOffset,
|
||||
bool disableParentCollision)
|
||||
{
|
||||
if(m_isMultiDof)
|
||||
@@ -189,6 +191,7 @@ void btMultiBody::setupPrismatic(int i,
|
||||
m_links[i].setAxisTop(0, 0., 0., 0.);
|
||||
m_links[i].setAxisBottom(0, jointAxis);
|
||||
m_links[i].m_eVector = parentComToThisComOffset;
|
||||
m_links[i].m_dVector = thisPivotToThisComOffset;
|
||||
m_links[i].m_cachedRotParentToThis = rotParentToThis;
|
||||
|
||||
m_links[i].m_jointType = btMultibodyLink::ePrismatic;
|
||||
|
||||
@@ -65,16 +65,16 @@ public:
|
||||
const btVector3 &thisPivotToThisComOffset,
|
||||
bool disableParentCollision);
|
||||
|
||||
|
||||
void setupPrismatic(int linkIndex, // 0 to num_links-1
|
||||
btScalar mass,
|
||||
const btVector3 &inertia, // in my frame; assumed diagonal
|
||||
int parent,
|
||||
const btQuaternion &rotParentToThis, // rotate points in parent frame to my frame.
|
||||
const btVector3 &jointAxis, // in my frame
|
||||
const btVector3 &parentComToThisComOffset, // vector from parent COM to my COM, in my frame, when q = 0.
|
||||
bool disableParentCollision=false
|
||||
);
|
||||
|
||||
void setupPrismatic(int i,
|
||||
btScalar mass,
|
||||
const btVector3 &inertia,
|
||||
int parent,
|
||||
const btQuaternion &rotParentToThis,
|
||||
const btVector3 &jointAxis,
|
||||
const btVector3 &parentComToThisComOffset,
|
||||
const btVector3 &thisPivotToThisComOffset,
|
||||
bool disableParentCollision);
|
||||
|
||||
void setupRevolute(int linkIndex, // 0 to num_links-1
|
||||
btScalar mass,
|
||||
|
||||
@@ -493,7 +493,7 @@ struct btMultibodyLink
|
||||
case ePrismatic:
|
||||
{
|
||||
// m_cachedRotParentToThis never changes, so no need to update
|
||||
m_cachedRVector = quatRotate(m_cachedRotParentToThis,m_eVector) + pJointPos[0] * getAxisBottom(0);
|
||||
m_cachedRVector = m_dVector + quatRotate(m_cachedRotParentToThis,m_eVector) + pJointPos[0] * getAxisBottom(0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user