Fix RopeJoints not working.

This commit is contained in:
Alex Szpakowski
2020-11-12 23:46:49 -04:00
parent 6a1f4ecabe
commit fc2cf602f6
7 changed files with 3 additions and 367 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ RopeJoint::RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, flo
: Joint(body1, body2)
, joint(NULL)
{
b2RopeJointDef def;
b2DistanceJointDef def;
def.bodyA = body1->body;
def.bodyB = body2->body;
body1->getLocalPoint(x1, y1, x1, y1);
@@ -49,7 +49,7 @@ RopeJoint::RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, flo
def.localAnchorB.y = Physics::scaleDown(y2);
def.maxLength = Physics::scaleDown(maxLength);
def.collideConnected = collideConnected;
joint = (b2RopeJoint *)createJoint(&def);
joint = (b2DistanceJoint *)createJoint(&def);
}
RopeJoint::~RopeJoint()
+1 -1
View File
@@ -56,7 +56,7 @@ public:
private:
// The Box2D RopeJoint object.
b2RopeJoint *joint;
b2DistanceJoint *joint;
};
} // box2d