Ensure convex polygon does not panic due to invalid amount of points
I'm constantly running into panics, due to
parry2d-0.13.5\src\shape\convex_polygon.rs:185:59:
index out of bounds: the len is 2 but the index is 2
This occurs more often than normally (I assume), because I create compound shapes at runtime after deforming objects into smaller ones.
It should not be possible to create a polygon that has less than 3 points. Also, it should be ensured that no empty points is passed. That fixes another crash where normals[0] indexes points that don't exist.
Related #65 and #50
Calling Rapier's ColliderBuilder::convex_decomposition_with_params(&vertices, &indices, &VHACDParameters { resolution: x, ..}) with 3-4 vertices all approximately x distance from each other seems to be a pretty reliable way to trigger the underlying issue here in Parry.
Thank you!