btMultiBodyFixedConstraint.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library
  3. Copyright (c) 2013 Erwin Coumans http://bulletphysics.org
  4. This software is provided 'as-is', without any express or implied warranty.
  5. In no event will the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it freely,
  8. subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  10. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  11. 3. This notice may not be removed or altered from any source distribution.
  12. */
  13. ///This file was written by Erwin Coumans
  14. #ifndef BT_MULTIBODY_FIXED_CONSTRAINT_H
  15. #define BT_MULTIBODY_FIXED_CONSTRAINT_H
  16. #include "btMultiBodyConstraint.h"
  17. class btMultiBodyFixedConstraint : public btMultiBodyConstraint
  18. {
  19. protected:
  20. btRigidBody* m_rigidBodyA;
  21. btRigidBody* m_rigidBodyB;
  22. btVector3 m_pivotInA;
  23. btVector3 m_pivotInB;
  24. btMatrix3x3 m_frameInA;
  25. btMatrix3x3 m_frameInB;
  26. public:
  27. btMultiBodyFixedConstraint(btMultiBody* body, int link, btRigidBody* bodyB, const btVector3& pivotInA, const btVector3& pivotInB, const btMatrix3x3& frameInA, const btMatrix3x3& frameInB);
  28. btMultiBodyFixedConstraint(btMultiBody* bodyA, int linkA, btMultiBody* bodyB, int linkB, const btVector3& pivotInA, const btVector3& pivotInB, const btMatrix3x3& frameInA, const btMatrix3x3& frameInB);
  29. virtual ~btMultiBodyFixedConstraint();
  30. virtual void finalizeMultiDof();
  31. virtual int getIslandIdA() const;
  32. virtual int getIslandIdB() const;
  33. virtual void createConstraintRows(btMultiBodyConstraintArray& constraintRows,
  34. btMultiBodyJacobianData& data,
  35. const btContactSolverInfo& infoGlobal);
  36. const btVector3& getPivotInA() const
  37. {
  38. return m_pivotInA;
  39. }
  40. void setPivotInA(const btVector3& pivotInA)
  41. {
  42. m_pivotInA = pivotInA;
  43. }
  44. const btVector3& getPivotInB() const
  45. {
  46. return m_pivotInB;
  47. }
  48. virtual void setPivotInB(const btVector3& pivotInB)
  49. {
  50. m_pivotInB = pivotInB;
  51. }
  52. const btMatrix3x3& getFrameInA() const
  53. {
  54. return m_frameInA;
  55. }
  56. void setFrameInA(const btMatrix3x3& frameInA)
  57. {
  58. m_frameInA = frameInA;
  59. }
  60. const btMatrix3x3& getFrameInB() const
  61. {
  62. return m_frameInB;
  63. }
  64. virtual void setFrameInB(const btMatrix3x3& frameInB)
  65. {
  66. m_frameInB = frameInB;
  67. }
  68. virtual void debugDraw(class btIDebugDraw* drawer);
  69. };
  70. #endif //BT_MULTIBODY_FIXED_CONSTRAINT_H