Why StaticMesh returning different vertices from renderdata & physx body?


Right now im implementing softbodies in unreal. ( Not nVidia Flex ) (Mass spring based)

I want to clone same mesh with proceduralmesh component. So i need triangles and vertices.
There is 2 way for this. First i can use RenderData from staticmesh
Or i can use PHYSX TriMesh and return them all.

When i get mesh from RenderData i can access UV’s, materials … Physx only gives vertices and triangles.

But my main problem, if i use STATICMESH RenderData returning vertices and triangles different than PHYSX. Why this happens ? And if i use RenderData mesh looks like cutted from some points. In rigid body this is no problem but in Softbodies it affects everything.

Sorry for my bad english.

The representation that PhysX uses of the mesh is usually simplified over what you see rendered. PhysX only cares about the vertex position, so you’ll never get the other information from there. Beyond that PhysX runs a cook step on the mesh where it does multiple things to improve collision performance. One of these steps is duplicate vertex removal which is probably what you’re seeing. The only way to keep this from happening is to set eDISABLE_CLEAN_MESH in the cooker for the object you care about.

I’m working on some things with the RuntimeMeshComponent that might be of use here.