btMultiBodyPoint2Point.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_POINT2POINT_H
  15. #define BT_MULTIBODY_POINT2POINT_H
  16. #include "btMultiBodyConstraint.h"
  17. //#define BTMBP2PCONSTRAINT_BLOCK_ANGULAR_MOTION_TEST
  18. ATTRIBUTE_ALIGNED16(class)
  19. btMultiBodyPoint2Point : public btMultiBodyConstraint
  20. {
  21. protected:
  22. btRigidBody* m_rigidBodyA;
  23. btRigidBody* m_rigidBodyB;
  24. btVector3 m_pivotInA;
  25. btVector3 m_pivotInB;
  26. public:
  27. BT_DECLARE_ALIGNED_ALLOCATOR();
  28. btMultiBodyPoint2Point(btMultiBody * body, int link, btRigidBody* bodyB, const btVector3& pivotInA, const btVector3& pivotInB);
  29. btMultiBodyPoint2Point(btMultiBody * bodyA, int linkA, btMultiBody* bodyB, int linkB, const btVector3& pivotInA, const btVector3& pivotInB);
  30. virtual ~btMultiBodyPoint2Point();
  31. virtual void finalizeMultiDof();
  32. virtual int getIslandIdA() const;
  33. virtual int getIslandIdB() const;
  34. virtual void createConstraintRows(btMultiBodyConstraintArray & constraintRows,
  35. btMultiBodyJacobianData & data,
  36. const btContactSolverInfo& infoGlobal);
  37. const btVector3& getPivotInB() const
  38. {
  39. return m_pivotInB;
  40. }
  41. virtual void setPivotInB(const btVector3& pivotInB)
  42. {
  43. m_pivotInB = pivotInB;
  44. }
  45. virtual void debugDraw(class btIDebugDraw * drawer);
  46. };
  47. #endif //BT_MULTIBODY_POINT2POINT_H