Closed ejjonny closed 1 week ago
If you're open to it I wouldn't mind taking a crack at some of these when I have some time
Thanks for the feedback!
"Generic Implementation: Works with any data type that implements the Point trait." This doesn't seem to be quite right - Rect can only be constructed with nalgebra::Point & none of the objects containing P2 are generic.
The quote is referring to the data type T
that is stored in QuadTree<T>
, which is defined by the user. The Shape
trait and its implementors (just Rect
and Circle
for now) are specifically for spacial querying.
Side note - it may be more idiomatic to use Into
in the interface if the Point trait is simply a conversion, & if it's not a conversion, it should model whatever interface required from nalgebra::point
In this case it's not a conversion, it's a property accessor method. Implementing Point
is just a way of providing the 2d position of whatever data type T
the user defines.
& a side side note - ideally, users of the library shouldn't need to depend on nalgebra directly & the required types could be re-exposed with a pub use in lib.rs.
Good call, will include this in the next release.
"Generic Implementation: Works with any data type that implements the Point trait."
This doesn't seem to be quite right -
Rect
can only be constructed with nalgebra::Point & none of the objects containingP2
are generic.Side note - it may be more idiomatic to use
Into<P2>
in the interface if the Point trait is simply a conversion, & if it's not a conversion, it should model whatever interface required from nalgebra::point& a side side note - ideally, users of the library shouldn't need to depend on nalgebra directly & the required types could be re-exposed with a
pub use
in lib.rs.