Zinnia.Unity icon indicating copy to clipboard operation
Zinnia.Unity copied to clipboard

Use NonAlloc method variants

Open bddckr opened this issue 6 years ago • 0 comments

This should be done in the VRTK repo, too (not sure if there is actually any usage).

The Physics class comes with several variants of the currently used methods that prevent GC allocs. We should use them - I think we should be fine allocating a pretty big static Collider array to be reused in any of these calls to make our own API not care about that detail. (A big array is needed because Unity doesn't take a List, they want an array instead. This means they won't resize it, so we have to ensure our passed array is big enough to fit all the results a caller is interested in.)

If needed we may want to leave it up to callers of our API to pass in an optional array and we'll forward it for them to the correct call.

bddckr avatar Feb 24 '19 16:02 bddckr