ncollide
ncollide copied to clipboard
Add a "take_point" method to AABB and BoundingSphere.
This method would grow the AABB or BoundingSphere so it contains the given point.
Would expand_to perhaps be a better name?
A few questions:
- Should this become a member of the
BoundingVolumetrait. - What about naming it
engulf, orenclose? I think enclose may be the better of the two. - I see some bonds have
&mutand&variants egmergeandmerged. Do we want&mutand&variants for this method?
What about naming it
engulf, orenclose? I think enclose may be the better of the two.
I like both of these as well, though of the two I think engulf does a better job of evoking the expansion of the existing bounds
@Plotnus :
- Yes
- Among both
engulfseems the most appropriate as @Ralith said. - Yes.
Overall, I think expand_to and engulf are two good choices. Though I'd like to have point appear on the method name too for explicitness. So in the end I'd choose engulf_point and engulf_point_mut.
What blocked me on this was implementing the functions for SpatializedNormalCone.
I'm unfamiliar with that bounding volume or how we'd adjust it based on points.
@Plotnus The SpacializedNormalCone combines an AABB that bounds points with a circular cone that bounds vectors. So adding a point to it amounts to calling self.aabb.engulf_point(pt).