I want to create a custom line trace that returns all hits along a path.
I think from scanning through the engine code and reading the PhysX documentation here that I want to add the PxHitFlag::eMULTIPLE flag to the RaycastMulti code inside of PhysXCollision.cpp
Is there a way to create my own version of this function without changing the engine code?
I tried to copy out the relevant lines and paste them into a new class but had problems with not being able to see any of the PhysX includes.
I found a solution to this after a little bit of work and some help from Rama’s tutorial on integrating PhysX code in to your project. First off I needed to include the PhysX and APEX modules in my Build.cs
I only wanted the location of the hit and the physical material so that is all the FHitResult returns.
Hopefully this will be useful to someone in the future. Warning to anyone who wants to use this function, it is a very particular use case that is more expensive than the solutions offered by the engine, for most purposes the LineTrace or MultiLineTrace should suffice.