Code: Select all
List<Vector3> vertices = GetCollisionVertices(input);
for (int i = 0; i < vertices.Count; i++)
{
SysConsole.Output(OutputType.INFO, "VERT: " + vertices[i]);
}
return new ConvexHullShape(vertices);
I got this error:
The vertex list used (edited to be a shorter bit of spam)System.ArgumentException: Invalid distance. Ensure the mesh is convex, has consistent winding, and contains the passed-in center.
at BEPUphysics.CollisionShapes.ConvexShapes.InertiaHelper.ComputeMinimumRadius(IList`1 vertices, IList`1 triangleIndices, Vector3& center) in C:\Users\mcmonkey\Desktop\bepuphysics-c903135c4aea\bepu
physics_c903135c4aea\BEPUphysics\CollisionShapes\ConvexShapes\InertiaHelper.cs:line 566
at BEPUphysics.CollisionShapes.ConvexShapes.ConvexHullShape.ComputeDescription(IList`1 vertices, Single collisionMargin, Vector3& center, IList`1 outputHullTriangleIndices, IList`1 outputUniqueSurf
aceVertices) in C:\Users\mcmonkey\Desktop\bepuphysics-c903135c4aea\bepuphysics_c903135c4aea\BEPUphysics\CollisionShapes\ConvexShapes\ConvexHullShape.cs:line 170
at BEPUphysics.CollisionShapes.ConvexShapes.ConvexHullShape..ctor(IList`1 vertices) in C:\Users\mcmonkey\Desktop\bepuphysics-c903135c4aea\bepuphysics_c903135c4aea\BEPUphysics\CollisionShapes\Convex
Shapes\ConvexHullShape.cs:line 48
The vertices might be wound backwards (not really sure which way they're wound actually, or if they form valid triangles at all)... but that should be irrelevant, as this is a convex hull, not a triangle mesh. If I understand convex hulls correctly, the input is a list of points in space to be wrapped around, not triangles, right?{-0.2847493, 1.846569, 0} {-0.2847493, 1.811087, -0.3602477} {0.2847494, 1.811087, -0.3602476} {-0.2847493, 1.706007, -0.7066513} {0.2847495, 1.706007, -0.7066513} {0.2847494, 1.811087, -0.3602476} {-0.2847493, 1.706007, -0.7066513} {-0.2847493, 1.535366, -1.025899} {0.2847494, 1.535366, -1.025899} {-0.2847493, 1.535366, -1.025899} {-0.2847493, 1.305721, -1.305722} {0.2847495, 1.305721, -1.305721} {-0.2847493, 1.305721, -1.305722} {-0.2847493, 1.025898, -1.535366} {0.2847494, 1.025898, -1.535366} {-0.2847493, 1.025898, -1.535366} {-0.2847493, 0.7066511, -1.706007} {0.2847494, 0.7066511, -1.706007} {-0.2847493, 0.7066511, -1.706007} {-0.2847493, 0.3602475, -1.811088} {0.2847494, 0.3602475, -1.811088} {-0.2847493, 0.3602475, -1.811088} {-0.2847493, -1.57037E-07, -1.846569} {0.2847494, -1.57037E-07, -1.846569} {-0.2847493, -0.3602478, -1.811088} {0.2847495, -0.3602478, -1.811088} {0.2847494, -1.57037E-07, -1.846569} {-0.2847493, -0.7066514, -1.706008} {0.2847495, -0.7066514, -1.706007} {0.2847495, -0.3602478, -1.811088} {-0.2847493, -1.025899, -1.535366} {0.2847494, -1.025899, -1.535366} {0.2847495, -0.7066514, -1.706007} {-0.2847493, -1.305722, -1.305722} {0.2847495, -1.305722, -1.305721} {0.2847494, -1.025899, -1.535366} {-0.2847493, -1.535366, -1.025899} {0.2847495, -1.535366, -1.025899} {0.2847495, -1.305722, -1.305721} {-0.2847493, -1.706008, -0.7066511} {0.2847494, -1.706008, -0.7066509} {0.2847495, -1.535366, -1.025899} {-0.2847493, -1.811088, -0.3602473} {0.2847494, -1.811088, -0.3602471} {0.2847494, -1.706008, -0.7066509} {-0.2847493, -1.846569, 6.74576E-07} {0.2847495, -1.846569, 8.94705E-07} {0.2847494, -1.811088, -0.3602471} {-0.2847493, -1.811088, 0.3602486} {0.2847495, -1.811088, 0.3602486} {0.2847495, -1.846569, 8.94705E-07} {-0.2847493, -1.706007, 0.7066523} {0.2847495, -1.706007, 0.7066525} {0.2847495, -1.811088, 0.3602486} {-0.2847493, -1.535366, 1.0259} {0.2847495, -1.535366, 1.0259} {0.2847495, -1.706007, 0.7066525} {-0.2847493, -1.305721, 1.305722} {0.2847494, -1.305721, 1.305723} {0.2847495, -1.535366, 1.0259} {-0.2847493, -1.025898, 1.535367} {0.2847494, -1.025898, 1.535367} {0.2847494, -1.305721, 1.305723} {-0.2847493, -0.7066503, 1.706008} {0.2847494, -0.7066503, 1.706008} {0.2847494, -1.025898, 1.535367} {-0.2847493, -0.7066503, 1.706008} {-0.2847495, -0.3602464, 1.811088} {0.2847494, -0.3602464, 1.811088} {-0.2847493, 1.4866E-06, 1.846569} {0.2847494, 1.4866E-06, 1.846569} {0.2847494, -0.3602464, 1.811088} {-0.2847493, 1.4866E-06, 1.846569} {-0.2847493, 0.3602494, 1.811087} {0.2847494, 0.3602494, 1.811088} {-0.2847493, 0.3602494, 1.811087} {-0.2847493, 0.706653, 1.706007} {0.2847494, 0.706653, 1.706007} {-0.2847493, 0.706653, 1.706007} {-0.2847493, 1.0259, 1.535365} {0.2847494, 1.0259, 1.535365} {-0.2847493, 1.0259, 1.535365} {-0.2847493, 1.305723, 1.30572} {0.2847494, 1.305723, 1.30572} {-0.2847493, 1.535367, 1.025897} {0.2847495, 1.535367, 1.025897} {0.2847494, 1.305723, 1.30572} {-0.2847493, 1.535367, 1.025897} {-0.2847493, 1.706008, 0.706649} {0.2847495, 1.706008, 0.7066493} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, 1.535366, -1.025899} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.811088, 0.3602451} {-0.2847493, 1.846569, 0} {0.2847495, 1.846569, 2.3432E-07} {-0.2847493, 1.706008, 0.706649} {-0.2847493, 1.811088, 0.3602451} {0.2847495, 1.811088, 0.3602451} {0.2847494, -1.305721, 1.305723} {0.2847495, 1.706007, -0.7066513} {0.2847495, 1.305721, -1.305721} {-0.2847493, 1.846569, 0} {0.2847494, 1.811087, -0.3602476} {0.2847495, 1.846569, 2.3432E-07} {-0.2847493, 1.706007, -0.7066513} {0.2847494, 1.811087, -0.3602476} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.706007, -0.7066513} {0.2847494, 1.535366, -1.025899} {0.2847495, 1.706007, -0.7066513} {-0.2847493, 1.535366, -1.025899} {0.2847495, 1.305721, -1.305721} {0.2847494, 1.535366, -1.025899} {-0.2847493, 1.305721, -1.305722} {0.2847494, 1.025898, -1.535366} {0.2847495, 1.305721, -1.305721} {-0.2847493, 1.025898, -1.535366} {0.2847494, 0.7066511, -1.706007} {0.2847494, 1.025898, -1.535366} {-0.2847493, 0.7066511, -1.706007} {0.2847494, 0.3602475, -1.811088} {0.2847494, 0.7066511, -1.706007} {-0.2847493, 0.3602475, -1.811088} {0.2847494, -1.57037E-07, -1.846569} {0.2847494, 0.3602475, -1.811088} {-0.2847493, -0.3602478, -1.811088} {0.2847494, -1.57037E-07, -1.846569} {-0.2847493, -1.57037E-07, -1.846569} {-0.2847493, -0.7066514, -1.706008} {0.2847495, -0.3602478, -1.811088} {-0.2847493, -0.3602478, -1.811088} {-0.2847493, -1.025899, -1.535366} {0.2847495, -0.7066514, -1.706007} {-0.2847493, -0.7066514, -1.706008} {-0.2847493, -1.305722, -1.305722} {0.2847494, -1.025899, -1.535366} {-0.2847493, -1.025899, -1.535366} {-0.2847493, -1.535366, -1.025899} {0.2847495, -1.305722, -1.305721} {-0.2847493, -1.305722, -1.305722} {-0.2847493, -1.706008, -0.7066511} {0.2847495, -1.535366, -1.025899} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -1.811088, -0.3602473} {0.2847494, -1.706008, -0.7066509} {-0.2847493, -1.706008, -0.7066511} {-0.2847493, -1.846569, 6.74576E-07} {0.2847494, -1.811088, -0.3602471} {-0.2847493, -1.811088, -0.3602473} {-0.2847493, -1.811088, 0.3602486} {0.2847495, -1.846569, 8.94705E-07} {-0.2847493, -1.846569, 6.74576E-07} {-0.2847493, -1.706007, 0.7066523} {0.2847495, -1.811088, 0.3602486} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, -1.535366, 1.0259} {0.2847495, -1.706007, 0.7066525} {-0.2847493, -1.706007, 0.7066523} {-0.2847493, -1.305721, 1.305722} {0.2847495, -1.535366, 1.0259} {-0.2847493, -1.535366, 1.0259} {-0.2847493, -1.025898, 1.535367} {0.2847494, -1.305721, 1.305723} {-0.2847493, -1.305721, 1.305722} {-0.2847493, -0.7066503, 1.706008} {0.2847494, -1.025898, 1.535367} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -0.7066503, 1.706008} {0.2847494, -0.3602464, 1.811088} {0.2847494, -0.7066503, 1.706008} {-0.2847493, 1.4866E-06, 1.846569} {0.2847494, -0.3602464, 1.811088} {-0.2847495, -0.3602464, 1.811088} {-0.2847493, 1.4866E-06, 1.846569} {0.2847494, 0.3602494, 1.811088} {0.2847494, 1.4866E-06, 1.846569} {-0.2847493, 0.3602494, 1.811087} {0.2847494, 0.706653, 1.706007} {0.2847494, 0.3602494, 1.811088} {-0.2847493, 0.706653, 1.706007} {0.2847494, 1.0259, 1.535365} {0.2847494, 0.706653, 1.706007} {-0.2847493, 1.0259, 1.535365} {0.2847494, 1.305723, 1.30572} {0.2847494, 1.0259, 1.535365} {-0.2847493, 1.535367, 1.025897} {0.2847494, 1.305723, 1.30572} {-0.2847493, 1.305723, 1.30572} {-0.2847493, 1.535367, 1.025897} {0.2847495, 1.706008, 0.7066493} {0.2847495, 1.535367, 1.025897} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.846569, 0} {-0.2847493, 1.811088, 0.3602451} {-0.2847493, 1.811088, 0.3602451} {-0.2847493, 1.706008, 0.706649} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.535367, 1.025897} {-0.2847493, 1.305723, 1.30572} {-0.2847493, 1.0259, 1.535365} {-0.2847493, 1.0259, 1.535365} {-0.2847493, 0.706653, 1.706007} {-0.2847493, 0.3602494, 1.811087} {-0.2847493, 0.3602494, 1.811087} {-0.2847493, 1.4866E-06, 1.846569} {-0.2847493, -1.025898, 1.535367} {-0.2847495, -0.3602464, 1.811088} {-0.2847493, -0.7066503, 1.706008} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -1.305721, 1.305722} {-0.2847493, -1.535366, 1.0259} {-0.2847493, -1.535366, 1.0259} {-0.2847493, -1.706007, 0.7066523} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, -1.846569, 6.74576E-07} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -1.811088, -0.3602473} {-0.2847493, -1.706008, -0.7066511} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -1.305722, -1.305722} {-0.2847493, -0.7066514, -1.706008} {-0.2847493, -1.025899, -1.535366} {-0.2847493, -0.7066514, -1.706008} {-0.2847493, -1.305722, -1.305722} {-0.2847493, -0.3602478, -1.811088} {-0.2847493, -1.57037E-07, -1.846569} {-0.2847493, 0.3602475, -1.811088} {-0.2847493, 0.3602475, -1.811088} {-0.2847493, 0.7066511, -1.706007} {-0.2847493, 1.535366, -1.025899} {-0.2847493, 1.025898, -1.535366} {-0.2847493, 1.305721, -1.305722} {-0.2847493, 0.7066511, -1.706007} {-0.2847493, 1.535366, -1.025899} {-0.2847493, 1.706007, -0.7066513} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.706008, 0.706649} {-0.2847493, 1.535367, 1.025897} {-0.2847493, 1.535367, 1.025897} {-0.2847493, 1.0259, 1.535365} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.4866E-06, 1.846569} {-0.2847495, -0.3602464, 1.811088} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -1.706007, 0.7066523} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, -1.846569, 6.74576E-07} {-0.2847493, -1.811088, -0.3602473} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -0.7066514, -1.706008} {-0.2847493, -0.3602478, -1.811088} {-0.2847493, -0.3602478, -1.811088} {-0.2847493, 0.3602475, -1.811088} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, 1.305721, -1.305722} {-0.2847493, 1.535366, -1.025899} {-0.2847493, 0.7066511, -1.706007} {-0.2847493, 1.811087, -0.3602477} {-0.2847493, 1.0259, 1.535365} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, 0.3602494, 1.811087} {-0.2847493, -1.025898, 1.535367} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, -1.535366, -1.025899} {-0.2847493, -0.3602478, -1.811088} {-0.2847493, 0.3602475, -1.811088} {-0.2847493, 1.535366, -1.025899} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, 1.0259, 1.535365} {-0.2847493, 0.3602494, 1.811087} {-0.2847493, -1.811088, 0.3602486} {-0.2847493, 1.811088, 0.3602451} {0.2847495, 1.846569, 2.3432E-07} {0.2847495, 1.811088, 0.3602451} {-0.2847493, 1.706008, 0.706649} {0.2847495, 1.811088, 0.3602451} {0.2847495, 1.706008, 0.7066493} {0.2847495, 1.846569, 2.3432E-07} {0.2847494, 1.811087, -0.3602476} {0.2847495, 1.811088, 0.3602451} {0.2847495, 1.706007, -0.7066513} {0.2847494, 1.535366, -1.025899} {0.2847495, 1.305721, -1.305721} {0.2847495, 1.305721, -1.305721} {0.2847494, 1.025898, -1.535366} {0.2847494, 0.7066511, -1.706007} {0.2847494, 0.7066511, -1.706007} {0.2847494, 0.3602475, -1.811088} {0.2847495, 1.305721, -1.305721} {0.2847494, -1.57037E-07, -1.846569} {0.2847495, -0.3602478, -1.811088} {0.2847495, -0.7066514, -1.706007} {0.2847495, -0.7066514, -1.706007} {0.2847494, -1.025899, -1.535366} {0.2847495, -1.305722, -1.305721} {0.2847495, -1.305722, -1.305721} {0.2847495, -1.535366, -1.025899} {0.2847494, -1.811088, -0.3602471} {0.2847494, -1.706008, -0.7066509} {0.2847494, -1.811088, -0.3602471} {0.2847495, -1.535366, -1.025899} {0.2847495, -1.846569, 8.94705E-07} {0.2847495, -1.811088, 0.3602486} {0.2847495, -1.706007, 0.7066525} {0.2847495, -1.706007, 0.7066525} {0.2847495, -1.535366, 1.0259} {0.2847494, -1.305721, 1.305723} {0.2847494, -1.305721, 1.305723} {0.2847494, -1.025898, 1.535367} {0.2847494, -0.7066503, 1.706008} {0.2847494, -0.7066503, 1.706008} {0.2847494, -0.3602464, 1.811088} {0.2847494, 1.4866E-06, 1.846569} {0.2847494, 1.4866E-06, 1.846569} {0.2847494, 0.3602494, 1.811088} {0.2847494, 0.706653, 1.706007} {0.2847494, 0.706653, 1.706007} {0.2847494, 1.0259, 1.535365} {0.2847494, 1.305723, 1.30572} {0.2847494, 1.305723, 1.30572} {0.2847495, 1.535367, 1.025897} {0.2847495, 1.811088, 0.3602451} {0.2847495, 1.706008, 0.7066493} {0.2847495, 1.811088, 0.3602451} {0.2847495, 1.535367, 1.025897} {0.2847495, 1.706007, -0.7066513} {0.2847494, 0.706653, 1.706007} {0.2847495, 1.811088, 0.3602451} {0.2847495, 1.305721, -1.305721} {0.2847494, 0.3602475, -1.811088} {0.2847494, -1.57037E-07, -1.846569} {0.2847494, -1.57037E-07, -1.846569} {0.2847495, -0.7066514, -1.706007} {0.2847494, -1.811088, -0.3602471} {0.2847495, -1.305722, -1.305721} {0.2847494, -1.811088, -0.3602471} {0.2847495, -0.7066514, -1.706007} {0.2847495, -1.846569, 8.94705E-07} {0.2847495, -1.706007, 0.7066525} {0.2847494, -1.305721, 1.305723} {0.2847494, -1.305721, 1.305723} {0.2847494, -0.7066503, 1.706008} {0.2847495, 1.706007, -0.7066513} {0.2847494, 1.4866E-06, 1.846569} {0.2847494, 0.706653, 1.706007} {0.2847495, 1.706007, -0.7066513} {0.2847494, 1.305723, 1.30572} {0.2847495, 1.811088, 0.3602451} {0.2847494, 0.706653, 1.706007} {0.2847495, 1.706007, -0.7066513} {0.2847494, -0.7066503, 1.706008} {0.2847494, 1.4866E-06, 1.846569} {0.2847494, -1.57037E-07, -1.846569} {0.2847494, -1.811088, -0.3602471} {0.2847495, 1.305721, -1.305721} {0.2847495, -1.846569, 8.94705E-07} {0.2847494, -1.305721, 1.305723} {0.2847495, 1.305721, -1.305721} {0.2847495, 1.811088, 0.3602451} {0.2847494, 1.811087, -0.3602476} {0.2847495, 1.706007, -0.7066513} {0.2847495, 1.305721, -1.305721} {0.2847494, -1.811088, -0.3602471} {0.2847495, -1.846569, 8.94705E-07}
Also it's compiled locally to include recent edits, there's no modification to the convexhull code. It's built in release configuration (so line numbers are non-exact).