- if(const Matrix *model_matrix = i->renderable->get_matrix())
- {
- if(const Geometry::BoundingSphere<float, 3> *bsphere = i->renderable->get_bounding_sphere())
- i->depth = dot(*model_matrix*bsphere->get_center()-camera_pos, look_dir)+bsphere->get_radius()*radius_factor;
- else
- i->depth = dot(*model_matrix*Vector3()-camera_pos, look_dir);
- i->depth *= sign;
- }
+ if(const Geometry::BoundingSphere<float, 3> *bsphere = i->renderable->get_bounding_sphere())
+ i->depth = dot(*matrix*bsphere->get_center()-camera_pos, look_dir)+bsphere->get_radius()*radius_factor;