ECS - Parallel legacy Collider traversal?

Hi, I need to determine if a set of colliders are enabled / disabled and I’d like to do it in parallel. Is there any way to traverse these in parallel a parallel job so that doesn’t happen in the main thread?

Thanks!

Nope. Component access needs to happen on the main thread.

You’ll of course be able to do this if you implement Unity Physics. You could alternatively swap your component-based colliders with this .

Hey thanks for the quick response! I can’t switch to Unity Physics, I need to work with old school colliders because all the code base is based on that.

I don’t understand this: “You could alternatively swap your component-based colliders with this .”

Can you explain a little bit further, please?

The word “this” has a link.

Yeah I noticed that :slight_smile: I just don’t understand how the PhysX 4 plugin can help me retrieveing this information in an efficient way.

Another side question is: is there any Unity C++ API so that I could create my native plugin and query that information from C++?

You’d have to replace your colliders with the equivalent physx plugin ones, as those are independent from components. Though if you have to work with old school colliders, that’s not an option. But since there’s a 1-1 relation between the colliders and their physx version, you could write code to iterate your scenes and assets and replace them.

That’s a major undertaking, but since component access in main-thread only, you’d have to do something like that to parallelize collider access.

To get access to the c++ side of Unity, you have to buy a source license. Those are probably not cheap - their price is not listed publicly.

I see.

As for the C++ question: I was thinking on a possible plugin C++ API just like the one that exist for low level C++ graphics, so that the source code of Unity is not needed.