FPhysScene GetPhysXScene export

Hi C++ developers,

Is there a reason why FPhysScene::GetPhysXScene is not exported (ENGINE_API) ?

I need it in my C++ plugin, to launch massive batched collision queries in threads, and 2000+ UWorld::LineTraceSingle seems inappropriate…

Thank you.

My guess, without looking at how it works, is that it’s not exposed because the FPhysScene is supposed to be generic, rather than tied to PhysX (idea being you could implement your own physics engine under it like PhysX is implemented, and use the stock code with your new physics engine).

What you should probably do is just implement a generic interface into FPhysScene for doing what you want on the PhysXScene. So if it’s batched collision queries, you’d make your FPhysScene::BatchQuery function or whatever, which in turn calls down to the PhysX code in whatever way FPhysScene normally does that.

I hope that makes sense. Also, I may be totally off base, as I haven’t looked into this class myself, I’m just going off of how these types of middle-ware agnostic game engine systems are typically built.

Yes, you are totally right, doing it in the interface in the core engine is the right way.

I could give it a try, but as I developing a plugin I want touch the core the least possible (distributing the plugin with a diff can become messy).

But Thank you, I think I will patch the engine, maybe pull request after that…

If you need help, reply again - I’ll check back. I have some experience with using PhysX directly/integrating it into engines (though no experience with how its used in UE) so I may be able to help if you run into issues. Good luck!

We actually want to expose some kind of ‘batch query’ API at some point, probably on UWorld like our current query API. If you want to take a go at this and submit it as a pull request on github we can take a look!

Out of interest, what does your plugin do?