Make MouseJoint:getBodies() return only one body (fixes #1179)

Override Joint's Body getters in MouseJoint, to make the second (user-supplied) body the first body returned, and return nil for the second (internal) body
This commit is contained in:
Bart van Strien
2016-07-14 16:39:29 +02:00
parent 64ee986984
commit 65f53a491f
4 changed files with 16 additions and 2 deletions
+10
View File
@@ -91,6 +91,16 @@ float MouseJoint::getDampingRatio() const
return joint->GetDampingRatio();
}
Body *MouseJoint::getBodyA() const
{
return Joint::getBodyB();
}
Body *MouseJoint::getBodyB() const
{
return nullptr;
}
} // box2d
} // physics
} // love