| 1736 | } |
| 1737 | |
| 1738 | void PhysicsDemoBug5482::changeBodyCallback(Object* /*sender*/) |
| 1739 | { |
| 1740 | Sprite* node = _bodyInA ? _nodeB : _nodeA; |
| 1741 | if (_bodyInA) |
| 1742 | { |
| 1743 | _button->setString("Set Body To A"); |
| 1744 | } |
| 1745 | else |
| 1746 | { |
| 1747 | _button->setString("Set Body To B"); |
| 1748 | } |
| 1749 | |
| 1750 | if (_body->getOwner()) |
| 1751 | { |
| 1752 | _body->getOwner()->removeComponent(_body); |
| 1753 | } |
| 1754 | |
| 1755 | // very important to have always _body and sprite in sync (Fix: #712) |
| 1756 | node->setRotation(AX_DEGREES_TO_RADIANS(_body->getRotation())); |
| 1757 | |
| 1758 | node->addComponent(_body); |
| 1759 | _bodyInA = !_bodyInA; |
| 1760 | } |
| 1761 | |
| 1762 | std::string PhysicsDemoBug5482::title() const |
| 1763 | { |
nothing calls this directly
no test coverage detected