ExtendRealityLtd / ExtendRealityLtd/Zinnia.Unity
Use NonAlloc method variants
- Dominant language
- C#
- Stars
- 321
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.