/// \brief
  ///    Helper function for visibility loop implementations
  ///
  /// \param vCameraPos
  ///   Camera position to test LOD clipping
  /// \param fLODScaleSqr
  ///   Square of the LOD scaling factor
  ///
  /// \returns
  ///   true if the object is clipped either by near of far clip distance (if specified)
  inline bool IsNearOrFarClipped(const hkvVec3& vCameraPos, float fLODScaleSqr=1.f) const
  {
    // changes in this function have to be reflected in SPU version IsNearOrFarClipped
    int iLODMode = m_iPerformTestFlags&VIS_PERFORM_LODTEST;
    float fDistSqr;
    switch (iLODMode)
    {
    case VIS_LOD_TEST_NONE:
      return false;
    case VIS_LOD_TEST_CLIPPOSITION:
      fDistSqr = vCameraPos.getDistanceToSquared(m_vClipReference)*fLODScaleSqr;
      break;
    case VIS_LOD_TEST_BOUNDINGBOX:
      fDistSqr = m_BoundingBox.getDistanceToSquared(vCameraPos)*fLODScaleSqr;
      break;
    default:
      VASSERT_MSG(false,"Invalid combination of LOD flags");
      return false;
    }

    return IsNearOrFarClipped(fDistSqr);
  }
 /// \brief
 ///   Helper function to determine whether the object is clipped given the passed camera position and a factor to scale the squared distance of the object to the camera.
 bool IsNearOrFarClipped(const hkvVec3& vCameraPos, float fLODScaleSqr=1.f) const
 {
   return IsNearOrFarClipped(GetClipDistanceSqr(vCameraPos) * fLODScaleSqr);
 }
 /// \brief
 ///    Helper function for visibility loop implementations
 ///
 /// \param iFilterMask
 ///   Context's filter mask to test against the m_iVisibleMask member
 /// \param vCameraPos
 ///   Camera position to test LOD clipping
 /// \param fLODScaleSqr
 ///   Square of the LOD scaling factor. Pass a value < 0.0 to ignore near or far clipping
 ///
 /// \returns
 ///   true if the object is clipped either by near of far clip distance (if specified)
 inline bool IsClipped(unsigned int iFilterMask, const hkvVec3& vCameraPos, float fLODScaleSqr) const
 {
   if ((m_iVisibleMask&iFilterMask)==0 || ((m_iPerformTestFlags&(VIS_EXCLUDED_FROM_VISTEST|VIS_IS_INACTIVE)))!=0)
     return true;
   return (fLODScaleSqr<0.f) ? false : IsNearOrFarClipped(vCameraPos,fLODScaleSqr);
 }