toConvexHullShape method

ConvexHullShape toConvexHullShape()

A collision convex hull enclosing this mesh's vertices.

The backend computes the hull from the positions, so concave detail is filled in. Unlike toTriMeshShape the result is solid and works on a dynamic body.

Implementation

ConvexHullShape toConvexHullShape() {
  if (vertexCount == 0) {
    throw StateError('toConvexHullShape requires at least one vertex');
  }
  return ConvexHullShape(points: Float32List.fromList(positions));
}