return false;
Vector4 center = culling_matrix*(*matrix*compose(bsphere->get_center(), 1.0f));
- float radius = bsphere->get_radius();
+ Vector4 x_axis = *matrix*Vector4(1.0f, 0.0f, 0.0f, 0.0f);
+ float radius_sq = bsphere->get_radius()*inner_product(x_axis, x_axis);
for(unsigned i=0; i<6; ++i)
- if(inner_product(center, frustum_edges[i])>radius)
+ {
+ float distance = inner_product(center, frustum_edges[i]);
+ if(distance*distance>radius_sq)
return true;
+ }
return false;
}