public void RemoveRope(Rope rope)
{
foreach (var joint in rope.PhysicsSegmentJoints)
{
PhysicsWorld.RemoveJoint(joint);
}
rope.PhysicsSegmentJoints.Clear();
foreach (var body in rope.PhysicsSegments)
{
RopesByPhysicsBody.Remove(body);
RemoveBody(body);
}
rope.PhysicsSegments.Clear();
if (rope.AttachedEntity is Ball)
{
(rope.AttachedEntity as Ball).PhysicsBody.Mass = 10f;
(rope.AttachedEntity as Ball).PhysicsBody.FixedRotation = true;
}
}