@Override
	public void keyPressed(char keyChar, int keyCode) {
		switch (keyChar) {
		case 'j':
			if (rope == null) {
				//rope = createRope(getWorld(), thickness, resolution, base, weight, new Vec2(0, 0), weight.getWorldPoint(new Vec2(3f, 0f)));
				Vec2 localFrom = new Vec2(3f, 0f);
				Vec2 worldFrom = weight.getWorldPoint(localFrom);
				Vec2 ray = new Vec2(0, 0).sub(worldFrom);
				float angle = (float)Math.atan2(ray.y, ray.x);
				rope = shootRope(getWorld(), null, thickness, resolution, weight, localFrom, angle);
			}
			else {
				for (Joint joint : rope.joints)
					if (joint != null)
						getWorld().destroyJoint(joint);
				for (Body segment : rope.segments)
					getWorld().destroyBody(segment);
				rope = null;
			}
		}
	}