I have compex scene - landscape, lot of meshes, physical collisions.
I would like to use additional LineTrace against an narrow set of simple meshes (with simple collisions) - those objects are static (non moveable).
I figured out that performance of LineTraceSingleByObjectType is related rather to overall scene complexity, and do not improves when LineTrace is limited to specific collision channel.
Even when I AddObjectTypesToQuery only channel that has no object on scene - performance is still poor.
I can understand there is an scene-wide BVH tree that includes all the geometry, and every trace has to go thru whole BVH tree to hit something, and just in the end there is condition that checks is the hit object one of my channels of interest.
And that explains why LineTrace performance is related to scene complexity.
But is there an way to improve performance of LineTrace for small subset of meshes?
Like to preparte separate BVH tree with only those objects, and be able to do faster trace here?
Duplicating whole UWorld seems to be overkill, but maybe there is something else possible?
I tried also to set “No collision” for other objects.
It is not an solution for me, because it impacts also physical collision that I would like to have enabled.
But funny thing is that do not help for LineTrace performance. So it looks like condition “is collision enabled” is checked only when collision is detected, but not during BVH calculation (I guess because devs want to be able to quicky turn on and off collision).
Maybe some other out of the box ideas?