What steps will reproduce the problem?
1. Create a polygon fixture using the following vertices:
(0,0)
(10,10)
(5,5)
(3,3)
(any set where 3 or more vertices are collinear)
2. These vertices are collinear and are expected to be incorrect.
3. "b2PolygonShape::Set()" will fail because it uses the gift-wrapping
algorithm as described here
(http://en.wikipedia.org/wiki/Gift_wrapping_algorithm) which assumes no three
points are collinear. This results in a stack corruption if this is the case.
What is the expected output? What do you see instead?
The polygon to be set as degenerate.
What version of the product are you using? On what operating system?
v2.3.0
Please provide any additional information below.
It would be extremely valuable to be able to explicitly check an arbitrary set
of points for validity using Box2Ds code i.e. "b2PolygonShape::Validate (const
b2Vec2* vertices, int32 count)". This could not only include degenerate checks
but other checks such as valid area which is done when calculating the centroid
of said polygon (area > b2_epsilon).
Original issue reported on code.google.com by melv....@gmail.com on 13 Jan 2014 at 9:10
Original issue reported on code.google.com by
melv....@gmail.com
on 13 Jan 2014 at 9:10