Improve cannon example
- Store the box and sphere components for faster creation.
- Set 'collisionShapes' to the empty set when destroying the objects.
This is a hack to avoid the issue of the boxes exploding upon
recreation. The issue is that calling destroy on a qml object does not
delete it immediately so sometimes old boxes are left when the new
stacks are spawned leading to explosive collisions.
Pick-to: 6.5
Change-Id: Ia842d69d99470c641d9fb73b495d6c695f141b94
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>