How to convert AStaticMeshActor in FConvex (Chaos Engine)

Hello everyone,

In order to find the smallest distance between two convex bodies,
I want to use the Chaos::GJKDistance function.

This function wants the two bodies as a “FConvex”.

How can I convert a AStaticMeshActor into a FConvex ??

Thank you in advance!!!
Greetings, Alex

Not sure this is the correct way to go but you could try something like this (check pointers for null first though)
StaticMeshActor->GetStaticMeshComponent()->GetBodySetup()->AggGeom.ConvexElems[INDEX].GetChaosConvexMesh()

Thank you very much for the quick answer!

The GetChaosConvexMesh() returns a TSharedPtr<Chaos::FConvex, ESPMode::ThreadSafe>

This might be a silly question:
Can you tell me how I get a Chaos::FConvex out of that TSharedPtr?

Because the Chaos::GJKDistance Function wants a Chaos::FConvex Object, not a pointer

Many greetings,
Alex

Edit:
Solved, thanks to UnrealEverything:
The
TSharedPtr<Chaos::FConvex, ESPMode::ThreadSafe> has a method ->Get() which gives you the pointer to the FConvex object.

So it is:

TSharedPtr<Chaos::FConvex, ESPMode::ThreadSafe> BBB = StaticMeshActor->GetStaticMeshComponent()->GetBodySetup()->AggGeom.ConvexElems[INDEX].GetChaosConvexMesh();
Chaos::FConvex *AAA = BBB.Get();

Then you dereference the pointer AAA and give it to the Chaos::GJKDistance Function

Thanks again!!!