Sorry, code to place in should be from bool needFurtherPasses = (o2->type == dTriMeshClass); to bool needFurtherPasses = (o2->type == dTriMeshClass); //compute Ratio between Triangle size and O2 aabb size // no FurtherPasses are needed in ray class if (o2->type != dRayClass && needFurtherPasses == false) {