box2dweldjoint.cpp 566 B

123456789101112131415161718192021
  1. #include "box2dweldjoint.h"
  2. #include "box2dbody.h"
  3. #include "box2dworld.h"
  4. Box2DWeldJoint::Box2DWeldJoint(QDeclarativeItem *parent) :
  5. Box2DJoint(parent),
  6. mWeldJointDef(),
  7. mWeldJoint(0)
  8. {
  9. }
  10. void Box2DWeldJoint::createJoint()
  11. {
  12. mWeldJointDef.Initialize(bodyA()->body(), bodyB()->body(),
  13. bodyA()->body()->GetWorldCenter());
  14. mWeldJointDef.collideConnected = collideConnected();
  15. mWeldJoint = static_cast<b2WeldJoint*>(world()->CreateJoint(&mWeldJointDef));
  16. mInitializePending = false;
  17. }