dimforge / ncollide

2 and 3-dimensional collision detection library in Rust.
https://ncollide.org
Apache License 2.0
921 stars 105 forks source link

Change query::visitors::*Collector to visitors #296

Open z33ky opened 5 years ago

z33ky commented 5 years ago

Since the old *Collectors are removed, this is an API-breaking change. They could easily be re-added on top of the Visitors though.

z33ky commented 4 years ago

I've missed explaining the motivation for this change. Well, for one this gets rid of some Vecs, alleviating the need to allocate dynamic memory during iteration. The Vecs got reused, so the time-cost got amortized somewhat. However, this is not necessary anymore. Additionally, the new interface allows to return early or skip the children of certain nodes via the visitor's return-value.