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