Hello. I have a body that is being created using the BodyFactory.CreatePolygon() method and I am sure that this is causing the problem. When I send 9 vertices into the method, an error is thrown in a completely different place in the Draw() method when
the RenderDebugData() method is called. If I reduce the quantity of vertices to less then 9, this error is not thrown.
This is the code for the debug draw render method. This has always worked just fine until now.
var projection = Matrix.CreateOrthographicOffCenter(0f, ConvertUnits.ToSimUnits(_graphics.GraphicsDevice.Viewport.Width),
Is there a limit to how many vertices I can use per polygon? I also thought maybe it has to do with 2 vertices being to close to each other. Is this a possibility?
Here is the error I get. Its an error about accessing an index of an array outside the bounds of the array. I assume its the array that is created from the projection variable? Totally stumped. Any help would be great.
IndexOutOfRangeException was unhandled
Index was outside the bounds of the array.