template<typename Iter>
static BoundingSphere from_point_cloud(const Iter &, const Iter &);
- const LinAl::Vector<T, N> get_center() const { return center; }
+ const LinAl::Vector<T, N> &get_center() const { return center; }
T get_radius() const { return radius; }
bool is_empty() const { return empty; }
};
if(d>sqdist)
{
d = sqrt(d);
- bsphere.center += v*(1-bsphere.radius/d);
- bsphere.radius += d/2;
+ bsphere.center += v*((T(1)-bsphere.radius/d)/T(2));
+ bsphere.radius = (bsphere.radius+d)/T(2);
sqdist = bsphere.radius*bsphere.radius;
}
}