Download

How to lock physics scene

I’m make a function to get the total volume of a ustaticmeshcomponent for a wind effect I’m making and I’ve determined that getting all the primitive shapes for collision in the staticmesh and getting their volumes is the easiest way. I will assume each object is a sphere for the wind calculations, but to determine the surface area of this theoretical sphere I need the radius it should be which means I need the volume. I thought about using the bounding box, but for a lot of my models that would assume a very large sphere.

I’m pretty sure using FBodyInstance::GetAllShapes_AssumesLocked | Unreal Engine Documentation is the way to do it, but it talks about being not thread safe and I do not know how to lock the physics scene like it says I should. I’ve googled it to no avail, any help on how to lock and unlock the physics scene so I can use this function would be greatly appreciated.