Merge pull request #585 from erwincoumans/master

btMultiBody joint friction/damping infrastructure
This commit is contained in:
erwincoumans
2016-03-17 16:29:40 -07:00
21 changed files with 1026 additions and 880 deletions

View File

@@ -1899,6 +1899,9 @@ const char* btMultiBody::serialize(void* dataBuffer, class btSerializer* seriali
getLink(i).m_inertiaLocal.serialize(memPtr->m_linkInertia);
memPtr->m_linkMass = getLink(i).m_mass;
memPtr->m_parentIndex = getLink(i).m_parent;
memPtr->m_jointDamping = getLink(i).m_jointDamping;
memPtr->m_jointFriction = getLink(i).m_jointFriction;
getLink(i).m_eVector.serialize(memPtr->m_parentComToThisComOffset);
getLink(i).m_dVector.serialize(memPtr->m_thisPivotToThisComOffset);
getLink(i).m_zeroRotParentToThis.serialize(memPtr->m_zeroRotParentToThis);

View File

@@ -691,8 +691,9 @@ struct btMultiBodyLinkDoubleData
double m_jointPos[7];
double m_jointVel[6];
double m_jointTorque[6];
double m_jointDamping;
double m_jointFriction;
};
@@ -721,7 +722,8 @@ struct btMultiBodyLinkFloatData
float m_jointVel[6];
float m_jointTorque[6];
int m_posVarCount;
float m_jointDamping;
float m_jointFriction;
};

View File

@@ -132,8 +132,10 @@ btVector3 m_appliedConstraintForce; // In WORLD frame
const char* m_linkName;//m_linkName memory needs to be managed by the developer/user!
const char* m_jointName;//m_jointName memory needs to be managed by the developer/user!
btScalar m_jointDamping; //todo: implement this internally. It is unused for now, it is set by a URDF loader. User can apply manual damping.
btScalar m_jointFriction; //todo: implement this internally. It is unused for now, it is set by a URDF loader. User can apply manual friction using a velocity motor.
// ctor: set some sensible defaults
// ctor: set some sensible defaults
btMultibodyLink()
: m_mass(1),
m_parent(-1),
@@ -146,7 +148,9 @@ btVector3 m_appliedConstraintForce; // In WORLD frame
m_jointType(btMultibodyLink::eInvalid),
m_jointFeedback(0),
m_linkName(0),
m_jointName(0)
m_jointName(0),
m_jointDamping(0),
m_jointFriction(0)
{
m_inertiaLocal.setValue(1, 1, 1);

File diff suppressed because it is too large Load Diff