-
Notifications
You must be signed in to change notification settings - Fork 749
Feature: Use child colliders #227
base: v2
Are you sure you want to change the base?
Conversation
Thanks for the PR. It's an interesting feature but I have a few concerns.
So it is an interesting idea for sure, but one that will add another layer of global complexity to make another existing sub-feature of the framework a bit easier to use. I'm not sure we want to go into that direction... I'm opened to discussion though. Edit: note that post-processing profiles are assets, you can use the same asset in different volumes and essentially do the same thing you propose to do here (instead of having multiple colliders for a single volume, although that would be more optimal). |
Hmm, I'm not sure I agree. In my opinion:
I guess I feel that using child colliders will be more popular than you indicate. I already use this version in many of my projects and the ability to easily move and rotate colliders as child objects (not to mention visualize them with a mesh renderer during prototyping) has been incredibly helpful. The entire reason I built this version is because I was trying to easily add a volume to a racetrack tunnel that was a part of a twisted spline. I was getting frustrated trying to get cubes to line up with a curved track. Using a mesh collider and increasing its blend distance also wasn't an option as the pivot of the mesh was perfectly centered (nor could it be with the shape). This solution solved the problem very quickly. Sure, it might add a UX quirk (though, could be cleaned up), but it improved my experience with the tool in many occasions by quite a lot. |
Out of curiosity I ran a benchmark for GetComponents versus GetComponentsInChildren. I used 1 object with 5 colliders and another object (with a collider) that had 4 children with colliders. I performed a million iterations of each.
So, it is a little slower to find in children, but not by that much. Granted, the test wasn't exhaustive of all edge cases, but it is 2:15 am here :) |
I added the ability to use children objects and have their colliders apply to the post processing volume. I also added the required Inspector toggle and gizmo functionality. This is very useful as it allows you to more easily place volumes by moving game objects around instead of moving the center points of colliders. Additionally, you can now rotate colliders by rotating the child game objects. Finally, you can also more easily organize and label the parts of your volume as the colliders are components on separate game objects.