diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-11 13:18:05 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-11 13:19:42 +0200 |
commit | 99acec63f175fecd7172c927263ed3787cb082d6 (patch) | |
tree | 183329f17c5c74b49d60058c5511d532f70b6e35 /thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h | |
parent | 7b883d7d50fdcac09afe09de859816da07ddc1e7 (diff) |
bullet: Sync with current upstream master branch
This updates our local copy to commit 5ec8339b6fc491e3f09a34a4516e82787f053fcc.
We need a recent master commit for some new features that we use in Godot
(see #25543 and #28909).
To avoid warnings generated by Bullet headers included in our own module,
we include those headers with -isystem on GCC and Clang.
Fixes #29503.
Diffstat (limited to 'thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h')
-rw-r--r-- | thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h b/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h index e5c0f1806b..c0b0d003be 100644 --- a/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h +++ b/thirdparty/bullet/BulletDynamics/Featherstone/btMultiBody.h @@ -65,7 +65,7 @@ public: virtual ~btMultiBody(); //note: fixed link collision with parent is always disabled - void setupFixed(int linkIndex, + void setupFixed(int i, //linkIndex btScalar mass, const btVector3 &inertia, int parent, @@ -83,7 +83,7 @@ public: const btVector3 &thisPivotToThisComOffset, bool disableParentCollision); - void setupRevolute(int linkIndex, // 0 to num_links-1 + void setupRevolute(int i, // 0 to num_links-1 btScalar mass, const btVector3 &inertia, int parentIndex, @@ -93,7 +93,7 @@ public: const btVector3 &thisPivotToThisComOffset, // vector from joint axis to my COM, in MY frame bool disableParentCollision = false); - void setupSpherical(int linkIndex, // 0 to num_links-1 + void setupSpherical(int i, // linkIndex, 0 to num_links-1 btScalar mass, const btVector3 &inertia, int parent, @@ -182,7 +182,10 @@ public: // get/set pos/vel/rot/omega for the base link // - const btVector3 &getBasePos() const { return m_basePos; } // in world frame + const btVector3 &getBasePos() const + { + return m_basePos; + } // in world frame const btVector3 getBaseVel() const { return btVector3(m_realBuf[3], m_realBuf[4], m_realBuf[5]); @@ -274,15 +277,15 @@ public: // // transform vectors in local frame of link i to world frame (or vice versa) // - btVector3 localPosToWorld(int i, const btVector3 &vec) const; - btVector3 localDirToWorld(int i, const btVector3 &vec) const; - btVector3 worldPosToLocal(int i, const btVector3 &vec) const; - btVector3 worldDirToLocal(int i, const btVector3 &vec) const; + btVector3 localPosToWorld(int i, const btVector3 &local_pos) const; + btVector3 localDirToWorld(int i, const btVector3 &local_dir) const; + btVector3 worldPosToLocal(int i, const btVector3 &world_pos) const; + btVector3 worldDirToLocal(int i, const btVector3 &world_dir) const; // // transform a frame in local coordinate to a frame in world coordinate // - btMatrix3x3 localFrameToWorld(int i, const btMatrix3x3 &mat) const; + btMatrix3x3 localFrameToWorld(int i, const btMatrix3x3 &local_frame) const; // // calculate kinetic energy and angular momentum @@ -451,7 +454,10 @@ public: // void setCanSleep(bool canSleep) { - m_canSleep = canSleep; + if (m_canWakeup) + { + m_canSleep = canSleep; + } } bool getCanSleep() const @@ -459,6 +465,15 @@ public: return m_canSleep; } + bool getCanWakeup() const + { + return m_canWakeup; + } + + void setCanWakeup(bool canWakeup) + { + m_canWakeup = canWakeup; + } bool isAwake() const { return m_awake; } void wakeUp(); void goToSleep(); @@ -469,6 +484,11 @@ public: return m_fixedBase; } + void setFixedBase(bool fixedBase) + { + m_fixedBase = fixedBase; + } + int getCompanionId() const { return m_companionId; @@ -556,11 +576,11 @@ public: { return m_internalNeedsJointFeedback; } - void forwardKinematics(btAlignedObjectArray<btQuaternion> & scratch_q, btAlignedObjectArray<btVector3> & scratch_m); + void forwardKinematics(btAlignedObjectArray<btQuaternion>& world_to_local, btAlignedObjectArray<btVector3> & local_origin); void compTreeLinkVelocities(btVector3 * omega, btVector3 * vel) const; - void updateCollisionObjectWorldTransforms(btAlignedObjectArray<btQuaternion> & scratch_q, btAlignedObjectArray<btVector3> & scratch_m); + void updateCollisionObjectWorldTransforms(btAlignedObjectArray<btQuaternion> & world_to_local, btAlignedObjectArray<btVector3> & local_origin); virtual int calculateSerializeBufferSize() const; @@ -688,6 +708,7 @@ private: // Sleep parameters. bool m_awake; bool m_canSleep; + bool m_canWakeup; btScalar m_sleepTimer; void *m_userObjectPointer; |