class

FMeshCollisionGenerator

Turns render geometry into the authored primitives a mesh's collision setup stores. Everything here runs at AUTHOR time (the mesh editor's Generate buttons), never at body creation — the cook path consumes the result.

Module
Physics
Header
#include "Physics/MeshCollisionBuild.h"
Namespace
Mowo

It lives in Physics because the hull reduction is Jolt's ConvexHullBuilder, and Jolt is private to the Physics image: its allocator globals exist once.

Public functions

ReturnsNameDescription
FMeshCollisionPrimitiveFitBoxTightest axis-aligned box / bounding sphere / capsule around the cloud.
FMeshCollisionPrimitiveFitSphere
FMeshCollisionPrimitiveFitCapsule
FMeshCollisionPrimitiveBuildKDopK-DOP: the cloud clipped by 10, 18 or 26 fixed direction pairs and returned as the resulting polytope's corners.
boolBuildConvexHullOne hull over the whole cloud, reduced to at most maxVertices.
boolDecomposeApproximate convex decomposition.
floatMeasureConcavityHow far the mesh's own convex hull strays from the mesh, as a fraction of the hull radius: 0 for a convex mesh, and the size of the gap the hull would have filled in for a concave one.

Function details

FitBox

C++
static FMeshCollisionPrimitive FitBox(const std::vector<Vec3>& points)

Tightest axis-aligned box / bounding sphere / capsule around the cloud. The capsule picks its axis from the cloud's longest extent and rotates onto it, because Jolt capsules are Y-major and a Z-major prop wrapped in an unrotated capsule is a sphere with the prop poking out of both ends.

FitSphere

C++
static FMeshCollisionPrimitive FitSphere(const std::vector<Vec3>& points)

FitCapsule

C++
static FMeshCollisionPrimitive FitCapsule(const std::vector<Vec3>& points)

BuildKDop

C++
static FMeshCollisionPrimitive BuildKDop(const std::vector<Vec3>& points, int32_t dopDirections)

K-DOP: the cloud clipped by 10, 18 or 26 fixed direction pairs and returned as the resulting polytope's corners. Circumscribed, so the result always contains the mesh — which is what a simple collider has to be, or a character walks through the wall it is standing against. Any other direction count is read as 26.

BuildConvexHull

C++
static bool BuildConvexHull(const std::vector<Vec3>& points, int32_t maxVertices, FMeshCollisionPrimitive& out)

One hull over the whole cloud, reduced to at most maxVertices.

Decompose

C++
static bool Decompose(const std::vector<Vec3>& points, const std::vector<uint32_t>& indices, const FMeshDecompositionSettings& settings, std::vector<FMeshCollisionPrimitive>& out)

Approximate convex decomposition. Splits the piece with the worst concavity first and stops on the settings' budget, so a shape that needs three hulls gets three rather than the ceiling.

MeasureConcavity

C++
static float MeasureConcavity(const std::vector<Vec3>& points, const std::vector<uint32_t>& indices)

How far the mesh's own convex hull strays from the mesh, as a fraction of the hull radius: 0 for a convex mesh, and the size of the gap the hull would have filled in for a concave one. It needs the triangles, not just the cloud — the inner corner of a flat L-prism is a hull vertex like any other, so nothing about the vertex set alone says the hull invented a face there.

Generated from Physics/MeshCollisionBuild.h via physics.json · Nov 4, 2026Version 1.0.0